1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.jencks.factory;
18
19 import org.apache.geronimo.transaction.context.TransactionContextManager;
20 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
21 import org.springframework.beans.factory.FactoryBean;
22 import org.springframework.beans.factory.InitializingBean;
23
24 /***
25 * This FactoryBean creates and configures the TransactionManagerContext
26 * of Geronimo.
27 *
28 * @author Thierry Templier
29 * @see org.apache.geronimo.transaction.log.UnrecoverableLog
30 * @see org.apache.geronimo.transaction.log.HOWLLog
31 */
32 public class TransactionContextManagerFactoryBean implements FactoryBean, InitializingBean {
33
34 private TransactionManagerImpl transactionManagerImpl;
35 private TransactionContextManager transactionContextManager;
36
37 public Object getObject() throws Exception {
38 return transactionContextManager;
39 }
40
41 public Class getObjectType() {
42 return TransactionContextManager.class;
43 }
44
45 public boolean isSingleton() {
46 return true;
47 }
48
49 public TransactionManagerImpl getTransactionManagerImpl() {
50 return transactionManagerImpl;
51 }
52
53 public void setTransactionManagerImpl(TransactionManagerImpl transactionManagerImpl) {
54 this.transactionManagerImpl = transactionManagerImpl;
55 }
56
57 /***
58 * This method initializes the transaction context manager basing on
59 * the Geronimo implementation of the transaction manager and a dedicated
60 * transaction log.
61 * <p/>
62 * It specifies too an unspecified transaction context for the transaction
63 * context manager instanciated.
64 */
65 public void afterPropertiesSet() throws Exception {
66
67 this.transactionContextManager = new TransactionContextManager(this.transactionManagerImpl,
68 this.transactionManagerImpl);
69
70
71 this.transactionContextManager.newUnspecifiedTransactionContext();
72 }
73
74 }