Example #1
0
  public void addEntity(String key, Object entity) throws Exception {
    for (Iterator iterator = lifecycleHandlers.iterator(); iterator.hasNext(); ) {
      LifecycleHandler lifecycleHandler = (LifecycleHandler) iterator.next();

      lifecycleHandler.addEntity(key, entity);
    }
  }
Example #2
0
  public void initialize() throws Exception {
    for (Iterator iterator = lifecycleHandlers.iterator(); iterator.hasNext(); ) {
      LifecycleHandler lifecycleHandler = (LifecycleHandler) iterator.next();

      lifecycleHandler.initialize();
    }
  }
Example #3
0
  public LifecycleHandler getLifecycleHandler(String id) throws UndefinedLifecycleHandlerException {
    LifecycleHandler lifecycleHandler = null;

    for (Iterator iterator = lifecycleHandlers.iterator(); iterator.hasNext(); ) {
      lifecycleHandler = (LifecycleHandler) iterator.next();

      if (id.equals(lifecycleHandler.getId())) {
        return lifecycleHandler;
      }
    }

    throw new UndefinedLifecycleHandlerException(
        "Specified lifecycle handler cannot be found: " + id);
  }