Search in sources :

Example 1 with TRANSIENT

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

the class AdministratorProxy method component_activated.

/**
	 * @see com.cosylab.acs.maci.Administrator#component_activated(com.cosylab.acs.maci.ComponentInfo, long, long)
	 */
public void component_activated(ComponentInfo info, long timeStamp, long executionId) throws RemoteException {
    try {
        // invalid info (replacement for null)
        final si.ijs.maci.ComponentInfo invalidInfo = new si.ijs.maci.ComponentInfo("<invalid>", "<invalid>", null, "<invalid>", new int[0], 0, "<invalid>", 0, 0, new String[0]);
        si.ijs.maci.ComponentInfo componentInfo = invalidInfo;
        if (info != null) {
            Object obj = null;
            if (info.getComponent() != null)
                obj = (Object) info.getComponent().getObject();
            String[] interfaces;
            if (info.getInterfaces() != null)
                interfaces = info.getInterfaces();
            else
                interfaces = new String[0];
            componentInfo = new si.ijs.maci.ComponentInfo(info.getType(), info.getCode(), obj, info.getName(), info.getClients().toArray(), info.getContainer(), info.getContainerName(), info.getHandle(), ManagerProxyImpl.mapAccessRights(info.getAccessRights()), interfaces);
        }
        administrator.component_activated(componentInfo, UTCUtility.utcJavaToOmg(timeStamp), executionId);
    } catch (TIMEOUT te) {
        throw new RemoteTimeoutException("Failed to invoke 'component_activated()' method due to timeout.", te);
    } catch (TRANSIENT tre) {
        throw new RemoteTransientException("Failed to invoke 'component_activated()' method due to transient exception.", tre);
    } catch (Throwable ex) {
        throw new RemoteException("Failed to invoke 'component_activated()' method.", ex);
    }
}
Also used : RemoteTimeoutException(com.cosylab.acs.maci.RemoteTimeoutException) Object(org.omg.CORBA.Object) ComponentInfo(com.cosylab.acs.maci.ComponentInfo) TIMEOUT(org.omg.CORBA.TIMEOUT) RemoteException(com.cosylab.acs.maci.RemoteException) TRANSIENT(org.omg.CORBA.TRANSIENT) RemoteTransientException(com.cosylab.acs.maci.RemoteTransientException)

Example 2 with TRANSIENT

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

the class ClientProxy method components_available.

/**
	 * @see com.cosylab.acs.maci.Client#components_available(ComponentInfo[])
	 */
public void components_available(ComponentInfo[] cobs) throws RemoteException {
    try {
        // invalid info (replacement for null)
        final si.ijs.maci.ComponentInfo invalidInfo = new si.ijs.maci.ComponentInfo("<invalid>", "<invalid>", null, "<invalid>", new int[0], 0, "<invalid>", 0, 0, new String[0]);
        // transform to CORBA specific 
        si.ijs.maci.ComponentInfo[] infos = null;
        if (cobs != null) {
            infos = new si.ijs.maci.ComponentInfo[cobs.length];
            for (int i = 0; i < cobs.length; i++) if (cobs[i] == null)
                infos[i] = invalidInfo;
            else {
                Object obj = null;
                if (cobs[i].getComponent() != null)
                    obj = (Object) cobs[i].getComponent().getObject();
                String[] interfaces;
                if (cobs[i].getInterfaces() != null)
                    interfaces = cobs[i].getInterfaces();
                else
                    interfaces = new String[0];
                infos[i] = new si.ijs.maci.ComponentInfo(cobs[i].getType(), cobs[i].getCode(), obj, cobs[i].getName(), cobs[i].getClients().toArray(), cobs[i].getContainer(), cobs[i].getContainerName(), cobs[i].getHandle(), ManagerProxyImpl.mapAccessRights(cobs[i].getAccessRights()), interfaces);
            }
        } else
            infos = new si.ijs.maci.ComponentInfo[0];
        client.components_available(infos);
    } catch (TIMEOUT te) {
        throw new RemoteTimeoutException("Failed to invoke 'components_available()' method due to timeout.", te);
    } catch (TRANSIENT tre) {
        throw new RemoteTransientException("Failed to invoke 'components_available()' method due to transient exception.", tre);
    } catch (Throwable ex) {
        throw new RemoteException("Failed to invoke 'component_available()' method.", ex);
    }
}
Also used : RemoteTimeoutException(com.cosylab.acs.maci.RemoteTimeoutException) Object(org.omg.CORBA.Object) ComponentInfo(com.cosylab.acs.maci.ComponentInfo) TIMEOUT(org.omg.CORBA.TIMEOUT) RemoteException(com.cosylab.acs.maci.RemoteException) TRANSIENT(org.omg.CORBA.TRANSIENT) RemoteTransientException(com.cosylab.acs.maci.RemoteTransientException)

Example 3 with TRANSIENT

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

the class ClientProxy method taggedmessage.

/**
	 * @see com.cosylab.acs.maci.Client#message(MessageType, String)
	 */
