Package org.rioproject.impl.client

Examples of org.rioproject.impl.client.DiscoveryManagementPool


     * @see org.rioproject.servicebean.ServiceBeanContext#getDiscoveryManagement()
     */
    public DiscoveryManagement getDiscoveryManagement() throws IOException {
        if(serviceDiscoMgmt == null) {
            logger.trace("Create DiscoveryManagement for {}/{}", sElem.getOperationalStringName(), sElem.getName());
            DiscoveryManagementPool discoPool = DiscoveryManagementPool.getInstance();

            String locatorString = System.getProperty(Constants.LOCATOR_PROPERTY_NAME);
            List<LookupLocator> locators = new ArrayList<LookupLocator>();
            if(sElem.getServiceBeanConfig().getLocators()!=null)
                locators.addAll(
                    Arrays.asList(sElem.getServiceBeanConfig().getLocators()));

            if(locatorString!=null) {
                LookupLocator[] systemLocators = JiniClient.parseLocators(locatorString);
                if(locators.isEmpty()) {
                    locators.addAll(Arrays.asList(systemLocators));
                } else {
                    List<LookupLocator> toAdd = new ArrayList<LookupLocator>();
                    for(LookupLocator lookLoc : systemLocators) {
                        boolean add = true;
                        for(LookupLocator ll : locators) {
                            if(ll.equals(lookLoc)) {
                                add = false;
                                break;
                            }
                        }
                        if(add)
                            toAdd.add(lookLoc);
                    }
                    for(LookupLocator ll : toAdd)
                        locators.add(ll);
                }
            }
            LookupLocator[] locatorsToUse = locators.isEmpty()?null:
                                            locators.toArray(new LookupLocator[locators.size()]);
            if(sElem.getDiscoveryManagementPooling()) {
                serviceDiscoMgmt = discoPool.getDiscoveryManager(getOperationalStringName(),
                                                                 sElem.getServiceBeanConfig().getGroups(),
                                                                 locatorsToUse);
            } else {
                Configuration discoConfig = null;
                try {
                    discoConfig = getConfiguration();
                } catch(ConfigurationException e) {
                    logger.trace("Getting Configuration while creating DiscoveryManagement", e);
                }
                serviceDiscoMgmt = discoPool.getDiscoveryManager(serviceBeanManager.getServiceID().toString(),
                                                                 sElem.getServiceBeanConfig().getGroups(),
                                                                 locatorsToUse,
                                                                 null,
                                                                 discoConfig);
            }
View Full Code Here


            if(instances!=null) {
                for (ServiceBeanInstance instance : instances) {
                    addServiceBeanInstance(instance);
                }
            }
            DiscoveryManagementPool discoPool = DiscoveryManagementPool.getInstance();
            DiscoveryManagement dm = discoPool.getDiscoveryManager(svcElement.getOperationalStringName(),
                                                                   svcElement.getServiceBeanConfig().getGroups(),
                                                                   svcElement.getServiceBeanConfig().getLocators());
            ServiceTemplate template;
            if(svcElement.getMatchOnName())
                template = new ServiceTemplate(null, interfaces, new Entry[]{new Name(svcElement.getName())});
View Full Code Here

        LookupServiceHandler(final AssociationDescriptor aDesc,
                             final AssociationHandler handler,
                             final Configuration config) {
            this.handler = handler;
            try {
                DiscoveryManagementPool discoPool = DiscoveryManagementPool.getInstance();
                dm = discoPool.getDiscoveryManager(aDesc.getOperationalStringName(),
                                                   aDesc.getGroups(),
                                                   aDesc.getLocators());
                dm.addDiscoveryListener(this);
                proxyPreparer = (ProxyPreparer)config.getEntry(CONFIG_COMPONENT,
                                                               "proxyPreparer",
View Full Code Here

                    logger.warn("Unregistering PlatformCapability [{}]", pCap.getName(), e);
                }
            }
        }
        /* Terminate the DiscoveryManagementPool */
        DiscoveryManagementPool discoPool = DiscoveryManagementPool.getInstance();
        if(discoPool!=null)
            discoPool.terminate();

        /* Tell the utility that started the Cybernode we are going away */
        ServiceBeanManager serviceBeanManager = context.getServiceBeanManager();
        if(serviceBeanManager!=null) {
            DiscardManager discardMgr = serviceBeanManager.getDiscardManager();
View Full Code Here

                                                            ProxyPreparer.class,
                                                            new BasicProxyPreparer());
        int serviceInfoPoolSize = (Integer) config.getEntry(CLI.CONFIG_COMPONENT, "serviceInfoPoolSize", int.class, 5);
        serviceInfoFetchPool = Executors.newFixedThreadPool(serviceInfoPoolSize);

        DiscoveryManagementPool discoPool = DiscoveryManagementPool.getInstance();
        DiscoveryManagement discoMgr = discoPool.getDiscoveryManager("cli", groups, locators, null, config);
        //LookupDiscoveryManager discoMgr =
        //    new LookupDiscoveryManager(groups, locators, null, lookupConfig);
        recordingDiscoveryListener = new RecordingDiscoveryListener(discoMgr);
        discoMgr.addDiscoveryListener(recordingDiscoveryListener);
        sdm = new ServiceDiscoveryManager(discoMgr, new LeaseRenewalManager());
View Full Code Here

TOP

Related Classes of org.rioproject.impl.client.DiscoveryManagementPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.