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