Package net.jini.discovery

Examples of net.jini.discovery.DiscoveryGroupManagement


    // This method's javadoc is inherited from an interface of this class
    public void setLookupGroups(String[] groups) throws NoSuchObjectException {
  concurrentObj.writeLock();
  try {
      ready.check();
      DiscoveryGroupManagement dgm = (DiscoveryGroupManagement) discoer;
      try {
    dgm.setGroups(groups);
      } catch (IOException e) {
    throw new RuntimeException(e.toString());
      }
      lookupGroups = dgm.getGroups();
      addLogRecord(new LookupGroupsChangedLogObj(lookupGroups));
      if (logger.isLoggable(Level.CONFIG)) {
    logger.log(
        Level.CONFIG,
        "set lookup groups {0}",
View Full Code Here


  if (log != null) {
      log.snapshot();
  }

  try {
      DiscoveryGroupManagement dgm = (DiscoveryGroupManagement) discoer;
      String[] groups = dgm.getGroups();
      if (groups == null || groups.length > 0) {
    throw new ConfigurationException(
        "discoveryManager must be initially configured with " +
        "no groups");
      }
      DiscoveryLocatorManagement dlm =
    (DiscoveryLocatorManagement) discoer;
      if (dlm.getLocators().length > 0) {
    throw new ConfigurationException(
        "discoveryManager must be initially configured with " +
        "no locators");
      }
      dgm.setGroups(lookupGroups);
      dlm.setLocators(lookupLocators);
  } catch (ClassCastException e) {
      throw new ConfigurationException(null, e);
  }
  joiner = new JoinManager(proxy, lookupAttrs, myServiceID,
View Full Code Here

                           "Getting DiscoveryManagement ",
                           e);
                return(new String[0]);
            }
        }                   
        DiscoveryGroupManagement dgm = (DiscoveryGroupManagement)dm;
        return(dgm.getGroups());       
    }
View Full Code Here

    public void addLookupGroups(String[] groups) {
        JoinManager mgr = service.getJoinManager();
        if(mgr!=null) {
            try {
                DiscoveryManagement dm = mgr.getDiscoveryManager();
                DiscoveryGroupManagement dgm = (DiscoveryGroupManagement)dm;
                dgm.addGroups(groups);               
                if(snapshotHandler!=null) {
                    try {
                        snapshotHandler.takeSnapshot();
                    } catch(IOException ioe) {
                        logger.warn("Persisting Added Lookup groups", ioe);
                    }
                }
                /* Update ServiceBeanConfig */
                setGroups(dgm.getGroups());
            } catch(IOException ioe) {
                logger.warn("Adding Lookup Groups", ioe);               
            }
        } else
            logger.warn("JoinManager is null");
View Full Code Here

    public void removeLookupGroups(String[] groups) {
        JoinManager mgr = service.getJoinManager();
        if(mgr!=null) {
            try {
                DiscoveryManagement dm = mgr.getDiscoveryManager();
                DiscoveryGroupManagement dgm = (DiscoveryGroupManagement)dm;
                dgm.removeGroups(groups);
                if(snapshotHandler!=null) {
                    try {
                        snapshotHandler.takeSnapshot();
                    } catch(IOException ioe) {
                        logger.warn("Persisting removed Lookup groups", ioe);
                    }
                }
                /* Update ServiceBeanConfig */
                setGroups(dgm.getGroups());
            } catch(Exception e) {
                logger.warn("Removing Lookup groups", e);
            }
        }
    }
View Full Code Here

    public void setLookupGroups(String[] groups) {
        JoinManager mgr = service.getJoinManager();
        if(mgr!=null) {
            try {
                DiscoveryManagement dm = mgr.getDiscoveryManager();
                DiscoveryGroupManagement dgm = (DiscoveryGroupManagement)dm;
                dgm.setGroups(groups);
                if(snapshotHandler!=null) {
                    try {
                        snapshotHandler.takeSnapshot();
                    } catch(IOException ioe) {
                        logger.warn("Persisting Lookup groups", ioe);
                    }
                }
                /* Update ServiceBeanConfig */
                setGroups(dgm.getGroups());
            } catch(IOException ioe) {
                logger.warn("Setting Lookup groups", ioe);               
            }
        }
    }
View Full Code Here

                throw new IllegalArgumentException("DiscoveryManagement cannot be null");
            ObjectOutputStream oostream = new ObjectOutputStream(out);
            oostream.writeUTF(logDirName);
            oostream.writeObject(context);
            if(discoMgmt instanceof DiscoveryGroupManagement) {
                DiscoveryGroupManagement dgm = (DiscoveryGroupManagement)discoMgmt;
                String[] groups = dgm.getGroups();
                if(groups == null)
                    groups = new String[]{"all"};
                oostream.writeObject(groups);
            } else {
                oostream.writeObject(new String[0]);
View Full Code Here

TOP

Related Classes of net.jini.discovery.DiscoveryGroupManagement

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.