Adam Bien's Weblog
Project connectorZ--Lean JCA 1.6 Connector Implementations
connectorZ project is an example connector implementation under Apache 2.0 license.
The initial project (work-manager) implementation uses JCA WorkManager to execute Runnable implementations asynchronously:
@Stateless
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class ThreadsResource {
@Resource(name="jca/workmanager")
WorkExecutorFactory executorFactory;
public String threads(){
try(WorkExecutor executor = executorFactory.newExecutor();){
Runnable runnable = new Runnable(){
@Override
public void run() {
//some work to do
}
};
executor.execute(runnable);
}
The main benefit over the EJB 3.1 @Asynchronous annotation is better management and monitoring. JCA's connection pooling is configurable by application server, so throttling and monitoring comes for free.
[The connectorZ project was initiated by factoring out examples from the book "Real World Java EE Patterns--Rethinking Best Practices" book (Second Iteration), page 303 in, chapter "Generic (File) JCA"]
See you at Java EE Workhops at MUC Airport (October 22nd-24th)!
Posted at 06:59AM Oct 03, 2012 by Adam Bien in Real World Java EE Patterns - Rethinking Best Practices | Comments[1] | Views/Hits: 2900
NEW Workshop: "JPA, NoSQL, Caching, Grids and Distributed Caches with Java EE 7", May 7th, 2013, Airport Munich
A book about rethinking Java EE Patterns
Tweet Follow @AdamBien

Thanks for sharing!
Can you give us some bootstarp for inbound jca with MDB?
Posted by slim ouertani on October 03, 2012 at 02:28 PM CEST #