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;
}
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();
}
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();
}
}
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();
}
}
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...");
}
Aggregations