Search in sources :

Example 6 with ManagerImpl

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

the class ContainerCommandUpdate method execute.

/**
	 * @see Command#execute(PrevalentSystem)
	 */
public Serializable execute(PrevalentSystem system) throws Exception {
    ContainerInfo containerInfo = (ContainerInfo) ((ManagerImpl) system).getContainers().get(handle);
    containerInfo.setContainer(container);
    return null;
}
Also used : ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) ContainerInfo(com.cosylab.acs.maci.ContainerInfo)

Example 7 with ManagerImpl

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

the class ContainerInfoCommandComponentAdd method execute.

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

Example 8 with ManagerImpl

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

the class ClientInfoCommandComponentAdd method execute.

/**
	 * @see Command#execute(PrevalentSystem)
	 */
public Serializable execute(PrevalentSystem system) throws Exception {
    /*
		// parse handle part
		int handle	= id & HandleConstants.HANDLE_MASK;

		// info to be returned
		ClientInfo info = null;
		
		switch	(id & HandleConstants.TYPE_MASK)
		{
			case HandleConstants.CLIENT_MASK:
				info = (ClientInfo)((ManagerImpl)system).getClients().get(handle);
				break;

			case HandleConstants.ADMINISTRATOR_MASK:
				info = (ClientInfo)((ManagerImpl)system).getAdministrators().get(handle);
				break;
		}

		if (info != null)
			info.getComponents().add(handle);
		 */
    ClientInfo clientInfo = ((ManagerImpl) system).noSyncGetClientInfo(id);
    clientInfo.getComponents().add(handle);
    return null;
}
Also used : ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) ClientInfo(com.cosylab.acs.maci.ClientInfo)

Example 9 with ManagerImpl

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

the class ManagerPrevaylerTest method setUp.

/**
	 * @see junit.framework.TestCase#setUp()
	 */
protected void setUp() throws Exception {
    logger.setLevel(Level.OFF);
    manager = new ManagerImpl();
    if (isPrevaylerDisabled) {
        prevayler = null;
        System.out.println("Prevayler disabled!");
    } else {
        String recoveryLocation = FileHelper.getTempFileName(null, RECOVERY_DIR_NAME);
        System.out.println("Removing old recovery files.");
        // remove old recovery files
        // if we are not interested in recovery files just delete them
        File recoveryDir = new File(recoveryLocation);
        //recoveryDir.delete();
        File[] files = recoveryDir.listFiles();
        for (int i = 0; files != null && i < files.length; i++) files[i].delete();
        // Now check if there are log files left. Maybe user do not have enough permision
        // or we are didn't set proper permission before Manager killed.
        // That can lead to unwanted or illegal state so we will refuse to continue
        files = recoveryDir.listFiles();
        for (int i = 0; files != null && i < files.length; i++) {
            if (files[i].getName().endsWith(".commandLog"))
                throw new Exception("Some recovery files are left in recovery location probably because of permission\nUnable to start without recovery state!");
        }
        prevayler = new SnapshotPrevayler(manager, recoveryLocation);
        manager = (ManagerImpl) prevayler.system();
    }
    corbaServce = new DefaultCORBAService(logger);
    manager.initialize(prevayler, new CDBAccess(corbaServce.getORB(), logger), null, logger, null);
    //manager.setDomain(domain);
    // enable prevayler (disabled by default)
    manager.getStatePersitenceFlag().set(true);
    transport = new TestTransport();
    manager.setTransport(transport);
}
Also used : DefaultCORBAService(com.cosylab.acs.maci.plug.DefaultCORBAService) CDBAccess(com.cosylab.cdb.client.CDBAccess) ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl) SnapshotPrevayler(org.prevayler.implementation.SnapshotPrevayler) File(java.io.File)

Example 10 with ManagerImpl

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

the class ManagerImplTest method setUp.

/**
	 * @see junit.framework.TestCase#setUp()
	 */
protected void setUp() throws Exception {
    logger.setLevel(Level.OFF);
    manager = new ManagerImpl();
    corbaServce = new DefaultCORBAService(logger);
    CDBAccess cdbAccess = new CDBAccess(corbaServce.getORB(), logger);
    //cdbAccess.setBypassNameService(true);
    manager.initialize(null, cdbAccess, null, logger, null);
    //manager.setDomain(domain);
    transport = new TestTransport();
    manager.setTransport(transport);
}
Also used : DefaultCORBAService(com.cosylab.acs.maci.plug.DefaultCORBAService) CDBAccess(com.cosylab.cdb.client.CDBAccess) ManagerImpl(com.cosylab.acs.maci.manager.ManagerImpl)

Aggregations

ManagerImpl (com.cosylab.acs.maci.manager.ManagerImpl)16 ComponentInfo (com.cosylab.acs.maci.ComponentInfo)4 HandleDataStore (com.cosylab.acs.maci.manager.HandleDataStore)4 ContainerInfo (com.cosylab.acs.maci.ContainerInfo)3 DefaultCORBAService (com.cosylab.acs.maci.plug.DefaultCORBAService)3 CDBAccess (com.cosylab.cdb.client.CDBAccess)3 File (java.io.File)3 ORB (org.omg.CORBA.ORB)3 POA (org.omg.PortableServer.POA)3 ClientInfo (com.cosylab.acs.maci.ClientInfo)2 ClientProxyImpl (com.cosylab.acs.maci.plug.ClientProxyImpl)2 Properties (java.util.Properties)2 POAManager (org.omg.PortableServer.POAManager)2 SnapshotPrevayler (org.prevayler.implementation.SnapshotPrevayler)2 LogConfig (alma.acs.logging.config.LogConfig)1 LogConfigException (alma.acs.logging.config.LogConfigException)1 CoreException (com.cosylab.acs.maci.CoreException)1 CORBATransport (com.cosylab.acs.maci.plug.CORBATransport)1 ManagerProxyImpl (com.cosylab.acs.maci.plug.ManagerProxyImpl)1 NamingServiceRemoteDirectory (com.cosylab.acs.maci.plug.NamingServiceRemoteDirectory)1