Package net.jini.lookup.entry

Examples of net.jini.lookup.entry.Name


  JoinAdmin ja = (JoinAdmin)admin;
  Entry[] attrs = ja.getLookupAttributes();
  logger.log(Level.INFO, "Calling JoinAdmin::getLookupAttributes: got " +
      attrs.length + " items");
  String name = "Spanguini";
  Entry[] newAttrs = { new Name(name) };
  logger.log(Level.INFO, "Calling JoinAdmin::addLookupAttributes()");
  ja.addLookupAttributes(newAttrs);
  logger.log(Level.INFO, "Checking addLookupAttributes call via get call");
  attrs = ja.getLookupAttributes();
  if (!assertContainsName(attrs, name)) {
      throw new TestException(
    "Did not receive proper attribute setting for Name " +
    "after adding");
  }
  name = name + "2";
  Entry[] templates = { new Name() };
  newAttrs[0] = new Name(name);
  logger.log(Level.INFO, "Calling JoinAdmin::modifyLookupAttributes()");
  ja.modifyLookupAttributes(templates, newAttrs);
  attrs = ja.getLookupAttributes();
  if (!assertContainsName(attrs, name)) {
      throw new TestException("Did not receive proper attribute setting for Name after modifying");
View Full Code Here


      if (item.attributeSets[i] instanceof ServiceInfo) {
  ServiceInfo info = (ServiceInfo) item.attributeSets[i];
  System.out.println("    ServiceInfo = " + info.name);
      }
      else if (item.attributeSets[i] instanceof Name) {
  Name name = (Name) item.attributeSets[i];
  System.out.println("    Name = " + name.name);
      }
    }
  }
View Full Code Here

      if (item.attributeSets[i] instanceof ServiceInfo) {
    ServiceInfo info = (ServiceInfo) item.attributeSets[i];
    System.out.println("    ServiceInfo = " + info.name);
      }
      else if (item.attributeSets[i] instanceof Name) {
    Name name = (Name) item.attributeSets[i];
    System.out.println("    Name = " + name.name);
      }
      else if (item.attributeSets[i] instanceof SearchEngineEntry) {
    System.out.println("    SearchEngineEntry");
    SearchEngineEntry sc =
View Full Code Here

    private void startService() {
  Vector entries = new Vector();
  entries.addElement(new ServiceInfo(PRODUCT, MANUFACTURER,
             VENDOR, VERSION, null, null));
  entries.addElement(new BasicServiceType("XmlSearchService"));
  entries.addElement(new Name(_name));
  Enumeration servers = _servers.elements();
  while (servers.hasMoreElements()) {
      XmlSearchServer server = (XmlSearchServer)servers.nextElement();
      entries.addElement(new SearchEngineEntry(server));
  }
View Full Code Here

            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())});
            else
                template = new ServiceTemplate(null, interfaces, null);

            if(config==null)
                config = EmptyConfiguration.INSTANCE;
View Full Code Here

            throw new IllegalArgumentException("sElem is null");
        if(interfaceClass == null)
            throw new IllegalArgumentException("interfaceClass is null");
        ServiceTemplate template;
        if(sElem.getMatchOnName())
            template = new ServiceTemplate(null, new Class[]{interfaceClass}, new Entry[]{new Name(sElem.getName())});
        else
            template = new ServiceTemplate(null, new Class[]{interfaceClass}, null);
        return (template);
    }
View Full Code Here

        for(int i = 0; i < interfaces.length; i++) {
            interfaces[i] = Class.forName(iNames[i], false, loader);
        }

        if(aDesc.matchOnName())
            template = new ServiceTemplate(null, interfaces, new Entry[]{new Name(aDesc.getName())});
        else
            template = new ServiceTemplate(null, interfaces, null);
        return (template);
    }
View Full Code Here

    public void testHasOperationalStringEntryAndName() {
        Assert.assertNotNull(testManager);
        testManager.waitForService(JavaSpace05.class);
        ServiceItem[] items = testManager.getServiceItems(JavaSpace05.class);
        Assert.assertEquals(1, items.length);
        Name name = null;
        OperationalStringEntry operationalStringEntry = null;
        for(Entry entry : items[0].attributeSets) {
            logger.info(String.format("Found %s", entry.getClass().getName()));
            if(entry instanceof OperationalStringEntry) {
                operationalStringEntry = (OperationalStringEntry) entry;
View Full Code Here

    ServiceItem makeServiceItem(String... versions) {
        UUID uuid = UUID.randomUUID();
        ServiceID sid = new ServiceID(uuid.getMostSignificantBits(),
                                      uuid.getLeastSignificantBits());
        List<Entry> attributes = new ArrayList<Entry>();
        attributes.add(new Name("foo"));
        attributes.add(new OperationalStringEntry("bar"));
        if(versions!=null) {
            for(String version : versions)
                attributes.add(new VersionEntry(version));
        }
View Full Code Here

TOP

Related Classes of net.jini.lookup.entry.Name

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.