KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > stateful > StatefulManager


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