Search in sources :

Example 11 with InvalidName

use of org.omg.CORBA.ORBPackage.InvalidName in project alliance by codice.

the class StandingQueryMgrImplTest method setUp.

@Before
public void setUp() throws Exception {
    setupCommonMocks();
    setupStandingQueryMgrMocks();
    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();
    standingQueryMgr = new StandingQueryMgrImpl(null);
    standingQueryMgr.setFilterBuilder(new GeotoolsFilterBuilder());
    standingQueryMgr.setCatalogFramework(mockCatalogFramework);
    standingQueryMgr.setDefaultUpdateFrequencyMsec(60000);
    standingQueryMgr.setMaxWaitToStartTimeMsecs(TimeUnit.MINUTES.toMillis(5));
    standingQueryMgr.setMaxPendingResults(10000);
    if (!CorbaUtils.isIdActive(rootPOA, managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)))) {
        try {
            rootPOA.activate_object_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), standingQueryMgr);
        } catch (ServantAlreadyActive | ObjectAlreadyActive | WrongPolicy e) {
            LOGGER.error("Error activating StandingQueryMgr: {}", e);
        }
    }
    rootPOA.create_reference_with_id(managerId.getBytes(Charset.forName(NsiliEndpoint.ENCODING)), StandingQueryMgrHelper.id());
}
Also used : SecurityServiceException(ddf.security.service.SecurityServiceException) ObjectAlreadyActive(org.omg.PortableServer.POAPackage.ObjectAlreadyActive) AdapterInactive(org.omg.PortableServer.POAManagerPackage.AdapterInactive) StandingQueryMgrImpl(org.codice.alliance.nsili.endpoint.managers.StandingQueryMgrImpl) ServantNotActive(org.omg.PortableServer.POAPackage.ServantNotActive) IOException(java.io.IOException) WrongPolicy(org.omg.PortableServer.POAPackage.WrongPolicy) InvalidName(org.omg.CORBA.ORBPackage.InvalidName) GeotoolsFilterBuilder(ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder) ServantAlreadyActive(org.omg.PortableServer.POAPackage.ServantAlreadyActive) Before(org.junit.Before)

Example 12 with InvalidName

use of org.omg.CORBA.ORBPackage.InvalidName in project Payara by payara.

the class IiopFolbGmsClient method setORB.

public void setORB(ORB orb) {
    try {
        orb.register_initial_reference(ORBConstants.FOLB_SERVER_GROUP_INFO_SERVICE, (org.omg.CORBA.Object) gis);
        fineLog(".initGIS: naming registration complete: {0}", gis);
        // Just for logging
        GroupInfoService gisRef = (GroupInfoService) orb.resolve_initial_references(ORBConstants.FOLB_SERVER_GROUP_INFO_SERVICE);
        List<ClusterInstanceInfo> lcii = gisRef.getClusterInstanceInfo(null);
        fineLog("Results from getClusterInstanceInfo:");
        if (lcii != null) {
            for (ClusterInstanceInfo cii : lcii) {
                fineLog(cii.toString());
            }
        }
    } catch (InvalidName e) {
        fineLog(".initGIS: registering GIS failed: {0}", e);
    }
}
Also used : InvalidName(org.omg.CORBA.ORBPackage.InvalidName) ClusterInstanceInfo(com.sun.corba.ee.spi.folb.ClusterInstanceInfo) GroupInfoService(com.sun.corba.ee.spi.folb.GroupInfoService)

Example 13 with InvalidName

use of org.omg.CORBA.ORBPackage.InvalidName in project Payara by payara.

the class NamingClusterInfoImpl method initGroupInfoService.

@Override
public void initGroupInfoService(Hashtable<?, ?> myEnv, String defaultHost, String defaultPort, ORB orb, ServiceLocator services, boolean updateCluster) {
    // Always create one rrPolicy to be shared, if needed.
    final List<String> epList = getEndpointList(myEnv, defaultHost, defaultPort);
    rrPolicy = new RoundRobinPolicy(epList);
    if (updateCluster) {
        GroupInfoService gis = null;
        try {
            gis = (GroupInfoService) (orb.resolve_initial_references(ORBLocator.FOLB_CLIENT_GROUP_INFO_SERVICE));
        } catch (InvalidName ex) {
            logger.log(Level.SEVERE, FAILED_TO_RESOLVE_GROUPINFOSERVICE, ORBLocator.FOLB_CLIENT_GROUP_INFO_SERVICE);
            logger.log(Level.SEVERE, "", ex);
        }
        giso = new GroupInfoServiceObserverImpl(gis, rrPolicy);
        gis.addObserver(giso);
    }
    // this should force the initialization of the resources providers
    if (services != null) {
        for (ServiceHandle<?> provider : services.getAllServiceHandles(NamingObjectsProvider.class)) {
            provider.getService();
        // no - op. Do nothing with the provided object
        }
        // endpoints.
        if (updateCluster) {
            giso.forceMembershipChange();
        }
    }
    if (logger.isLoggable(Level.FINE))
        logger.log(Level.FINE, "NamingClusterInfoImpl.initGroupInfoService RoundRobinPolicy {0}", rrPolicy);
}
Also used : InvalidName(org.omg.CORBA.ORBPackage.InvalidName) GroupInfoService(com.sun.corba.ee.spi.folb.GroupInfoService)

Aggregations

InvalidName (org.omg.CORBA.ORBPackage.InvalidName)13 IOException (java.io.IOException)9 AdapterInactive (org.omg.PortableServer.POAManagerPackage.AdapterInactive)8 ServantNotActive (org.omg.PortableServer.POAPackage.ServantNotActive)7 WrongPolicy (org.omg.PortableServer.POAPackage.WrongPolicy)7 GeotoolsFilterBuilder (ddf.catalog.filter.proxy.builder.GeotoolsFilterBuilder)6 SecurityServiceException (ddf.security.service.SecurityServiceException)6 Before (org.junit.Before)6 ObjectAlreadyActive (org.omg.PortableServer.POAPackage.ObjectAlreadyActive)5 ServantAlreadyActive (org.omg.PortableServer.POAPackage.ServantAlreadyActive)5 BAD_PARAM (org.omg.CORBA.BAD_PARAM)3 SystemException (org.omg.CORBA.SystemException)3 UserException (org.omg.CORBA.UserException)3 GroupInfoService (com.sun.corba.ee.spi.folb.GroupInfoService)2 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 FileReader (java.io.FileReader)2 LineNumberReader (java.io.LineNumberReader)2 Query (org.codice.alliance.nsili.common.GIAS.Query)2 ORB (org.omg.CORBA.ORB)2