Esempio n. 1
0
 public int enableInterrupts(String handlerName) {
   Class<? extends DomainInterruptHandler> handlerClass;
   try {
     handlerClass = Class.forName(handlerName).asSubclass(DomainInterruptHandler.class);
   } catch (ClassNotFoundException cnfe) {
     _log.warn("Couldn't install interrupt handler (" + handlerName + ") : " + cnfe);
     return -1;
   }
   try {
     _interruptHandler = handlerClass.newInstance();
   } catch (Exception ee) {
     _log.warn("Couldn't install interrupt handler (" + handlerName + ") : " + ee);
     return -2;
   }
   _interruptThread = _nucleus.newThread(this);
   _interruptThread.start();
   return 0;
 }
Esempio n. 2
0
  public HsmControlOsm(String name, String args) throws Exception {
    super(name, args, false);
    _nucleus = getNucleus();
    _args = getArgs();
    try {
      if (_args.argc() < 1) {
        throw new IllegalArgumentException("Usage : ... <database>");
      }

      _database = new File(_args.argv(0));
      if (!_database.isDirectory()) {
        throw new IllegalArgumentException("Not a directory : " + _database);
      }
    } catch (Exception e) {
      start();
      kill();
      throw e;
    }
    useInterpreter(true);
    _nucleus.newThread(this, "queueWatch").start();
    start();
    export();
  }
 @Override
 protected void started() {
   _nucleus.newThread(_queueWatch, "queueWatch").start();
 }