use of com.cosylab.CDB.DAL in project ACS by ACS-Community.
the class JNDIContextFactory method getInitialContext.
/**
* @see InitialContextFactory#getInitialContext(Hashtable)
*/
public Context getInitialContext(Hashtable environment) throws NamingException {
String strIOR = (String) environment.get(Context.PROVIDER_URL);
if (strIOR == null)
throw new NamingException("There is no " + Context.PROVIDER_URL + " property set!");
// try to get the server
// create and initialize the ORB
String[] argv = {};
ORB orb = ORB.init(argv, null);
DAL dal = DALHelper.narrow(orb.string_to_object(strIOR));
JNDIContext.setOrb(orb);
JNDIContext.setDal(dal);
//System.out.println( "Returning CDBContext" );
Logger logger = ClientLogManager.getAcsLogManager().getLoggerForApplication(Server.CDB_LOGGER_NAME, true);
return new JNDIContext("", dal.list_nodes(""), logger);
}
use of com.cosylab.CDB.DAL in project ACS by ACS-Community.
the class FactoryTest method clearDalCache.
/**
* Clear the cache of the DAL
* @param contSvcs ContainerServices
* @throws Exception
*/
private void clearDalCache(ContainerServices contSvcs) throws Exception {
DAL dal = contSvcs.getCDB();
jdal = JDALHelper.narrow(dal);
if (jdal == null) {
throw new Exception("Error narrowing the DAL");
}
jdal.clear_cache_all();
}
use of com.cosylab.CDB.DAL in project ACS by ACS-Community.
the class ComponentClient method initAcs.
private void initAcs(String managerLoc, POA rootPOA) throws Exception {
try {
ManagerClient clImpl = new ManagerClient(m_clientName, m_logger) {
public void disconnect() {
m_logger.info("disconnected from manager");
m_acsManagerProxy.logoutFromManager();
m_acsManagerProxy = null;
throw new RuntimeException("disconnected from the manager");
}
};
m_managerClient = clImpl._this(acsCorba.getORB());
m_acsManagerProxy = new AcsManagerProxy(managerLoc, acsCorba.getORB(), m_logger);
m_acsManagerProxy.loginToManager(m_managerClient, 1);
DAL cdb = DALHelper.narrow(m_acsManagerProxy.get_service("CDB", false));
m_threadFactory = new CleaningDaemonThreadFactory(m_clientName, m_logger);
m_containerServices = new ContainerServicesImpl(m_acsManagerProxy, cdb, rootPOA, acsCorba, m_logger, 0, m_clientName, null, m_threadFactory);
clImpl.setContainerServices(m_containerServices);
initAlarmSystem();
} catch (Exception ex) {
// "or to set up the container services.", ex);
if (acsCorba.getORB() != null) {
acsCorba.getORB().destroy();
}
throw ex;
}
}
use of com.cosylab.CDB.DAL in project ACS by ACS-Community.
the class MyTestCBvoid method testGetDAL.
public void testGetDAL() throws Exception {
DAL dal = getContainerServices().getCDB();
assertNotNull(dal);
String managerDAOString = dal.get_DAO("MACI/Managers/Manager");
assertNotNull(managerDAOString);
m_logger.info("received manager DAO string from the CDB:\n" + managerDAOString);
}
use of com.cosylab.CDB.DAL in project ACS by ACS-Community.
the class DAOManager method backupCDB.
public void backupCDB() {
DAL dal = null;
WDAL wdal = null;
try {
dal = _contServ.getCDB();
} catch (AcsJContainerServicesEx e) {
return;
}
wdal = WDALHelper.narrow(dal);
if (wdal == null)
return;
String src = "Alarms";
String dst;
int i = 1;
do {
dst = src + ".bkp." + i;
i++;
} while (nodeExists(wdal, "", dst));
copyNode(wdal, src, dst);
}
Aggregations