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;
}
}
}
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);
}
}
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);
}
}
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.
}
}
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;
}
}
Aggregations