The notcm branch of Jencks contains version of the main Jencks code base which has been updated to work with the experimental notcm Geronimo branch. The notcm branch of Geronimo contains a number of simplifications which vastly reduce the work required of the Jencks wrapper. The most noticeable change is the removal of the TransactionContextManager (thus the name notcm).
In addition to the changes required to work with the notcm Geronimo branch most of the factory beans were redesigned to ease the configuration of common tasks.
JDBC Data Source
The following example demonstrates how to you can create a simple JDBC data source:An error occurred: http://svn.codehaus.org/jencks/branches/notcm/src/test/resources/org/jencks/samples/outbound/jencks-tranql.xml?rev=HEAD. The system administrator has been notified.
The example simply creates a transaction manager, a connection manager, a jdbc managed connection factory to a hsql database, and finally a data source. The key object in this example is the connection manager. The connection manager is bridge between the JDBC connection factory and the transaction manager. In addition, the connection manager is responsible for pooling connections, and handles mundane tasks such as recycling stale connections. The above example used a default 10 connection pool, which is good for most cases.
Creating a JMS connection factory is as simple a creating a JDBC data source:An error occurred: http://svn.codehaus.org/jencks/branches/notcm/src/test/resources/org/jencks/samples/outbound/jencks-activemq.xml?rev=HEAD. The system administrator has been notified.
This example defines some ActiveMQ resources, and then creates a JMS connection factory using the same technique as the JDBC example. Specifically, it creates a transaction manager, a connection manager, an ActiveMQ managed connection factory, and finally a JMS connection factory using the managed connection factory and connection manager. As with the JDBC example, this configuration uses a default 10 connection pool configuration.
Jencks also supports inbound message driven POJOs. Configuration of a message driven POJO is similar to the outbound connectors, but the focus in on thread pool management instead of connector pool management. The following example, connects the ActiveMQ topic TestTopic to the echoBean message driven POJO:An error occurred: http://svn.codehaus.org/jencks/branches/notcm/src/test/resources/org/jencks/samples/inbound/activemq.xml?rev=HEAD. The system administrator has been notified.
The key object in this example is the jencks JCAContainer. The container is responsible for managing a thread pool for the specified resource adapter. Once the JCAContainer is created several JCAConnector can be created which connects a message driven POJO to the topic or queue specified int the ActiveMQ activation spec.