From c2ddab2ba05c338823182c7cdaccaa461ca3c12f Mon Sep 17 00:00:00 2001 From: rbygrave Date: Sat, 9 May 2015 01:02:55 +1200 Subject: [PATCH] No effective change - change newline char --- .../com/avaje/ebean/event/BeanFinder.java | 68 +++--- .../avaje/ebean/event/BeanPersistAdapter.java | 150 ++++++------ .../ebean/event/BeanPersistController.java | 230 +++++++++--------- .../ebean/event/BeanPersistListener.java | 202 +++++++-------- .../avaje/ebean/event/BeanQueryAdapter.java | 82 +++---- .../com/avaje/ebean/event/BulkTableEvent.java | 60 ++--- .../ebean/event/BulkTableEventListener.java | 60 ++--- .../ebean/event/ServerConfigStartup.java | 42 ++-- .../ebean/event/TransactionEventListener.java | 36 +-- .../TransactionEventListenerAdapter.java | 36 +-- 10 files changed, 483 insertions(+), 483 deletions(-) diff --git a/src/main/java/com/avaje/ebean/event/BeanFinder.java b/src/main/java/com/avaje/ebean/event/BeanFinder.java index e8357b7b7..122c62caf 100644 --- a/src/main/java/com/avaje/ebean/event/BeanFinder.java +++ b/src/main/java/com/avaje/ebean/event/BeanFinder.java @@ -1,34 +1,34 @@ -package com.avaje.ebean.event; - -import com.avaje.ebean.bean.BeanCollection; - -/** - * Used to override the finding implementation for a bean. - *

- * For beans that are not in a JDBC data source you can implement this handle - * bean finding. For example, read a log file building each entry as a bean and - * returning that. - *

- *

- * There are a number of internal BeanFinders in Ebean to return meta data from - * Ebean at runtime such as query execution statistics etc. See the beans in - * com.avaje.ebean.meta and finders in com.avaje.ebean.server.meta. - *

- */ -public interface BeanFinder { - - /** - * Find a bean using its id or unique predicate. - */ - T find(BeanQueryRequest request); - - /** - * Return a List, Set or Map for the given find request. - *

- * Note the returning object is cast to a List Set or Map so you do need to - * get the return type right. - *

- */ - BeanCollection findMany(BeanQueryRequest request); - -} +package com.avaje.ebean.event; + +import com.avaje.ebean.bean.BeanCollection; + +/** + * Used to override the finding implementation for a bean. + *

+ * For beans that are not in a JDBC data source you can implement this handle + * bean finding. For example, read a log file building each entry as a bean and + * returning that. + *

+ *

+ * There are a number of internal BeanFinders in Ebean to return meta data from + * Ebean at runtime such as query execution statistics etc. See the beans in + * com.avaje.ebean.meta and finders in com.avaje.ebean.server.meta. + *

+ */ +public interface BeanFinder { + + /** + * Find a bean using its id or unique predicate. + */ + T find(BeanQueryRequest request); + + /** + * Return a List, Set or Map for the given find request. + *

+ * Note the returning object is cast to a List Set or Map so you do need to + * get the return type right. + *

+ */ + BeanCollection findMany(BeanQueryRequest request); + +} diff --git a/src/main/java/com/avaje/ebean/event/BeanPersistAdapter.java b/src/main/java/com/avaje/ebean/event/BeanPersistAdapter.java index 37e5a125e..fc822e947 100644 --- a/src/main/java/com/avaje/ebean/event/BeanPersistAdapter.java +++ b/src/main/java/com/avaje/ebean/event/BeanPersistAdapter.java @@ -1,75 +1,75 @@ -package com.avaje.ebean.event; - -import java.util.Set; - -import com.avaje.ebean.config.ServerConfig; - -/** - * A no operation implementation of BeanPersistController. Objects extending - * this need to only override the methods they want to. - *

- * A BeanPersistAdapter is either found automatically via class path search or - * can be added programmatically via - * {@link ServerConfig#add(BeanPersistController)} or - * {@link ServerConfig#setPersistControllers(java.util.List)}. - *

- */ -public abstract class BeanPersistAdapter implements BeanPersistController { - - public abstract boolean isRegisterFor(Class cls); - - /** - * Returns 10 - override this to control the order in which - * BeanPersistController's are executed when there is multiple of them - * registered for a given entity type (class). - */ - public int getExecutionOrder() { - return 10; - } - - /** - * Returns true indicating normal processing should continue. - */ - public boolean preDelete(BeanPersistRequest request) { - return true; - } - - /** - * Returns true indicating normal processing should continue. - */ - public boolean preInsert(BeanPersistRequest request) { - return true; - } - - /** - * Returns true indicating normal processing should continue. - */ - public boolean preUpdate(BeanPersistRequest request) { - return true; - } - - /** - * Does nothing by default. - */ - public void postDelete(BeanPersistRequest request) { - } - - /** - * Does nothing by default. - */ - public void postInsert(BeanPersistRequest request) { - } - - /** - * Does nothing by default. - */ - public void postUpdate(BeanPersistRequest request) { - } - - /** - * Does nothing by default. - */ - public void postLoad(Object bean, Set includedProperties) { - } - -} +package com.avaje.ebean.event; + +import java.util.Set; + +import com.avaje.ebean.config.ServerConfig; + +/** + * A no operation implementation of BeanPersistController. Objects extending + * this need to only override the methods they want to. + *

+ * A BeanPersistAdapter is either found automatically via class path search or + * can be added programmatically via + * {@link ServerConfig#add(BeanPersistController)} or + * {@link ServerConfig#setPersistControllers(java.util.List)}. + *

+ */ +public abstract class BeanPersistAdapter implements BeanPersistController { + + public abstract boolean isRegisterFor(Class cls); + + /** + * Returns 10 - override this to control the order in which + * BeanPersistController's are executed when there is multiple of them + * registered for a given entity type (class). + */ + public int getExecutionOrder() { + return 10; + } + + /** + * Returns true indicating normal processing should continue. + */ + public boolean preDelete(BeanPersistRequest request) { + return true; + } + + /** + * Returns true indicating normal processing should continue. + */ + public boolean preInsert(BeanPersistRequest request) { + return true; + } + + /** + * Returns true indicating normal processing should continue. + */ + public boolean preUpdate(BeanPersistRequest request) { + return true; + } + + /** + * Does nothing by default. + */ + public void postDelete(BeanPersistRequest request) { + } + + /** + * Does nothing by default. + */ + public void postInsert(BeanPersistRequest request) { + } + + /** + * Does nothing by default. + */ + public void postUpdate(BeanPersistRequest request) { + } + + /** + * Does nothing by default. + */ + public void postLoad(Object bean, Set includedProperties) { + } + +} diff --git a/src/main/java/com/avaje/ebean/event/BeanPersistController.java b/src/main/java/com/avaje/ebean/event/BeanPersistController.java index 16bb86f90..19d211989 100644 --- a/src/main/java/com/avaje/ebean/event/BeanPersistController.java +++ b/src/main/java/com/avaje/ebean/event/BeanPersistController.java @@ -1,115 +1,115 @@ -package com.avaje.ebean.event; - -import java.util.Set; - -/** - * Used to enhance or override the default bean persistence mechanism. - *

- * Note that if want to totally change the finding, you need to use a BeanQueryAdapter - * rather than using postLoad(). - *

- *

- * Note that getTransaction() on the PersistRequest returns the transaction used - * for the insert, update, delete or fetch. To explicitly use this same - * transaction you should use this transaction via methods on EbeanServer. - *

- * - *
- * 
- *        Object extaBeanToSave = ...;
- *        Transaction t = request.getTransaction();
- *        EbeanServer server = request.getEbeanServer();
- *        server.save(extraBeanToSave, t);
- * 
- * 
- * - *

- * It is worth noting that BeanPersistListener is different in three main ways - * from BeanPersistController postXXX methods. - *

    - *
  • BeanPersistListener only sees successfully committed events. - * BeanController pre and post methods occur before the commit or a rollback and - * will see events that are later rolled back
  • - *
  • BeanPersistListener runs in a background thread and will not effect the - * response time of the actual persist where as BeanController code will
  • - *
  • BeanPersistListener can be notified of events from other servers in a - * cluster.
  • - *
- *

- *

- * A BeanPersistController is either found automatically via class path search - * or can be added programmatically via ServerConfiguration.addEntity(). - *

- */ -public interface BeanPersistController { - - /** - * When there are multiple BeanPersistController's for a given entity type - * this controls the order in which they are executed. - *

- * Lowest values are executed first. - *

- * - * @return an int used to control the order BeanPersistController's are - * executed - */ - int getExecutionOrder(); - - /** - * Return true if this BeanPersistController should be registered for events - * on this entity type. - */ - boolean isRegisterFor(Class cls); - - /** - * Prior to the insert perform some action. Return true if you want the - * default functionality to continue. - *

- * Return false if you have completely replaced the insert functionality and - * do not want the default insert to be performed. - *

- */ - boolean preInsert(BeanPersistRequest request); - - /** - * Prior to the update perform some action. Return true if you want the - * default functionality to continue. - *

- * Return false if you have completely replaced the update functionality and - * do not want the default update to be performed. - *

- */ - boolean preUpdate(BeanPersistRequest request); - - /** - * Prior to the delete perform some action. Return true if you want the - * default functionality to continue. - *

- * Return false if you have completely replaced the delete functionality and - * do not want the default delete to be performed. - *

- */ - boolean preDelete(BeanPersistRequest request); - - /** - * Called after the insert was performed. - */ - void postInsert(BeanPersistRequest request); - - /** - * Called after the update was performed. - */ - void postUpdate(BeanPersistRequest request); - - /** - * Called after the delete was performed. - */ - void postDelete(BeanPersistRequest request); - - /** - * Called after every each bean is fetched and loaded from the database. You - * can override this to derive some information to set to the bean. - */ - void postLoad(Object bean, Set includedProperties); - -} +package com.avaje.ebean.event; + +import java.util.Set; + +/** + * Used to enhance or override the default bean persistence mechanism. + *

+ * Note that if want to totally change the finding, you need to use a BeanQueryAdapter + * rather than using postLoad(). + *

+ *

+ * Note that getTransaction() on the PersistRequest returns the transaction used + * for the insert, update, delete or fetch. To explicitly use this same + * transaction you should use this transaction via methods on EbeanServer. + *

+ * + *
+ * 
+ *        Object extaBeanToSave = ...;
+ *        Transaction t = request.getTransaction();
+ *        EbeanServer server = request.getEbeanServer();
+ *        server.save(extraBeanToSave, t);
+ * 
+ * 
+ * + *

+ * It is worth noting that BeanPersistListener is different in three main ways + * from BeanPersistController postXXX methods. + *

    + *
  • BeanPersistListener only sees successfully committed events. + * BeanController pre and post methods occur before the commit or a rollback and + * will see events that are later rolled back
  • + *
  • BeanPersistListener runs in a background thread and will not effect the + * response time of the actual persist where as BeanController code will
  • + *
  • BeanPersistListener can be notified of events from other servers in a + * cluster.
  • + *
+ *

+ *

+ * A BeanPersistController is either found automatically via class path search + * or can be added programmatically via ServerConfiguration.addEntity(). + *

+ */ +public interface BeanPersistController { + + /** + * When there are multiple BeanPersistController's for a given entity type + * this controls the order in which they are executed. + *

+ * Lowest values are executed first. + *

+ * + * @return an int used to control the order BeanPersistController's are + * executed + */ + int getExecutionOrder(); + + /** + * Return true if this BeanPersistController should be registered for events + * on this entity type. + */ + boolean isRegisterFor(Class cls); + + /** + * Prior to the insert perform some action. Return true if you want the + * default functionality to continue. + *

+ * Return false if you have completely replaced the insert functionality and + * do not want the default insert to be performed. + *

+ */ + boolean preInsert(BeanPersistRequest request); + + /** + * Prior to the update perform some action. Return true if you want the + * default functionality to continue. + *

+ * Return false if you have completely replaced the update functionality and + * do not want the default update to be performed. + *

+ */ + boolean preUpdate(BeanPersistRequest request); + + /** + * Prior to the delete perform some action. Return true if you want the + * default functionality to continue. + *

+ * Return false if you have completely replaced the delete functionality and + * do not want the default delete to be performed. + *

+ */ + boolean preDelete(BeanPersistRequest request); + + /** + * Called after the insert was performed. + */ + void postInsert(BeanPersistRequest request); + + /** + * Called after the update was performed. + */ + void postUpdate(BeanPersistRequest request); + + /** + * Called after the delete was performed. + */ + void postDelete(BeanPersistRequest request); + + /** + * Called after every each bean is fetched and loaded from the database. You + * can override this to derive some information to set to the bean. + */ + void postLoad(Object bean, Set includedProperties); + +} diff --git a/src/main/java/com/avaje/ebean/event/BeanPersistListener.java b/src/main/java/com/avaje/ebean/event/BeanPersistListener.java index a1bcf6f89..84f923c46 100644 --- a/src/main/java/com/avaje/ebean/event/BeanPersistListener.java +++ b/src/main/java/com/avaje/ebean/event/BeanPersistListener.java @@ -1,101 +1,101 @@ -package com.avaje.ebean.event; - -import java.util.Set; - -import com.avaje.ebean.config.ServerConfig; - -/** - * Listens for committed bean events. - *

- * These listen events occur after a successful commit. They also occur in a - * background thread rather than the thread used to perform the actual insert - * update or delete. In this way there is a delay between the commit and when - * the listener is notified of the event. - *

- *

- * For a cluster these events may need to be broadcast. Each of the inserted(), - * updated() and deleted() methods return true if you want those events to be - * broadcast to the other members of a cluster (the id values are broadcast). If - * these methods return false then the events are not broadcast. - *

- *

- * It is worth noting that BeanPersistListener is different in three main ways - * from BeanPersistController postXXX methods. - *

    - *
  • BeanPersistListener only sees successfully committed events. - * BeanPersistController pre and post methods occur before the commit or a - * rollback and will see events that are later rolled back
  • - *
  • BeanPersistListener runs in a background thread and will not effect the - * response time of the actual persist where as BeanPersistController code will
  • - *
  • BeanPersistListener can be notified of events from other servers in a - * cluster.
  • - *
- *

- *

- * A BeanPersistListener is either found automatically via class path search or - * can be added programmatically via {@link ServerConfig#add(BeanPersistListener)}}. - *

- * @see ServerConfig#add(BeanPersistListener) - */ -public interface BeanPersistListener { - - /** - * Return true if this BeanPersistListener should be registered for events - * on this entity type. - */ - boolean isRegisterFor(Class cls); - - /** - * Notified that a bean has been inserted locally. Return true if you want the - * cluster to be notified of the event. - * - * @param bean - * The bean that was inserted. - */ - boolean inserted(Object bean); - - /** - * Notified that a bean has been updated locally. Return true if you want the - * cluster to be notified of the event. - * - * @param bean - * The bean that was updated. - * @param updatedProperties - * The properties that were modified by this update. - */ - boolean updated(Object bean, Set updatedProperties); - - /** - * Notified that a bean has been deleted locally. Return true if you want the - * cluster to be notified of the event. - * - * @param bean - * The bean that was deleted. - */ - boolean deleted(Object bean); - - /** - * Notify that a bean was inserted on another node of the cluster. - * - * @param id - * the id value of the inserted bean - */ - void remoteInsert(Object id); - - /** - * Notify that a bean was updated on another node of the cluster. - * - * @param id - * the id value of the updated bean. - */ - void remoteUpdate(Object id); - - /** - * Notify that a bean was deleted on another node of the cluster. - * - * @param id - * the id value of the deleted bean. - */ - void remoteDelete(Object id); - -} +package com.avaje.ebean.event; + +import java.util.Set; + +import com.avaje.ebean.config.ServerConfig; + +/** + * Listens for committed bean events. + *

+ * These listen events occur after a successful commit. They also occur in a + * background thread rather than the thread used to perform the actual insert + * update or delete. In this way there is a delay between the commit and when + * the listener is notified of the event. + *

+ *

+ * For a cluster these events may need to be broadcast. Each of the inserted(), + * updated() and deleted() methods return true if you want those events to be + * broadcast to the other members of a cluster (the id values are broadcast). If + * these methods return false then the events are not broadcast. + *

+ *

+ * It is worth noting that BeanPersistListener is different in three main ways + * from BeanPersistController postXXX methods. + *

    + *
  • BeanPersistListener only sees successfully committed events. + * BeanPersistController pre and post methods occur before the commit or a + * rollback and will see events that are later rolled back
  • + *
  • BeanPersistListener runs in a background thread and will not effect the + * response time of the actual persist where as BeanPersistController code will
  • + *
  • BeanPersistListener can be notified of events from other servers in a + * cluster.
  • + *
+ *

+ *

+ * A BeanPersistListener is either found automatically via class path search or + * can be added programmatically via {@link ServerConfig#add(BeanPersistListener)}}. + *

+ * @see ServerConfig#add(BeanPersistListener) + */ +public interface BeanPersistListener { + + /** + * Return true if this BeanPersistListener should be registered for events + * on this entity type. + */ + boolean isRegisterFor(Class cls); + + /** + * Notified that a bean has been inserted locally. Return true if you want the + * cluster to be notified of the event. + * + * @param bean + * The bean that was inserted. + */ + boolean inserted(Object bean); + + /** + * Notified that a bean has been updated locally. Return true if you want the + * cluster to be notified of the event. + * + * @param bean + * The bean that was updated. + * @param updatedProperties + * The properties that were modified by this update. + */ + boolean updated(Object bean, Set updatedProperties); + + /** + * Notified that a bean has been deleted locally. Return true if you want the + * cluster to be notified of the event. + * + * @param bean + * The bean that was deleted. + */ + boolean deleted(Object bean); + + /** + * Notify that a bean was inserted on another node of the cluster. + * + * @param id + * the id value of the inserted bean + */ + void remoteInsert(Object id); + + /** + * Notify that a bean was updated on another node of the cluster. + * + * @param id + * the id value of the updated bean. + */ + void remoteUpdate(Object id); + + /** + * Notify that a bean was deleted on another node of the cluster. + * + * @param id + * the id value of the deleted bean. + */ + void remoteDelete(Object id); + +} diff --git a/src/main/java/com/avaje/ebean/event/BeanQueryAdapter.java b/src/main/java/com/avaje/ebean/event/BeanQueryAdapter.java index 5359b842a..c2e2837df 100644 --- a/src/main/java/com/avaje/ebean/event/BeanQueryAdapter.java +++ b/src/main/java/com/avaje/ebean/event/BeanQueryAdapter.java @@ -1,41 +1,41 @@ -package com.avaje.ebean.event; - -import com.avaje.ebean.config.ServerConfig; - -/** - * Objects extending this modify queries prior their execution. - *

- * This can be used to add expressions to a query - for example to enable - * partitioning based on the user executing the query. - *

- *

- * A BeanQueryAdapter is either found automatically via class path search or can - * be added programmatically via {@link ServerConfig#add(BeanQueryAdapter)}. - *

- *

- * Note that a BeanQueryAdapter should be thread safe (stateless) and if - * registered automatically via class path search it needs to have a default - * constructor. - *

- */ -public interface BeanQueryAdapter { - - /** - * Return true if this adapter is interested in queries for the given entity - * type. - */ - boolean isRegisterFor(Class cls); - - /** - * Returns an int to to control the order in which BeanQueryAdapter are - * executed when there is multiple of them registered for a given entity type - * (class). - */ - int getExecutionOrder(); - - /** - * Modify the associated query prior to it being executed. - */ - void preQuery(BeanQueryRequest request); - -} +package com.avaje.ebean.event; + +import com.avaje.ebean.config.ServerConfig; + +/** + * Objects extending this modify queries prior their execution. + *

+ * This can be used to add expressions to a query - for example to enable + * partitioning based on the user executing the query. + *

+ *

+ * A BeanQueryAdapter is either found automatically via class path search or can + * be added programmatically via {@link ServerConfig#add(BeanQueryAdapter)}. + *

+ *

+ * Note that a BeanQueryAdapter should be thread safe (stateless) and if + * registered automatically via class path search it needs to have a default + * constructor. + *

+ */ +public interface BeanQueryAdapter { + + /** + * Return true if this adapter is interested in queries for the given entity + * type. + */ + boolean isRegisterFor(Class cls); + + /** + * Returns an int to to control the order in which BeanQueryAdapter are + * executed when there is multiple of them registered for a given entity type + * (class). + */ + int getExecutionOrder(); + + /** + * Modify the associated query prior to it being executed. + */ + void preQuery(BeanQueryRequest request); + +} diff --git a/src/main/java/com/avaje/ebean/event/BulkTableEvent.java b/src/main/java/com/avaje/ebean/event/BulkTableEvent.java index ed0fbbc0c..419e04c9c 100644 --- a/src/main/java/com/avaje/ebean/event/BulkTableEvent.java +++ b/src/main/java/com/avaje/ebean/event/BulkTableEvent.java @@ -1,30 +1,30 @@ -package com.avaje.ebean.event; - -/** - * The bulk table event. - * - * @author Robin Bygrave - */ -public interface BulkTableEvent { - - /** - * Return the name of the table that was involved. - */ - String getTableName(); - - /** - * Return true if rows were inserted. - */ - boolean isInsert(); - - /** - * Return true if rows were updated. - */ - boolean isUpdate(); - - /** - * Return true if rows were deleted. - */ - boolean isDelete(); - -} +package com.avaje.ebean.event; + +/** + * The bulk table event. + * + * @author Robin Bygrave + */ +public interface BulkTableEvent { + + /** + * Return the name of the table that was involved. + */ + String getTableName(); + + /** + * Return true if rows were inserted. + */ + boolean isInsert(); + + /** + * Return true if rows were updated. + */ + boolean isUpdate(); + + /** + * Return true if rows were deleted. + */ + boolean isDelete(); + +} diff --git a/src/main/java/com/avaje/ebean/event/BulkTableEventListener.java b/src/main/java/com/avaje/ebean/event/BulkTableEventListener.java index db1959cf6..e3583cf7b 100644 --- a/src/main/java/com/avaje/ebean/event/BulkTableEventListener.java +++ b/src/main/java/com/avaje/ebean/event/BulkTableEventListener.java @@ -1,30 +1,30 @@ -package com.avaje.ebean.event; - -import java.util.Set; - -import com.avaje.ebean.Ebean; - -/** - * Listen for bulk table events that occur. - *

- * These events can be triggered via - * {@link Ebean#externalModification(String, boolean, boolean, boolean)} or - * automatically determined from Ebean bulk update statements. - *

- * - * @author Robin Bygrave - * - */ -public interface BulkTableEventListener { - - /** - * Return the tables that this listener is interested in. - */ - Set registeredTables(); - - /** - * Process the event. - */ - void process(BulkTableEvent bulkTableEvent); - -} +package com.avaje.ebean.event; + +import java.util.Set; + +import com.avaje.ebean.Ebean; + +/** + * Listen for bulk table events that occur. + *

+ * These events can be triggered via + * {@link Ebean#externalModification(String, boolean, boolean, boolean)} or + * automatically determined from Ebean bulk update statements. + *

+ * + * @author Robin Bygrave + * + */ +public interface BulkTableEventListener { + + /** + * Return the tables that this listener is interested in. + */ + Set registeredTables(); + + /** + * Process the event. + */ + void process(BulkTableEvent bulkTableEvent); + +} diff --git a/src/main/java/com/avaje/ebean/event/ServerConfigStartup.java b/src/main/java/com/avaje/ebean/event/ServerConfigStartup.java index 080058afe..7ac3f0b84 100644 --- a/src/main/java/com/avaje/ebean/event/ServerConfigStartup.java +++ b/src/main/java/com/avaje/ebean/event/ServerConfigStartup.java @@ -1,21 +1,21 @@ -package com.avaje.ebean.event; - -import com.avaje.ebean.config.ServerConfig; - -/** - * Used to configure the server on startup. - *

- * Provides a simple way to construct and register multiple listeners and - * adapters that need shared services without using DI. - *

- * - * @author Robin Bygrave - */ -public interface ServerConfigStartup { - - /** - * On starting configure the ServerConfig. - */ - void onStart(ServerConfig serverConfig); - -} +package com.avaje.ebean.event; + +import com.avaje.ebean.config.ServerConfig; + +/** + * Used to configure the server on startup. + *

+ * Provides a simple way to construct and register multiple listeners and + * adapters that need shared services without using DI. + *

+ * + * @author Robin Bygrave + */ +public interface ServerConfigStartup { + + /** + * On starting configure the ServerConfig. + */ + void onStart(ServerConfig serverConfig); + +} diff --git a/src/main/java/com/avaje/ebean/event/TransactionEventListener.java b/src/main/java/com/avaje/ebean/event/TransactionEventListener.java index 59dc47ce3..fb9ab50c7 100644 --- a/src/main/java/com/avaje/ebean/event/TransactionEventListener.java +++ b/src/main/java/com/avaje/ebean/event/TransactionEventListener.java @@ -1,18 +1,18 @@ -package com.avaje.ebean.event; - -import com.avaje.ebean.Transaction; - -/** - * Used to get notified about commit or rollback of a transaction - */ -public interface TransactionEventListener { - /** - * Called after the transaction has been committed - */ - void postTransactionCommit(Transaction tx); - - /** - * Called after the transaction has been rolled back - */ - void postTransactionRollback(Transaction tx, Throwable cause); -} +package com.avaje.ebean.event; + +import com.avaje.ebean.Transaction; + +/** + * Used to get notified about commit or rollback of a transaction + */ +public interface TransactionEventListener { + /** + * Called after the transaction has been committed + */ + void postTransactionCommit(Transaction tx); + + /** + * Called after the transaction has been rolled back + */ + void postTransactionRollback(Transaction tx, Throwable cause); +} diff --git a/src/main/java/com/avaje/ebean/event/TransactionEventListenerAdapter.java b/src/main/java/com/avaje/ebean/event/TransactionEventListenerAdapter.java index d9f0e3d20..376dfdfbe 100644 --- a/src/main/java/com/avaje/ebean/event/TransactionEventListenerAdapter.java +++ b/src/main/java/com/avaje/ebean/event/TransactionEventListenerAdapter.java @@ -1,18 +1,18 @@ -package com.avaje.ebean.event; - -import com.avaje.ebean.Transaction; - -/** - * A no operation implementation of TransactionEventListener. Objects extending - * this need to only override the methods they want to. - */ -public abstract class TransactionEventListenerAdapter implements TransactionEventListener { - - public void postTransactionCommit(Transaction tx) { - // do nothing by default - } - - public void postTransactionRollback(Transaction tx, Throwable cause) { - // do nothing by default - } -} +package com.avaje.ebean.event; + +import com.avaje.ebean.Transaction; + +/** + * A no operation implementation of TransactionEventListener. Objects extending + * this need to only override the methods they want to. + */ +public abstract class TransactionEventListenerAdapter implements TransactionEventListener { + + public void postTransactionCommit(Transaction tx) { + // do nothing by default + } + + public void postTransactionRollback(Transaction tx, Throwable cause) { + // do nothing by default + } +}