code: @SuppressWarnings("unchecked")
      static public <T extends Execution> T getInstance(Class<T> cls) {
          logger.debug("enter - getInstance()");
          try {
              Stack<Execution> stack;
              
              synchronized( cache ) {
                  if( !cache.containsKey(cls.getName()) ) {
                      return cls.newInstance();
                  }
                  else {
                      stack = cache.get(cls.getName());
                  }
              }
              synchronized( stack ) {
                  if( stack.empty() ) {
                      return cls.newInstance();
                  }
                  else {
                      return (T)stack.pop();
                  }
              }
          }
          catch( InstantiationException e ) {
              throw new RuntimeException(e.getMessage());
          }
          catch( IllegalAccessException e ) {
              throw new RuntimeException(e.getMessage());
          }
          finally {
              logger.debug("exit - getInstance()");
          }
      }
docs: Provides an instance of an execution object for a specific
  subclass. Executions are stored in a hash map of stacks.
  This enables an instance to be reused, if possible. Otherwise a
  new one is created.
  @param cls the subclass of <code>Execution</code> to be
  retrieved
  @return an instance of the specified class