Search in sources :

Example 1 with OSPushConsumerPOATie

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());
}
Also used : AcsJIllegalStateEventEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalStateEventEx) OSPushConsumerPOATie(alma.acsnc.OSPushConsumerPOATie) AcsJIllegalArgumentEx(alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx) AcsJStateMachineActionEx(alma.ACSErrTypeCommon.wrappers.AcsJStateMachineActionEx) AcsJContainerServicesEx(alma.JavaContainerError.wrappers.AcsJContainerServicesEx)

Aggregations

AcsJIllegalArgumentEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalArgumentEx)1 AcsJIllegalStateEventEx (alma.ACSErrTypeCommon.wrappers.AcsJIllegalStateEventEx)1 AcsJStateMachineActionEx (alma.ACSErrTypeCommon.wrappers.AcsJStateMachineActionEx)1 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)1 OSPushConsumerPOATie (alma.acsnc.OSPushConsumerPOATie)1