Examples of ServiceDiscoveryManager


Examples of net.jini.lookup.ServiceDiscoveryManager

            }
        }

        getConfiguration(configFileName);

        ServiceDiscoveryManager clientMgr = null;

        System.setSecurityManager(new RMISecurityManager());

        try {
            LookupDiscoveryManager mgr = new LookupDiscoveryManager(groups,
                    unicastLocators, // unicast locators
                    this); // DiscoveryListener
            clientMgr = new ServiceDiscoveryManager(mgr,
                    new LeaseRenewalManager());
        } catch (Exception ex) {
            throw new RuntimeException("Failed to initialize "
                    + "ClientServerInteractionManager using \""
                    + configFileName + "\"", ex);
        }

        // This is the class of the service we are looking for...
        Class[] classes = new Class[] { DistributedActor.class };
        ServiceTemplate template = new ServiceTemplate(null, classes, null);

        try {
            cache = clientMgr.createLookupCache(template, null, // no filter
                    this); // no listener
        } catch (Exception e) {
            KernelException.stackTraceToString(e);
        }
View Full Code Here

Examples of net.jini.lookup.ServiceDiscoveryManager

        try {

            final LookupDiscoveryManager discoverMgr = new LookupDiscoveryManager(
                lookupGroups, unicastLocaters, null);

            clientMgr = new ServiceDiscoveryManager(discoverMgr, new LeaseRenewalManager());
        } catch (IOException e) {
            final String message = "Error starting discovery";
            LOG.debug(message, e);
            throw new RuntimeException(message, e);
        }
View Full Code Here

Examples of net.jini.lookup.ServiceDiscoveryManager

        terminateDelay = 0;
        super.setup(config);
        testDesc = "service discovery manager with default lookup "
                   +"discovery manager (should discover public lookups)";
        srvcDiscoveryMgr =
      new ServiceDiscoveryManager(null,
          null,
          config.getConfiguration());
        sdmList.add(srvcDiscoveryMgr);
    }//end setup
View Full Code Here

Examples of net.jini.lookup.ServiceDiscoveryManager

  mainListener = new LookupListener();
  mainListener.setLookupsToDiscover(initLookupsToStart);
  if(createSDMInSetup) {
      /* Construct the ServiceDiscoveryManager that will be tested */
      logger.log(Level.FINE, "constructing a service discovery manager");
      srvcDiscoveryMgr = new ServiceDiscoveryManager
    (getLookupDiscoveryManager(),
     null,  //LeaseRenewalManager
     sysConfig.getConfiguration());
      sdmList.add(srvcDiscoveryMgr);
  }//endif
View Full Code Here

Examples of net.jini.lookup.ServiceDiscoveryManager

        try {
           /* Terminate each service discovery manager and each discovery
            * manager created during the test run.
            */
            for(int i=0;i<sdmList.size();i++) {
                ServiceDiscoveryManager sdmMgr
                                    = (ServiceDiscoveryManager)sdmList.get(i);
                DiscoveryManagement discMgr = sdmMgr.getDiscoveryManager();
                try {
                    logger.log(Level.FINE,
       "tearDown - terminating service discovery manager "+i);
                    sdmMgr.terminate();
                } catch(Exception e) {
                    e.printStackTrace();
                }
                try {
                    logger.log(Level.FINE,
View Full Code Here

Examples of net.jini.lookup.ServiceDiscoveryManager

      new LookupDiscoveryManager(DiscoveryGroupManagement.NO_GROUPS,
               null,
               null,
               sysConfig.getConfiguration());
        srvcDiscoveryMgr =
      new ServiceDiscoveryManager(discoveryMgr,
          null,
          sysConfig.getConfiguration());
        sdmList.add(srvcDiscoveryMgr);
    }//end setup
View Full Code Here

Examples of org.jivesoftware.smackx.ServiceDiscoveryManager

            if (!BuddyList.getInstance().checkConnection()) {
                BuddyList.getInstance().connectionError();
                return;
            }

            ServiceDiscoveryManager manager = new ServiceDiscoveryManager(
                    BuddyList.getInstance().getConnection());

            // get the discover items for the server
            try {
                DiscoverItems items = manager.discoverItems(serverField.getText());
                Iterator i = items.getItems();

                String top[] = new String[]{serverField.getText(),
                        serverField.getText(), "", "", ""};
                discoItems.add(top);
                tableModel.addItem(top);

                while (i.hasNext()) {
                    DiscoverItems.Item item = (DiscoverItems.Item) i.next();
                    if (stopped) {
                        return;
                    }

                    final String[] entry = new String[]{item.getName(),
                            item.getEntityID(), "", ""};
                    discoItems.add(entry);

                    SwingUtilities.invokeLater(
                        new Runnable() {
                            public void run() {
                                tableModel.addItem(entry);
                            }
                        });
                }

                for (int icount = 0; icount < discoItems.size(); icount++) {
                    String[] entry = (String[]) discoItems.get(icount);
                    final String id = entry[1];

                    status.setText(resources.getString("status") + ": "
                             + resources.getString("gettingFeatures") + " ("
                             + id + ") ...");

                    // get the discover info about each item
                    DiscoverInfo info = null;

                    try {
                        info = manager.discoverInfo(id);
                    } catch (XMPPException e) {
                    }

                    // if the service discovery has been aborted, bail out
                    if (stopped) {
View Full Code Here

Examples of org.jivesoftware.smackx.ServiceDiscoveryManager

     * @param jid the full JID to retrieve the commands for.
     * @return the discovered items.
     * @throws XMPPException if the operation failed for some reason.
     */
    public DiscoverItems discoverCommands(String jid) throws XMPPException {
        ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager
                .getInstanceFor(connection);
        return serviceDiscoveryManager.discoverItems(jid, discoNode);
    }
View Full Code Here

Examples of org.jivesoftware.smackx.ServiceDiscoveryManager

     *
     * @param jid the full JID to publish the commands to.
     * @throws XMPPException if the operation failed for some reason.
     */
    public void publishCommands(String jid) throws XMPPException {
        ServiceDiscoveryManager serviceDiscoveryManager = ServiceDiscoveryManager
                .getInstanceFor(connection);

        // Collects the commands to publish as items
        DiscoverItems discoverItems = new DiscoverItems();
        Collection<AdHocCommandInfo> xCommandsList = getRegisteredCommands();

        for (AdHocCommandInfo info : xCommandsList) {
            DiscoverItems.Item item = new DiscoverItems.Item(info.getOwnerJID());
            item.setName(info.getName());
            item.setNode(info.getNode());
            discoverItems.addItem(item);
        }

        serviceDiscoveryManager.publishItems(jid, discoNode, discoverItems);
    }
View Full Code Here

Examples of org.jivesoftware.smackx.ServiceDiscoveryManager

     * @return a Collection of search services found on the server.
     * @throws XMPPException thrown if a server error has occurred.
     */
    public Collection getSearchServices() throws XMPPException {
        final List<String> searchServices = new ArrayList<String>();
        ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
        DiscoverItems items = discoManager.discoverItems(con.getServiceName());
        Iterator<DiscoverItems.Item> iter = items.getItems();
        while (iter.hasNext()) {
            DiscoverItems.Item item = iter.next();
            try {
                DiscoverInfo info;
                try {
                    info = discoManager.discoverInfo(item.getEntityID());
                }
                catch (XMPPException e) {
                    // Ignore Case
                    continue;
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.