KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > ejb > ContainerFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.ejb;
24
25 import java.util.Enumeration JavaDoc;
26 import java.rmi.Remote JavaDoc;
27
28 import javax.persistence.EntityManagerFactory;
29 import javax.persistence.EntityManager;
30
31 import javax.ejb.*;
32 import javax.ejb.spi.HandleDelegate JavaDoc;
33 import javax.transaction.TransactionManager JavaDoc;
34 import com.sun.enterprise.deployment.EjbDescriptor;
35
36 import com.sun.enterprise.config.ConfigContext;
37
38 /**
39  * ContainerFactory creates the appropriate Container instance
40  * (StatefulSessionContainer, StatelessSessionContainer, EntityContainer,
41  * MessageBeanContainer) and initializes it.
42  *
43  * It is also a factory for EJBObject/Home instances which are needed
44  * by the Protocol Manager when a remote invocation arrives.
45  *
46  */

47 public interface ContainerFactory {
48     /**
49      * Create the appropriate Container instance and initialize it.
50      * @param ejbDescriptor the deployment descriptor of the EJB
51                 for which a container is to be created.
52      */

53     Container createContainer(EjbDescriptor ejbDescriptor,
54                   ClassLoader JavaDoc loader,
55                   com.sun.enterprise.SecurityManager sm,
56                   ConfigContext dynamicConfigContext)
57     throws Exception JavaDoc;
58
59     /**
60      * Get the container instance corresponding to the given EJB id.
61      */

62     Container getContainer(long ejbId);
63
64     /**
65      * Remove the container instance corresponding to the given EJB id.
66      */

67     public void removeContainer(long ejbId);
68
69     /**
70      * List all container instances in this JVM.
71      */

72     public Enumeration JavaDoc listContainers();
73
74     /**
75      * Return the container factory's TransactionManager object.
76      * Called from SerialContext during JNDI lookup at
77      * "java:pm/TransactionManager". Note that the container's
78      * TransactionManager is a wrapper over the real TM.
79      */

80     public TransactionManager JavaDoc getTransactionMgr();
81
82     /**
83      * Return the EjbDescriptor for the given ejbId.
84      */

85     public EjbDescriptor getEjbDescriptor(long ejbId);
86
87
88     public Object JavaDoc getEJBContextObject(String JavaDoc contextType);
89
90
91     /**
92      * Register an EntityManager with EXTENDED persistence context for
93      * the current ejb component. Only applicable for stateful session
94      * beans.
95      */

96     public EntityManager lookupExtendedEntityManager(EntityManagerFactory factory);
97
98     /**
99      * EJB Timer Service operations.
100      */

101     public void initEJBTimerService() throws Exception JavaDoc;
102     public void restoreEJBTimers() throws Exception JavaDoc;
103     public void shutdownEJBTimerService();
104
105 }
106
Popular Tags