KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > mdb > MessageDrivenManager


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.ejb3.mdb;
8
9 import javax.ejb.TimerService JavaDoc;
10 import javax.management.ObjectName JavaDoc;
11 import org.jboss.aop.AspectManager;
12 import org.jboss.ejb3.Container;
13 import org.jboss.ejb3.Pool;
14 import org.jboss.ejb3.EjbLinkResolver;
15 import org.jboss.ejb3.security.JaccHelper;
16 import org.jboss.ejb3.entity.ManagedEntityManagerFactory;
17 import org.jboss.system.ServiceMBeanSupport;
18
19 /**
20  * Comment
21  *
22  * @author <a HREF="mailto:bill@jboss.org">Bill Burke</a>
23  * @version $Revision: 1.12.2.1 $
24  */

25 public class MessageDrivenManager extends ServiceMBeanSupport implements MessageDrivenManagerMBean, Container
26 {
27    protected MDB container;
28    protected String JavaDoc jaccContextId;
29
30    public MessageDrivenManager(ClassLoader JavaDoc cl, String JavaDoc beanClassName, String JavaDoc ejbName, AspectManager manager, String JavaDoc jaccContextId)
31    {
32       container = new MDB(ejbName, manager, cl, beanClassName);
33       this.jaccContextId = jaccContextId;
34    }
35    
36    public Container getInstance()
37    {
38       return container;
39    }
40
41    public EjbLinkResolver getEjbLinkResolver()
42    {
43       return container.getEjbLinkResolver();
44    }
45
46    public void setEjbLinkResolver(EjbLinkResolver ejbLinkResolver)
47    {
48       container.setEjbLinkResolver(ejbLinkResolver);
49    }
50
51    public MessageDrivenManager(MDB mdb, String JavaDoc jaccContextId)
52    {
53       container = mdb;
54       this.jaccContextId = jaccContextId;
55    }
56
57    public ManagedEntityManagerFactory getManagedEntityManagerFactory()
58    {
59       return container.getManagedEntityManagerFactory();
60    }
61
62    public void setManagedEntityManagerFactory(ManagedEntityManagerFactory factory)
63    {
64       container.setManagedEntityManagerFactory(factory);
65    }
66
67    public MDB getMDB()
68    {
69       return container;
70    }
71
72    public void createService() throws Exception JavaDoc
73    {
74       container.create();
75       JaccHelper.configureContainer(jaccContextId, container);
76    }
77
78    public void startService() throws Exception JavaDoc
79    {
80       container.start();
81    }
82
83    public void stopService() throws Exception JavaDoc
84    {
85       container.stop();
86    }
87
88    public void destroyService() throws Exception JavaDoc
89    {
90       container.destroy();
91    }
92
93    public Class JavaDoc getBeanClass()
94    {
95       return container.getBeanClass();
96    }
97
98    public String JavaDoc getEjbName()
99    {
100       return container.getEjbName();
101    }
102
103    public ObjectName JavaDoc getObjectName()
104    {
105       return container.getObjectName();
106    }
107
108    public TimerService JavaDoc getTimerService()
109    {
110       return container.getTimerService();
111    }
112
113    public Pool getPool()
114    {
115       return container.getPool();
116    }
117
118    public void invokePostConstruct(Object JavaDoc bean)
119    {
120       container.invokePostConstruct(bean);
121    }
122
123    public void invokePreDestroy(Object JavaDoc bean)
124    {
125       container.invokePreDestroy(bean);
126    }
127
128    public void invokePostActivate(Object JavaDoc bean)
129    {
130       container.invokePostActivate(bean);
131    }
132
133    public void invokePrePassivate(Object JavaDoc bean)
134    {
135       container.invokePrePassivate(bean);
136    }
137    
138    public void invokeInit(Object JavaDoc bean)
139    {
140       container.invokeInit(bean);
141    }
142    
143    public void invokeInit(Object JavaDoc bean, Class JavaDoc[] initParameterTypes, Object JavaDoc[] initParameterValues)
144    {
145       container.invokeInit(bean, initParameterTypes, initParameterValues);
146    }
147
148    public Object JavaDoc construct()
149    {
150       return container.construct();
151    }
152
153 }
154
Popular Tags