Search in sources :

Example 16 with RemoteException

use of com.cosylab.acs.maci.RemoteException in project ACS by ACS-Community.

the class TestHierarchicalComponent method activateSubComponents.

/**
	 * Activates subcomponents.
	 */
private void activateSubComponents() throws Exception {
    if (!passComponentHandle) {
        client = new TestClient(name + "Client");
        clientInfo = manager.login(client);
    }
    for (int i = 0; i < subComponents.length; i++) {
        try {
            StatusHolder status = new StatusHolder();
            if (!passComponentHandle)
                manager.getComponent(clientInfo.getHandle(), new URI(subComponents[i]), true, status);
            else
                manager.getComponent(this.getHandle(), new URI(subComponents[i]), true, status);
            if (status.getStatus() != ComponentStatus.COMPONENT_ACTIVATED) {
                //System.out.println("Failed to activate component '"+subComponents[i]+"' - status: "+status.getStatus()+".");
                throw new RemoteException("Failed to activate component '" + subComponents[i] + "' - status: " + status.getStatus() + ".");
            }
        } catch (Exception ex) {
            //System.out.println("Failed to activate component '"+subComponents[i]+"'.");
            throw ex;
        }
    }
}
Also used : RemoteException(com.cosylab.acs.maci.RemoteException) URI(java.net.URI) RemoteException(com.cosylab.acs.maci.RemoteException) StatusHolder(com.cosylab.acs.maci.StatusHolder)

Example 17 with RemoteException

use of com.cosylab.acs.maci.RemoteException in project ACS by ACS-Community.

the class ClientProxy method message.

/**
	 * @see com.cosylab.acs.maci.Client#message(MessageType, String)
	 */
public void message(MessageType type, 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.message(msgType, message);
    } catch (TIMEOUT te) {
        throw new RemoteTimeoutException("Failed to invoke 'message()' method due to timeout.", te);
    } catch (TRANSIENT tre) {
        throw new RemoteTransientException("Failed to invoke 'message()' method due to transient exception.", tre);
    } catch (Throwable ex) {
        throw new RemoteException("Failed to invoke '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 18 with RemoteException

use of com.cosylab.acs.maci.RemoteException in project ACS by ACS-Community.

the class AdministratorProxy method containerLoggedIn.

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

Example 19 with RemoteException

use of com.cosylab.acs.maci.RemoteException in project ACS by ACS-Community.

the class ClientProxyImpl method components_available.

/**
	 * @see si.ijs.maci.ClientOperations#components_available(ComponentInfo[])
	 */
public void components_available(ComponentInfo[] components) {
    try {
        com.cosylab.acs.maci.ComponentInfo[] info = new com.cosylab.acs.maci.ComponentInfo[components.length];
        for (int i = 0; i < components.length; i++) {
            info[i] = new com.cosylab.acs.maci.ComponentInfo(components[i].h, components[i].name, components[i].type, components[i].code, new ComponentProxy(components[i].name, components[i].reference));
            info[i].setContainer(components[i].container);
            info[i].setContainerName(components[i].container_name);
            info[i].setClients(new IntArray(components[i].clients));
            info[i].setInterfaces(components[i].interfaces);
            info[i].setAccessRights(components[i].access);
        }
        client.components_available(info);
    } catch (RemoteException re) {
    // noop.
    }
}
Also used : IntArray(com.cosylab.acs.maci.IntArray) ComponentInfo(si.ijs.maci.ComponentInfo) RemoteException(com.cosylab.acs.maci.RemoteException)

Example 20 with RemoteException

use of com.cosylab.acs.maci.RemoteException in project ACS by ACS-Community.

the class ContainerProxy method get_component_info.

/**
	 * @see com.cosylab.acs.maci.Container#get_component_info(int[])
	 */
public ComponentInfo[] get_component_info(int[] handles) throws RemoteException {
    try {
        // returned value
        ComponentInfo[] retVal = null;
        // transform to CORBA specific 
        si.ijs.maci.ComponentInfo[] infos = container.get_component_info(handles);
        if (infos != null) {
            retVal = new ComponentInfo[infos.length];
            for (int i = 0; i < infos.length; i++) {
                ComponentInfo componentInfo = new ComponentInfo(infos[i].h, infos[i].name, infos[i].type, infos[i].code, new ComponentProxy(infos[i].name, infos[i].reference));
                componentInfo.setContainer(infos[i].container);
                componentInfo.setContainerName(infos[i].container_name);
                componentInfo.setAccessRights(inverseMapAccessRights(infos[i].access));
                componentInfo.setClients(new IntArray(infos[i].clients));
                componentInfo.setInterfaces(infos[i].interfaces);
                retVal[i] = componentInfo;
            }
        }
        return retVal;
    } catch (Exception ex) {
        RemoteException re = new RemoteException("Failed to invoke 'get_component_info()' method.", ex);
        throw re;
    }
}
Also used : IntArray(com.cosylab.acs.maci.IntArray) ComponentInfo(com.cosylab.acs.maci.ComponentInfo) CBComponentInfo(si.ijs.maci.CBComponentInfo) RemoteException(com.cosylab.acs.maci.RemoteException) TimeoutRemoteException(com.cosylab.acs.maci.TimeoutRemoteException) RemoteException(com.cosylab.acs.maci.RemoteException) IOException(java.io.IOException) TimeoutRemoteException(com.cosylab.acs.maci.TimeoutRemoteException) AcsJException(alma.acs.exceptions.AcsJException)

Aggregations

RemoteException (com.cosylab.acs.maci.RemoteException)21 TimeoutRemoteException (com.cosylab.acs.maci.TimeoutRemoteException)8 ComponentInfo (com.cosylab.acs.maci.ComponentInfo)7 RemoteTransientException (com.cosylab.acs.maci.RemoteTransientException)7 TIMEOUT (org.omg.CORBA.TIMEOUT)7 RemoteTimeoutException (com.cosylab.acs.maci.RemoteTimeoutException)6 IOException (java.io.IOException)6 TRANSIENT (org.omg.CORBA.TRANSIENT)6 AcsJException (alma.acs.exceptions.AcsJException)5 ContainerInfo (com.cosylab.acs.maci.ContainerInfo)4 IntArray (com.cosylab.acs.maci.IntArray)4 BadParametersException (com.cosylab.acs.maci.BadParametersException)3 Container (com.cosylab.acs.maci.Container)3 URI (java.net.URI)3 AcsJNoPermissionEx (alma.maciErrType.wrappers.AcsJNoPermissionEx)2 ClientInfo (com.cosylab.acs.maci.ClientInfo)2 Component (com.cosylab.acs.maci.Component)2 CoreException (com.cosylab.acs.maci.CoreException)2 Manager (com.cosylab.acs.maci.Manager)2 MessageType (com.cosylab.acs.maci.MessageType)2