Search in sources :

Example 56 with ComponentInfo

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

the class ComponentCommandClientAdd method execute.

/**
	 * @see Command#execute(PrevalentSystem)
	 */
public Serializable execute(PrevalentSystem system) throws Exception {
    ComponentInfo cobInfo = (ComponentInfo) ((ManagerImpl) system).getComponents().get(handle);
    cobInfo.getClients().add(clientHandle);
    return null;
}
Also used : ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) ComponentInfo(com.cosylab.acs.maci.ComponentInfo)

Example 57 with ComponentInfo

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

the class ComponentCommandClientRemove method execute.

/**
	 * @see Command#execute(PrevalentSystem)
	 */
public Serializable execute(PrevalentSystem system) throws Exception {
    ComponentInfo cobInfo = (ComponentInfo) ((ManagerImpl) system).getComponents().get(handle);
    cobInfo.getClients().remove(clientHandle);
    return null;
}
Also used : ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) ComponentInfo(com.cosylab.acs.maci.ComponentInfo)

Example 58 with ComponentInfo

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

the class ComponentInfoCommandComponentAdd method execute.

/**
	 * @see Command#execute(PrevalentSystem)
	 */
public Serializable execute(PrevalentSystem system) throws Exception {
    ComponentInfo componentInfo = (ComponentInfo) ((ManagerImpl) system).getComponents().get(hid);
    componentInfo.getComponents().add(handle);
    return null;
}
Also used : ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) ComponentInfo(com.cosylab.acs.maci.ComponentInfo)

Example 59 with ComponentInfo

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

the class ComponentInfoCommandComponentRemove method execute.

/**
	 * @see Command#execute(PrevalentSystem)
	 */
public Serializable execute(PrevalentSystem system) throws Exception {
    ComponentInfo componentInfo = (ComponentInfo) ((ManagerImpl) system).getComponents().get(hid);
    componentInfo.getComponents().remove(handle);
    return null;
}
Also used : ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) ComponentInfo(com.cosylab.acs.maci.ComponentInfo)

Example 60 with ComponentInfo

use of com.cosylab.acs.maci.ComponentInfo 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

ComponentInfo (com.cosylab.acs.maci.ComponentInfo)66 AcsJNoPermissionEx (alma.maciErrType.wrappers.AcsJNoPermissionEx)24 NoResourcesException (com.cosylab.acs.maci.NoResourcesException)24 BadParametersException (com.cosylab.acs.maci.BadParametersException)23 ClientInfo (com.cosylab.acs.maci.ClientInfo)23 RemoteException (com.cosylab.acs.maci.RemoteException)22 HashMap (java.util.HashMap)20 NoDefaultComponentException (com.cosylab.acs.maci.NoDefaultComponentException)19 Component (com.cosylab.acs.maci.Component)18 URISyntaxException (java.net.URISyntaxException)18 Map (java.util.Map)18 URI (java.net.URI)17 StatusHolder (com.cosylab.acs.maci.StatusHolder)15 AcsJBadParameterEx (alma.ACSErrTypeCommon.wrappers.AcsJBadParameterEx)10 AcsJCannotGetComponentEx (alma.maciErrType.wrappers.AcsJCannotGetComponentEx)10 ContainerInfo (com.cosylab.acs.maci.ContainerInfo)9 ArrayList (java.util.ArrayList)8 TimeoutRemoteException (com.cosylab.acs.maci.TimeoutRemoteException)7 ComponentSpec (com.cosylab.acs.maci.ComponentSpec)6 CoreException (com.cosylab.acs.maci.CoreException)6