use of alma.acsnc.OSPushConsumerPOATie in project ACS by ACS-Community.
the class NCSubscriber method createConnectionAction.
protected void createConnectionAction(EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance, Collection<TriggerEvent> derivedEvents) throws AcsJStateMachineActionEx {
super.createConnectionAction(evtDispatcher, errRep, scInstance, derivedEvents);
try {
// Register callback for subscribed events
if (corbaRef == null) {
corbaObj = new OSPushConsumerPOATie(NCSubscriber.this);
corbaRef = OSPushConsumerHelper.narrow(helper.getContainerServices().activateOffShoot(corbaObj));
}
// Register callback for reconnection requests
channelReconnectionCallback = new AcsNcReconnectionCallback(NCSubscriber.this, logger);
// if the factory is null, the reconnection callback is not registered
channelReconnectionCallback.registerForReconnect(services, helper.getNotifyFactory());
proxySupplier.connect_structured_push_consumer(org.omg.CosNotifyComm.StructuredPushConsumerHelper.narrow(corbaRef));
} catch (AcsJContainerServicesEx e) {
LOG_NC_SubscriptionConnect_FAIL.log(logger, channelName, getNotificationFactoryName());
throw new AcsJStateMachineActionEx(e);
} catch (org.omg.CosEventChannelAdmin.AlreadyConnected e) {
throw new AcsJStateMachineActionEx(new AcsJIllegalStateEventEx(e));
} catch (org.omg.CosEventChannelAdmin.TypeError ex) {
LOG_NC_SubscriptionConnect_FAIL.log(logger, channelName, getNotificationFactoryName());
throw new AcsJStateMachineActionEx(ex);
} catch (AcsJIllegalArgumentEx ex) {
throw new AcsJStateMachineActionEx(ex);
}
// Create the thread responsible for checking the connection and reconnect
createConCheckerThread();
LOG_NC_SubscriptionConnect_OK.log(logger, channelName, getNotificationFactoryName());
}
Aggregations