public void taggedmessage(MessageType type, short id, String message) throws RemoteException {
    try {
        short msgType;
        if (type == MessageType.MSG_ERROR)
            msgType = si.ijs.maci.Client.MSG_ERROR;
        else
            msgType = si.ijs.maci.Client.MSG_INFORMATION;
        client.taggedmessage(msgType, id, message);
    } catch (TIMEOUT te) {
        throw new RemoteTimeoutException("Failed to invoke 'tagged_message()' method due to timeout.", te);
    } catch (TRANSIENT tre) {
        throw new RemoteTransientException("Failed to invoke 'tagged_message()' method due to transient exception.", tre);
    } catch (Throwable ex) {
        throw new RemoteException("Failed to invoke 'tagged_message()' method.", ex);
    }
}
Also used : RemoteTimeoutException(com.cosylab.acs.maci.RemoteTimeoutException) TIMEOUT(org.omg.CORBA.TIMEOUT) RemoteException(com.cosylab.acs.maci.RemoteException) TRANSIENT(org.omg.CORBA.TRANSIENT) RemoteTransientException(com.cosylab.acs.maci.RemoteTransientException)

Example 4 with TRANSIENT

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

the class AdministratorProxy method clientLoggedIn.

/**
	 * @see com.cosylab.acs.maci.Administrator#clientLoggedIn(ClientInfo, long, long)
	 */
public void clientLoggedIn(ClientInfo info, long timeStamp, long executionId) throws RemoteException {
    try {
        si.ijs.maci.ClientInfo clientInfo = null;
        if (info != null)
            clientInfo = new si.ijs.maci.ClientInfo(info.getHandle(), ((ClientProxy) (info.getClient())).getClient(), info.getComponents().toArray(), info.getName(), ManagerProxyImpl.mapAccessRights(info.getAccessRights()));
        administrator.client_logged_in(clientInfo, UTCUtility.utcJavaToOmg(timeStamp), executionId);
    } catch (TIMEOUT te) {
        throw new RemoteTimeoutException("Failed to invoke 'client_logged_in()' method due to timeout.", te);
    } catch (TRANSIENT tre) {
        throw new RemoteTransientException("Failed to invoke 'client_logged_in()' method due to transient exception.", tre);
    } catch (Throwable ex) {
        throw new RemoteException("Failed to invoke 'client_logged_in()' method.", ex);
    }
}
Also used : RemoteTimeoutException(com.cosylab.acs.maci.RemoteTimeoutException) ClientInfo(com.cosylab.acs.maci.ClientInfo) TIMEOUT(org.omg.CORBA.TIMEOUT) RemoteException(com.cosylab.acs.maci.RemoteException) TRANSIENT(org.omg.CORBA.TRANSIENT) RemoteTransientException(com.cosylab.acs.maci.RemoteTransientException)

Example 5 with TRANSIENT

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

the class ServicesDaemonTest method getServicesDaemon.

private ServicesDaemon getServicesDaemon(String host) {
    String daemonLoc = AcsLocations.convertToServicesDaemonLocation(host);
    assertNotNull("corbaloc for service daemon must not be null", daemonLoc);
    logger.fine("Using services daemon corbaloc " + daemonLoc);
    ORB orb = acsCorba.getORB();
    assertNotNull("ORB provided by inherited acsCorba must not be null", daemonLoc);
    org.omg.CORBA.Object obj = orb.string_to_object(daemonLoc);
    ServicesDaemon ret = null;
    try {
        ret = ServicesDaemonHelper.narrow(obj);
    } catch (TRANSIENT ex) {
        fail("Failed to get reference to services daemon '" + daemonLoc + "' because of TRANSIENT ex");
    }
    assertNotNull("Corba ref to services daemon must not be null", ret);
    return ret;
}
Also used : ServicesDaemon(alma.acsdaemon.ServicesDaemon) TRANSIENT(org.omg.CORBA.TRANSIENT) ORB(org.omg.CORBA.ORB)

Aggregations

TRANSIENT (org.omg.CORBA.TRANSIENT)10 RemoteException (com.cosylab.acs.maci.RemoteException)6 RemoteTimeoutException (com.cosylab.acs.maci.RemoteTimeoutException)6 RemoteTransientException (com.cosylab.acs.maci.RemoteTransientException)6 TIMEOUT (org.omg.CORBA.TIMEOUT)6 OBJECT_NOT_EXIST (org.omg.CORBA.OBJECT_NOT_EXIST)3 SystemException (org.omg.CORBA.SystemException)3 Status (org.omg.CosTransactions.Status)3 ObjectStoreException (com.arjuna.ats.arjuna.exceptions.ObjectStoreException)2 ServerControl (com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl)2 ServerRecoveryTopLevelAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerRecoveryTopLevelAction)2 ComponentInfo (com.cosylab.acs.maci.ComponentInfo)2 IOException (java.io.IOException)2 Object (org.omg.CORBA.Object)2 NotPrepared (org.omg.CosTransactions.NotPrepared)2 ServicesDaemon (alma.acsdaemon.ServicesDaemon)1 ArjunaFactory (com.arjuna.ArjunaOTS.ArjunaFactory)1 StateStatus (com.arjuna.ats.arjuna.objectstore.StateStatus)1 RecoveryStatus (com.arjuna.ats.internal.jts.recovery.transactions.RecoveryStatus)1 ClientInfo (com.cosylab.acs.maci.ClientInfo)1