Package com.sun.jini.thread

Examples of com.sun.jini.thread.TaskManager


            new WakeupManager(new WakeupManager.ThreadDesc(null, true));
 
        settlerpool =
            (TaskManager) Config.getNonNullEntry(
                config, TxnManager.MAHALO, "settlerPool", TaskManager.class,
                new TaskManager(settlerthreads, settlertimeout,
                                settlerload));
        taskpool =
            (TaskManager) Config.getNonNullEntry(
                config, TxnManager.MAHALO, "taskPool", TaskManager.class,
                new TaskManager(taskthreads, tasktimeout,
                                taskload))
       
        unsettledtxns = new Vector();
 
        // Create leaseFactory
View Full Code Here


                cacheTaskMgr = (TaskManager)thisConfig.getEntry
                                                           (COMPONENT_NAME,
                                                            "cacheTaskManager",
                                                            TaskManager.class);
            } catch(ConfigurationException e) { /* use default */
                cacheTaskMgr = new TaskManager(10,(15*1000),1.0f);
            }
            /* Get a special-purpose task manager for this cache from the
             * configuration. That task manager will be used to manage the
             * various instances of the special-purpose task, executed by
             * this instance of the lookup cache, that waits on verification
             * events after a previousy discovered service has been discarded.
             */
            try {
                serviceDiscardTimerTaskMgr
                    = (TaskManager)thisConfig.getEntry
                                                  (COMPONENT_NAME,
                                                   "discardTaskManager",
                                                   TaskManager.class);
            } catch(ConfigurationException e) { /* use default */
                serviceDiscardTimerTaskMgr = new TaskManager
                                                         (10,(15*1000),1.0f);
            }
        }//end LookupCacheImpl.initCache
View Full Code Here

  // If we don't have a listener we don't need do anything else
  if (!haveListener())
      return lastSeqNum;
 
  final TaskManager mgr = generator.getTaskManager();
  final WakeupManager wMgr = generator.getWakeupManager();
  mgr.add(new SendTask(mgr, wMgr, factory, lastSeqNum));
 
  return lastSeqNum;
    }
View Full Code Here

  throws IOException, ClassNotFoundException
    {
  // fill in the object from the stream
  in.defaultReadObject();

  taskManager = new TaskManager();
  wakeupManager =
      new WakeupManager(new WakeupManager.ThreadDesc(null, true));   
    }
View Full Code Here

        // If there are more readers than requests then fail()
        if (entryAllocation == 0) {
            throw new TestException("Too many reader tasks requested");
        }
        taskMgr = new TaskManager(numReaders + numWriters,
                1000 * 60, // idle timeout -- 60 secs
                1.0f); // load factor
    }
View Full Code Here

        taskMgr = (TaskManager)Config.getNonNullEntry
                                          (config,
                                           COMPONENT_NAME,
                                           "taskManager",
                                           TaskManager.class,
                                           new TaskManager(10,1000*15,1.0f) );
        /* Get the discovery manager to pass to this service's join manager. */
        try {
            joinMgrLDM  =
                (DiscoveryManagement)Config.getNonNullEntry
                                                  (config,
View Full Code Here

         */
        Notifier(Configuration config) throws ConfigurationException {
          super("Notifier");
          taskManager = (TaskManager)Config.getNonNullEntry(config,
          MERCURY, "notificationsTaskManager",
          TaskManager.class, new TaskManager());
//TODO - defer TaskManager() creation to catch block of getEntry()
          start();
        }
View Full Code Here

      throw new NullPointerException("space must be non-null");
  this.space = space;

  taskManager = (TaskManager)Config.getNonNullEntry(config,
      OutriggerServerImpl.COMPONENT_NAME, "txnMonitorTaskManager",
      TaskManager.class, new TaskManager());

        ourThread = new Thread(this, "TxnMonitor");
  ourThread.setDaemon(true);
        ourThread.start();
    }
View Full Code Here

  serviceIdGenerator = (UuidGenerator) Config.getNonNullEntry(
      config, COMPONENT, "serviceIdGenerator", UuidGenerator.class,
      serviceIdGenerator);
  tasker = (TaskManager) Config.getNonNullEntry(
      config, COMPONENT, "taskManager", TaskManager.class,
      new TaskManager(50, 1000 * 15, 1.0F));
  unexportTimeout = Config.getLongEntry(
         config, COMPONENT, "unexportTimeout", unexportTimeout,
         0, Long.MAX_VALUE);
  unexportWait = Config.getLongEntry(
         config, COMPONENT, "unexportWait", unexportWait,
View Full Code Here

    /**
     * Schedule two tasks.  The first task throws an exception.  Verify that
     * the second task is run.
     */
    public void run() throws Exception {
        TaskManager manager = new TaskManager();
        long badTaskTime = System.currentTimeMillis() + (10*1000);
        long goodTaskTime = badTaskTime + (10*1000);
        ArrayList taskList = new ArrayList();
        taskList.add(0, new Task() {
            public boolean runAfter(List tasks, int size){
                return false;

            }
            public void run() {
                throw new RuntimeException("Expected Exception");
            }
        });
        final boolean result[] = new boolean[]{false};
        taskList.add(1, new Task() {
            public boolean runAfter(List tasks, int size){
                return (tasks.size()>1);
            }
            public void run() {
                result[0] = true;
            }
        });
        manager.addAll(taskList);
        Thread.sleep(10 * 1000);
        if (!result[0]) {
            throw new TestException("A task that throws a runtime exception"
                + " prevents other tasks from running");
        }
View Full Code Here

TOP

Related Classes of com.sun.jini.thread.TaskManager

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.