use of org.omg.PortableServer.POAPackage.ServantAlreadyActive 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.POAPackage.ServantAlreadyActive 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.POAPackage.ServantAlreadyActive in project alliance by codice.
the class LibraryImpl method getOrderMgrObject.
private Object getOrderMgrObject(String managerId) {
Object obj;
OrderMgrImpl orderMgr = new OrderMgrImpl();
orderMgr.setCatalogFramework(catalogFramework);
orderMgr.setFilterBuilder(filterBuilder);
orderMgr.setEmailConfiguration(emailConfiguration);
if (!CorbaUtils.isIdActive(poa, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
poa.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), orderMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.info("Error activating OrderMgr: ", e);
}
}
obj = poa.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), OrderMgrHelper.id());
return obj;
}
use of org.omg.PortableServer.POAPackage.ServantAlreadyActive in project alliance by codice.
the class LibraryImpl method getStandingQueryMgrObject.
private Object getStandingQueryMgrObject(String managerId) {
Object obj;
StandingQueryMgrImpl standingQueryMgr = new StandingQueryMgrImpl(querySources);
standingQueryMgr.setCatalogFramework(catalogFramework);
standingQueryMgr.setFilterBuilder(filterBuilder);
standingQueryMgr.setDefaultUpdateFrequencyMsec(defaultUpdateFrequencyMsec);
standingQueryMgr.setMaxPendingResults(maxPendingResults);
standingQueryMgr.setRemoveSourceLibrary(removeSourceLibrary);
standingQueryMgr.setOutgoingValidationEnabled(outgoingValidationEnabled);
standingQueryMgr.setMaxWaitToStartTimeMsecs(maxWaitToStartTimeMsecs);
if (!CorbaUtils.isIdActive(poa, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
poa.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), standingQueryMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.info("Error activating StandingQueryMgr: ", e);
}
}
obj = poa.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), StandingQueryMgrHelper.id());
return obj;
}
use of org.omg.PortableServer.POAPackage.ServantAlreadyActive in project alliance by codice.
the class LibraryImpl method getDataModelMgrObject.
private Object getDataModelMgrObject(String managerId) {
Object obj;
DataModelMgrImpl dataModelMgr = new DataModelMgrImpl();
if (!CorbaUtils.isIdActive(poa, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
try {
poa.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), dataModelMgr);
} catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
LOGGER.info("Error activating DataModelMgr: ", e);
}
}
obj = poa.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), DataModelMgrHelper.id());
return obj;
}
Aggregations