예제 #1
0
 @Override
 public void run() {
   try {
     while (!isStop()) {
       if (pauser != null) {
         pauser.pause();
       }
       try {
         sign.run();
       } catch (FailedException ex) {
         fireFailure(
             "WORKER"
                 + worker
                 + " XML signing failed after "
                 + getOperationsPerformed()
                 + " signings: "
                 + ex.getMessage());
         break;
       }
       // Sleep
       Thread.sleep((int) (random.nextDouble() * 500.0));
       increaseOperationsPerformed();
     }
   } catch (InterruptedException ex) {
     LOG.error("Interrupted: " + ex.getMessage());
   }
 }