コード例 #1
0
    public synchronized Object makeObject() throws Exception {
      log.debug("Attempting to create another rServices object for the pool " + poolname + " ...");
      RServices rServices = (RServices) sp.borrowServantProxy(poolname);

      if (null == rServices) {
        log.debug("Borrowed an rServices object that proved to be null");
        throw new NoSuchElementException();
      }

      log.debug("rServices acquired, registering logging/console reporting listeners");

      // add output listener
      rServices.addRConsoleActionListener(new MyRConsoleActionListener());
      MyRemoteLogListener listener = new MyRemoteLogListener();
      rServices.addLogListener(listener);

      log.debug("Acquired biocep worker " + rServices.getServantName());
      return rServices;
    }
コード例 #2
0
    public synchronized void destroyObject(Object o) throws Exception {
      RServices R = (RServices) o;
      log.debug("Released biocep worker " + R.getServantName());

      sp.returnServantProxy((RServices) o);
    }