Search in sources :

Example 1 with NonStickyComponentReleased

use of si.ijs.acs.objectexplorer.engine.NonStickyComponentReleased 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)

Aggregations

AcsJException (alma.acs.exceptions.AcsJException)1 Any (org.omg.CORBA.Any)1 OBJECT_NOT_EXIST (org.omg.CORBA.OBJECT_NOT_EXIST)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