Skip to content
Permalink
Browse files
BATCHEE-30 add proper JavaDocs
  • Loading branch information
struberg committed May 9, 2014
1 parent 2686547 commit 9503f569ad57ba4e75025975a6639332b40a0528
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 5 deletions.
@@ -27,10 +27,20 @@
import org.apache.batchee.spi.BatchThreadPoolService;

/**
* Activate this class in your META-INF/batchee.properties as
* This is an implementation of a {@link org.apache.batchee.spi.BatchThreadPoolService}
* which uses an &&064;Asynchronous EJB method to spawn new Threads.
* The main reason for doing this is to have properly setup JavaEE Threads even
* in JavaEE 6 environments where BatchEE is not deeply integrated in other ways.
*
* Activate this class in a batchee.properties files as
* <pre>
* BatchThreadPoolService=org.apache.batchee.container.services.executor.ee.AsyncEjbBatchThreadPoolService
* BatchThreadPoolService=org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolService
* </pre>
*
* For some containers you might additionally need to enable the
* {@link org.apache.batchee.tools.services.thread.UserTransactionTransactionService} for
* proper JTA transaction handling.
*
*/
public class AsyncEjbBatchThreadPoolService implements BatchThreadPoolService {

@@ -55,6 +65,8 @@ public void executeTask(Runnable work, Object config) {

@Override
public void shutdown() {
// X TODO
// We cannot force an async EJB to shutdown.
// This usually works out of the box if the container EJB
// undeploys or stops the application.
}
}
@@ -25,6 +25,12 @@
import javax.ejb.TransactionManagementType;
import javax.transaction.UserTransaction;

/**
* Small helper class to allow new threads being created via the
* {@link org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolService}.
*
* @see org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolService
*/
@Singleton
@Lock(LockType.READ)
@TransactionManagement(TransactionManagementType.BEAN)
@@ -6,7 +6,7 @@
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -26,7 +26,19 @@
import org.apache.batchee.spi.TransactionManagerAdapter;

/**
* @author <a href="mailto:struberg@yahoo.de">Mark Struberg</a>
* Implementation of the {@link org.apache.batchee.spi.TransactionManagementService} which controls
* the transaction via {@link javax.transaction.UserTransaction}.
* This SPI implementation is useful on containers which do not properly expose a
* fully working global TransactionManager via the specced JNDI location
* (e.g. WebSphere 8.x).
*
* To activate this implementation just add the following lines to your batchee.properties file:
* <pre>
* TransactionManagementService=org.apache.batchee.tools.services.thread.UserTransactionTransactionService
* </pre>
*
* This SPI can only be used in conjunction with the
* {@link org.apache.batchee.tools.services.thread.AsyncEjbBatchThreadPoolService}
*/
public class UserTransactionTransactionService implements TransactionManagementService {
@Override

0 comments on commit 9503f56

Please sign in to comment.