All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.akquinet.jbosscc.needle.db.transaction.VoidRunnable Maven / Gradle / Ivy

package de.akquinet.jbosscc.needle.db.transaction;

import javax.persistence.EntityManager;

/**
 * Default implementation of {@link Runnable}. Does nothing.
 */
public abstract class VoidRunnable implements Runnable {
  /**
   * {@inheritDoc}
   */
  @Override
  public final Object run(final EntityManager entityManager) throws Exception {
    doRun(entityManager);
    return null;
  }

  /**
   * Hook method inside run().
   * 
   * @param entityManager
   *          entityManager
   * 
   * @throws Exception
   *           when something failed
   */
  public abstract void doRun(EntityManager entityManager) throws Exception;
}