Search in sources :

Example 1 with ComponentClient

use of alma.acs.component.client.ComponentClient in project ACS by ACS-Community.

the class XmlComponentGui method connect.

private // ok, dirty
ComponentClient connect() throws // ok, dirty
Exception {
    String managerLoc = System.getProperty("ACS.manager");
    if (managerLoc == null) {
        throw new Exception("Java property 'ACS.manager' must be set to the corbaloc of the ACS manager!");
    }
    String clientName = getClass().getName() + Long.toString(System.currentTimeMillis());
    m_logger = Logger.getLogger(clientName);
    ComponentClient componentClient = new ComponentClient(m_logger, managerLoc, clientName);
    return componentClient;
}
Also used : ComponentClient(alma.acs.component.client.ComponentClient)

Example 2 with ComponentClient

use of alma.acs.component.client.ComponentClient in project ACS by ACS-Community.

the class BCTClient method getCOB.

/**
	 * TEST_2_6 & TEST_3_6
	 * @param loop
	 */
public void getCOB(long loop) {
    SimpleBACIComponent[] SBC = new SimpleBACIComponent[(int) loop];
    ComponentClient cc = ComponentClientSingleton.getInstance();
    m_startTime = System.currentTimeMillis();
    try {
        for (int i = 0; i < loop; i++) SBC[i] = alma.perftest.SimpleBACIComponentHelper.narrow(cc.getContainerServices().getComponent(m_deviceName));
    } catch (Exception e) {
    }
    m_endTime = System.currentTimeMillis();
}
Also used : ComponentClient(alma.acs.component.client.ComponentClient) SimpleBACIComponent(alma.perftest.SimpleBACIComponent)

Example 3 with ComponentClient

use of alma.acs.component.client.ComponentClient in project ACS by ACS-Community.

the class SimpleSupplierReconnClient method createPublisherAndSubscriber.

public void createPublisherAndSubscriber() {
    try {
        m_client = new ComponentClient(m_logger, System.getProperty("ACS.manager"), "SimpleSupplierReconnClient");
        m_publisher = m_client.getContainerServices().createNotificationChannelPublisher(CHANNEL_NAME, IDLEntity.class);
        ((NCPublisher) m_publisher).setAutoreconnect(m_autoreconnect);
        m_publisher.enableEventQueue(100, m_cbObj);
    //m_publisher.setAutoreconnect(m_autoreconnect);
    } catch (AcsJContainerServicesEx e) {
    // Silently ignore the errors
    } catch (AcsJException e) {
    // Shouldn't happen
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ComponentClient(alma.acs.component.client.ComponentClient) AcsJException(alma.acs.exceptions.AcsJException) NCPublisher(alma.acs.nc.NCPublisher) IDLEntity(org.omg.CORBA.portable.IDLEntity) AcsJContainerServicesEx(alma.JavaContainerError.wrappers.AcsJContainerServicesEx) AcsJException(alma.acs.exceptions.AcsJException)

Example 4 with ComponentClient

use of alma.acs.component.client.ComponentClient in project ACS by ACS-Community.

the class SimpleSupplierConsumerClient method createPublisherAndSubscriber.

public void createPublisherAndSubscriber() {
    try {
        m_client = new ComponentClient(m_logger, System.getProperty("ACS.manager"), "SimpleSupplierConsumerClient");
        //m_subscriber = m_client.getContainerServices().createNotificationChannelSubscriber(CHANNEL_NAME, EventDescription.class);
        //m_subscriber.addSubscription(this);
        m_publisher = m_client.getContainerServices().createNotificationChannelPublisher(CHANNEL_NAME, IDLEntity.class);
    } catch (AcsJContainerServicesEx e) {
    // Silently ignore the errors
    } catch (AcsJException e) {
    // Shouldn't happen
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ComponentClient(alma.acs.component.client.ComponentClient) AcsJException(alma.acs.exceptions.AcsJException) IDLEntity(org.omg.CORBA.portable.IDLEntity) AcsJContainerServicesEx(alma.JavaContainerError.wrappers.AcsJContainerServicesEx) AcsJException(alma.acs.exceptions.AcsJException)

Example 5 with ComponentClient

use of alma.acs.component.client.ComponentClient in project ACS by ACS-Community.

the class MountConsumer method main.

////////////////////////////////////////////////////////////////////////////
/** Illustrates a simple example outside of the component/container model.
     * @param args Not used!
     */
public static void main(String[] args) {
    try {
        //Setup an ACS Java client. This has little to do with the NC API
        String managerLoc = System.getProperty("ACS.manager");
        if (managerLoc == null) {
            System.out.println("Java property 'ACS.manager' must be set to the corbaloc of the ACS manager!");
            System.exit(-1);
        }
        String clientName = "MountConsumerClient";
        ComponentClient myClient = new ComponentClient(null, managerLoc, clientName);
        //Create the consumer using the ACS Java client's container services.
        MountConsumer joe = new MountConsumer(myClient.getContainerServices());
        //After consumerReady() is invoked, processEvent(...) is invoked
        //by the channel.  That is, we have no control over when
        //that method is called.
        System.out.println("Waiting for events...");
        //Wait a while for some events
        Thread.sleep(50000);
        //Disconnect from the channel
        joe.disconnect();
        //Must cleanly disconnect the client
        myClient.tearDown();
    } catch (Exception e) {
        e.printStackTrace(System.err);
    }
    System.out.println("Done...");
}
Also used : ComponentClient(alma.acs.component.client.ComponentClient)

Aggregations

ComponentClient (alma.acs.component.client.ComponentClient)10 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)2 AcsJException (alma.acs.exceptions.AcsJException)2 SimpleBACIComponent (alma.perftest.SimpleBACIComponent)2 IDLEntity (org.omg.CORBA.portable.IDLEntity)2 ContainerServices (alma.acs.container.ContainerServices)1 NCPublisher (alma.acs.nc.NCPublisher)1 ComplexBACIComponent (alma.perftest.ComplexBACIComponent)1 ComponentsManager (cl.utfsm.samplingSystemUI.core.ComponentsManager)1 SwingWorker (javax.swing.SwingWorker)1