controllerTas.Main.Main2.java Source code

Java tutorial

Introduction

Here is the source code for controllerTas.Main.Main2.java

Source

package controllerTas.Main;
/*
 * INESC-ID, Instituto de Engenharia de Sistemas e Computadores Investigao e Desevolvimento em Lisboa
 * Copyright 2013 INESC-ID and/or its affiliates and other
 * contributors as indicated by the @author tags. All rights reserved.
 * See the copyright.txt in the distribution for a full listing of
 * individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 3.0 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

/**
 * @author Diego Didona, didona@gsd.inesc-id.pt
 *         Date: 01/02/13
 */

import eu.cloudtm.wpm.connector.WPMConnector;
import eu.cloudtm.wpm.logService.remote.events.SubscribeEvent;
import eu.cloudtm.wpm.logService.remote.listeners.TestWPMStatisticsRemoteListenerImpl;
import eu.cloudtm.wpm.logService.remote.listeners.WPMStatisticsRemoteListener;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.PropertyConfigurator;

import java.net.UnknownHostException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.Arrays;

public class Main2 {
    private static final Log log = LogFactory.getLog(Main2.class);

    public static void main(String args[]) throws NotBoundException, RemoteException, UnknownHostException {
        PropertyConfigurator.configure("conf/log4j.properties");
        log.trace("Going to create WpmConnector");
        WPMConnector connector = new WPMConnector();
        log.trace("Connector created");
        WPMStatisticsRemoteListener listener = new TestWPMStatisticsRemoteListenerImpl();//new TasWPMStatisticsRemoteListenerImpl();
        String[] VMs = new String[1];
        VMs[0] = "10.100.0.11";
        log.trace("Registering statisticRemoteListener for " + Arrays.toString(VMs));
        connector.registerStatisticsRemoteListener(new SubscribeEvent(VMs), listener);
        while (true) {
        }
    }
}