use of org.omg.PortableServer.POAManagerPackage.AdapterInactive in project alliance by codice.
the class MockNsili method startMockServer.
public void startMockServer(int corbaPort) {
ORB orb = null;
try {
orb = getOrbForServer(corbaPort);
LOGGER.info("Server Started...");
// blocks the current thread until the ORB is shutdown
orb.run();
} catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
LOGGER.error("Unable to start the CORBA server.", e);
} catch (IOException e) {
LOGGER.error("Unable to generate the IOR file.", e);
}
if (orb != null) {
orb.destroy();
}
}
use of org.omg.PortableServer.POAManagerPackage.AdapterInactive in project alliance by codice.
the class AccessManagerImplTest method setUp.
@Before
public void setUp() throws Exception {
setupCommonMocks();
setupAccessMgrMocks();
try {
setupOrb();
orbRunThread = new Thread(() -> orb.run());
orbRunThread.start();
} catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
LOGGER.error("Unable to start the CORBA server", e);
} catch (IOException e) {
LOGGER.error("Unable to generate the IOR file", e);
} catch (SecurityServiceException e) {
LOGGER.error("Unable to setup guest security credentials", e);
}
testQuery = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
String managerId = UUID.randomUUID().toString();
accessManager = new AccessManagerImpl();
accessManager.setFilterBuilder(new GeotoolsFilterBuilder());
accessManager.setCatalogFramework(mockCatalogFramework);
if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), accessManager);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.error("Error activating ProductMgr: {}", e);
}
}
rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
}
use of org.omg.PortableServer.POAManagerPackage.AdapterInactive in project alliance by codice.
the class CatalogMgrImplTest method setUp.
@Before
public void setUp() throws Exception {
setupCommonMocks();
setupCatalogMgrMocks();
try {
setupOrb();
orbRunThread = new Thread(() -> orb.run());
orbRunThread.start();
} catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
LOGGER.error("Unable to start the CORBA server", e);
} catch (IOException e) {
LOGGER.error("Unable to generate the IOR file", e);
} catch (SecurityServiceException e) {
LOGGER.error("Unable to setup guest security credentials", e);
}
testQuery = new Query(NsiliConstants.NSIL_ALL_VIEW, bqsQuery);
catalogMgr = new CatalogMgrImpl(rootPOA, new GeotoolsFilterBuilder(), null);
catalogMgr.setCatalogFramework(mockCatalogFramework);
}
use of org.omg.PortableServer.POAManagerPackage.AdapterInactive in project alliance by codice.
the class CreationMgrImplTest method setUp.
@Before
public void setUp() throws Exception {
try {
setupOrb();
orbRunThread = new Thread(() -> orb.run());
orbRunThread.start();
} catch (InvalidName | AdapterInactive | WrongPolicy | ServantNotActive e) {
LOGGER.error("Unable to start the CORBA server", e);
} catch (IOException e) {
LOGGER.error("Unable to generate the IOR file", e);
} catch (SecurityServiceException e) {
LOGGER.error("Unable to setup guest security credentials", e);
}
String managerId = UUID.randomUUID().toString();
creationMgr = new CreationMgrImpl();
creationMgr.setFilterBuilder(new GeotoolsFilterBuilder());
creationMgr.setCatalogFramework(mockCatalogFramework);
if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), creationMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.error("Error activating ProductMgr: {}", e);
}
}
rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), ProductMgrHelper.id());
}
use of org.omg.PortableServer.POAManagerPackage.AdapterInactive in project narayana by jbosstm.
the class javaidl_1_4 method createPOA.
/**
* Create a child POA of the root POA.
*/
public void createPOA(String adapterName, Policy[] policies) throws AdapterAlreadyExists, InvalidPolicy, AdapterInactive, SystemException {
if (_poa == null) {
opLogger.i18NLogger.warn_internal_orbspecific_oa_implementations("javaidl_1_4.createPOA");
throw new AdapterInactive();
}
POA childPoa = _poa.create_POA(adapterName, _poa.the_POAManager(), policies);
childPoa.the_POAManager().activate();
super._poas.put(adapterName, childPoa);
}
Aggregations