View Javadoc

1   package de.mxro.service.jre;
2   
3   import de.mxro.concurrency.jre.JreConcurrency;
4   import de.mxro.service.Services;
5   import de.mxro.service.utils.OperationCounter;
6   import de.mxro.service.utils.ShutdownHelper;
7   
8   public class ServicesJre {
9   
10      /**
11       * <p>
12       * A simple counter for how many operations a service is processing at any
13       * point in time.
14       * 
15       * @return A new operation counter instance.
16       */
17      public static final OperationCounter createOperationCounter() {
18          return Services.createOperationCounter(new JreConcurrency());
19      }
20  
21      /**
22       * <p>
23       * A helper to make shutdown operations safer.
24       * 
25       * @param operationCounter
26       * @return
27       */
28      public static final ShutdownHelper createShutdownHelper(final OperationCounter operationCounter) {
29          return Services.createShutdownHelper(operationCounter, new JreConcurrency());
30      }
31  
32  }