Package net.jini.lease

Examples of net.jini.lease.LeaseRenewalManager$Entry


    public void initialize(final EventCollectorContext context) throws Exception {
        if(context==null)
            throw new IllegalArgumentException("context must not be null");
        this.eventQ = context.getEventQueue();
        ServiceDiscoveryManager sdm = new ServiceDiscoveryManager(context.getDiscoveryManager(),
                                                                  new LeaseRenewalManager(context.getConfiguration()),
                                                                  context.getConfiguration());
        for(EventDescriptor eventDescriptor : context.getEventDescriptors()) {
            ServiceTemplate template = new ServiceTemplate(null, null, new Entry[]{eventDescriptor});
            LookupCache lCache = sdm.createLookupCache(template, null,  null);
            EventProducerManager eventProducerManager = new EventProducerManager(eventDescriptor, this, lCache);
View Full Code Here


        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());

        allServices = new ServiceTemplate(null, null, null);
        cybernodeServices = new ServiceTemplate(null, new Class[] {Cybernode.class}, null);
        monitorServices = new ServiceTemplate(null, new Class[] {ProvisionMonitor.class}, null);
        if(!CLI.getInstance().commandLine) {
View Full Code Here

            config = (config==null?EmptyConfiguration.INSTANCE:config);
            ServiceDiscoveryManager sdm =
                new ServiceDiscoveryManager(DiscoveryManagementPool.getInstance().getDiscoveryManager(sharedName,
                                                                                                      groupsToMatch,
                                                                                                      locatorsToMatch),
                                            new LeaseRenewalManager(config),
                                            config);
                   
            sdmWrapper = new SDMWrapper(sharedName, sdm, groupsToMatch, locatorsToMatch);
            synchronized(pool) {
                pool.add(sdmWrapper);
View Full Code Here

                                final DiscoveryManagement dMgr,
                                final Configuration config) throws Exception {
        super(edTemplate, listener, handback, config);
        ServiceTemplate template = new ServiceTemplate(null, null, new Entry[]{edTemplate});
        Configuration configInstance = config==null?EmptyConfiguration.INSTANCE:config;
        sdm = new ServiceDiscoveryManager(dMgr, new LeaseRenewalManager(configInstance), configInstance);
        lCache = sdm.createLookupCache(template, null,  null);
        lCache.addListener(new EventProducerManager());
    }
View Full Code Here

        ccl = Thread.currentThread().getContextClassLoader();
        leaseMgr = (LeaseRenewalManager) Config.getNonNullEntry(config,
                                                                BROWSER,
                                                                "leaseManager",
                                                                LeaseRenewalManager.class,
                                                                new LeaseRenewalManager(config));
        isAdmin = (Boolean) config.getEntry(BROWSER, "folderView", boolean.class, Boolean.TRUE);
        leasePreparer = (ProxyPreparer) Config.getNonNullEntry(config,
                                                               BROWSER,
                                                               "leasePreparer",
                                                               ProxyPreparer.class,
View Full Code Here

                new LookupDiscoveryManager(LookupDiscoveryManager.ALL_GROUPS,
                                           null,
                                           null);
        System.out.println("Discovering Hello service ...");
        ServiceDiscoveryManager sdm =
                new ServiceDiscoveryManager(ldm, new LeaseRenewalManager());
        /* Wait no more then 10 seconds to discover the service */
        ServiceItem item = sdm.lookup(tmpl, null, 10000);
        if(item != null) {
            System.out.println("Discovered Hello service");
            Hello hello = (Hello)item.service;
View Full Code Here

  }

  @Override
  protected void doDelete(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
    Entry e = entry(req);
    S3Object remove = map.remove(e);
    if (remove == null) {
      resp.sendError(404, "Not found " + e);
    } else {
      resp.sendError(HttpURLConnection.HTTP_NO_CONTENT, "Deleted");
View Full Code Here

    }

  }

  private Entry entry(HttpServletRequest req) {
    return new Entry(key(uri(req)));
  }
View Full Code Here

        log("doGet " + uri);
    if ("/".equals(uri.getPath())) {
      list(req, resp);
    } else {
      String key = uri.getPath().substring(1);
      Entry e = new Entry(key);
      S3Object obj = map.get(e);
        if (debug)
          log("map.get(" + key + ") = " + obj);
      if (obj == null) {
        resp.sendError(404, "Not here: " + e);
View Full Code Here

    if (maxKeysStr != null)
      maxKeys = Integer.parseInt(maxKeysStr);
    Writer w = new Writer();
    SortedMap<Entry, S3Object> submap = new TreeMap<Entry, S3Object>(map);
    if (prefix != null)
      submap = submap.tailMap(new Entry(prefix));
    int keyCount = 0;
    boolean truncated = false;
    String nextMarker = null;
    for (Entry e : submap.keySet()) {
      if (++keyCount > maxKeys) {
View Full Code Here

TOP

Related Classes of net.jini.lease.LeaseRenewalManager$Entry

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.