Search in sources :

Example 1 with OBJECT_NOT_EXIST

use of org.omg.CORBA.OBJECT_NOT_EXIST in project ACS by ACS-Community.

the class BACIRemoteAccess method checkException.

/**
	 * @param req
	 * @throws Exception
	 */
private void checkException(Object target, Request req) throws Exception {
    Exception exceptionThrown = req.env().exception();
    if (exceptionThrown != null) {
        BACIRemoteNode device = getDeviceFromTarget(target);
        if (device != null && device.isNonSticky() && exceptionThrown instanceof OBJECT_NOT_EXIST) {
            // disconnect and provice nice error message
            try {
                device.disconnect();
            } catch (Throwable th) {
                /* noop, still report */
                th.printStackTrace();
            }
            throw new NonStickyComponentReleased("Non-sticky component released, disconnecting it automatically.");
        } else if (exceptionThrown instanceof org.omg.CORBA.UnknownUserException) {
            // without ID int the CDROutputStream (value field)
            Any exceptionValue = ((org.omg.CORBA.UnknownUserException) exceptionThrown).except;
            java.lang.Object userException = baciIntrospector.extractAny(exceptionValue);
            exceptionThrown = (Exception) userException;
        }
        // log ACS exception
        logACSException(exceptionThrown);
        throw exceptionThrown;
    }
}
Also used : NonStickyComponentReleased(si.ijs.acs.objectexplorer.engine.NonStickyComponentReleased) OBJECT_NOT_EXIST(org.omg.CORBA.OBJECT_NOT_EXIST) Any(org.omg.CORBA.Any) IntrospectionInconsistentException(si.ijs.acs.objectexplorer.engine.IntrospectionInconsistentException) AcsJException(alma.acs.exceptions.AcsJException) DataException(si.ijs.acs.objectexplorer.engine.DataException) NonStickyConnectFailedRemoteException(si.ijs.acs.objectexplorer.engine.NonStickyConnectFailedRemoteException) RemoteException(si.ijs.acs.objectexplorer.engine.RemoteException)

Example 2 with OBJECT_NOT_EXIST

use of org.omg.CORBA.OBJECT_NOT_EXIST in project ACS by ACS-Community.

the class EventModel method resolveNotificationChannel.

/**
	 * Resolves a notification channel in the naming service.
	 * 
	 * @return Reference to the event channel specified by channelName.
	 * @param bindingName
	 *           Name of the event channel and trailing domain name, as the NC is registered with the CORBA Naming Service
	 * @throws AcsJException
	 *            Standard ACS Java exception.
	 */
protected EventChannel resolveNotificationChannel(String bindingName) throws AcsJException {
    EventChannel retValue = null;
    String nameServiceKind = alma.acscommon.NC_KIND.value;
    //m_logger.info("Will call 'nctx.resolve' for binding='" + bindingName + "', kind='" + nameServiceKind + "'.");
    try {
        NameComponent[] t_NameSequence = { new NameComponent(bindingName, nameServiceKind) };
        retValue = EventChannelHelper.narrow(nctx.resolve(t_NameSequence));
    } catch (OBJECT_NOT_EXIST ex) {
        m_logger.severe("The NC '" + bindingName + "' no longer exists, probably because its notify service was restarted. The naming service still lists this NC.");
        throw new AcsJUnexpectedExceptionEx(ex);
    } catch (org.omg.CosNaming.NamingContextPackage.NotFound e) {
        // No other suppliers have created the channel yet
        m_logger.info("The '" + bindingName + "' channel has not been created yet.");
        throw new AcsJUnexpectedExceptionEx(e);
    } catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e) {
        // Think there is virtually no chance of this every happening but...
        throw new AcsJUnexpectedExceptionEx(e);
    } catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) {
        // Think there is virtually no chance of this every happening but...
        throw new AcsJUnexpectedExceptionEx(e);
    }
    return retValue;
}
Also used : EventChannel(org.omg.CosNotifyChannelAdmin.EventChannel) NameComponent(org.omg.CosNaming.NameComponent) OBJECT_NOT_EXIST(org.omg.CORBA.OBJECT_NOT_EXIST) NotFound(org.omg.CosNaming.NamingContextPackage.NotFound) AcsJUnexpectedExceptionEx(alma.ACSErrTypeCommon.wrappers.AcsJUnexpectedExceptionEx) CannotProceed(org.omg.CosNaming.NamingContextPackage.CannotProceed)

Aggregations

OBJECT_NOT_EXIST (org.omg.CORBA.OBJECT_NOT_EXIST)2 AcsJUnexpectedExceptionEx (alma.ACSErrTypeCommon.wrappers.AcsJUnexpectedExceptionEx)1 AcsJException (alma.acs.exceptions.AcsJException)1 Any (org.omg.CORBA.Any)1 NameComponent (org.omg.CosNaming.NameComponent)1 CannotProceed (org.omg.CosNaming.NamingContextPackage.CannotProceed)1 NotFound (org.omg.CosNaming.NamingContextPackage.NotFound)1 EventChannel (org.omg.CosNotifyChannelAdmin.EventChannel)1 DataException (si.ijs.acs.objectexplorer.engine.DataException)1 IntrospectionInconsistentException (si.ijs.acs.objectexplorer.engine.IntrospectionInconsistentException)1 NonStickyComponentReleased (si.ijs.acs.objectexplorer.engine.NonStickyComponentReleased)1 NonStickyConnectFailedRemoteException (si.ijs.acs.objectexplorer.engine.NonStickyConnectFailedRemoteException)1 RemoteException (si.ijs.acs.objectexplorer.engine.RemoteException)1