KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > core > impl > tree > JBossCacheTransactionManagerAdapter


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.core.impl.tree;
10
11 import org.jboss.portal.common.transaction.TransactionManagerProvider;
12 import org.jboss.cache.TransactionManagerLookup;
13
14 import javax.transaction.TransactionManager JavaDoc;
15
16 /**
17  * Adapt JBoss Cache transaction manager lookup to our abstraction.
18  *
19  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
20  * @version $Revision: 1.1 $
21  */

22 public class JBossCacheTransactionManagerAdapter implements TransactionManagerProvider
23 {
24
25    private TransactionManagerLookup lookup;
26
27    /**
28     * @param lookup the jboss cache transaction manager lookup
29     * @throws IllegalArgumentException if the lookup is null
30     */

31    public JBossCacheTransactionManagerAdapter(TransactionManagerLookup lookup) throws IllegalArgumentException JavaDoc
32    {
33       if (lookup == null)
34       {
35          throw new IllegalArgumentException JavaDoc();
36       }
37       this.lookup = lookup;
38    }
39
40    public TransactionManager JavaDoc getTransactionManager() throws Exception JavaDoc
41    {
42       return lookup.getTransactionManager();
43    }
44 }
45
Popular Tags