Search in sources :

Example 1 with GroupInfoService

use of com.sun.corba.ee.spi.folb.GroupInfoService 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 2 with GroupInfoService

use of com.sun.corba.ee.spi.folb.GroupInfoService 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

GroupInfoService (com.sun.corba.ee.spi.folb.GroupInfoService)2 InvalidName (org.omg.CORBA.ORBPackage.InvalidName)2 ClusterInstanceInfo (com.sun.corba.ee.spi.folb.ClusterInstanceInfo)1