KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb > EJBProxyFactory


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.ejb;
23
24 import java.util.Collection JavaDoc;
25
26 import javax.ejb.EJBMetaData JavaDoc;
27
28 import org.jboss.invocation.Invocation;
29 import org.jboss.metadata.InvokerProxyBindingMetaData;
30
31 /**
32  * This is an interface for Container plugins. Implementations of this
33  * interface are responsible for receiving remote invocations of EJB's
34  * and to forward these requests to the Container it is being used with.
35  *
36  * <p>It is responsible for providing any EJBObject and EJBHome
37  * implementations (which may be statically or dynamically created).
38  *
39  * <p>Before forwarding a call to the container it must call
40  * Thread.setContextClassLoader() with the classloader of the container.
41  * It must also handle any propagated transaction and security contexts
42  * properly. It may acquire the TransactionManager from JNDI.
43  *
44  * @see Container
45  *
46  * @author <a HREF="mailto:rickard.oberg@telkel.com">Rickard �berg</a>
47  * @author <a HREF="mailto:marc.fleury@telkel.com">Marc Fleury</a>
48  * @version $Revision: 37459 $
49  *
50  *<p><b>20011219 marc fleury:</b>
51 * <ul>
52 * <li>Moved from typed return to Object to allow for optimizations in creation
53 * <li>Per Dain Sundstrom requests removed the Remote Exception.
54 * <li>The Container Invoker is going to be replaced by the ProxyFactory
55 *</ul>
56  */

57 public interface EJBProxyFactory
58 extends GenericEntityObjectFactory, ContainerPlugin
59 {
60    /**
61     * Set the invoker meta data so that the ProxyFactory can initialize properly
62     */

63    void setInvokerMetaData(InvokerProxyBindingMetaData imd);
64    /**
65     * Set the invoker jndi binding
66     */

67    void setInvokerBinding(String JavaDoc binding);
68    /**
69     * Protocol specific isIdentical implementation
70     *
71     * @param container the container
72     * @param mi the invocation
73     * @return true when identical, false otherwise
74     */

75    boolean isIdentical(Container container, Invocation mi);
76    /**
77     * This method is called whenever the metadata for this container is
78     * needed.
79     *
80     * @return An implementation of the EJBMetaData interface.
81     */

82    EJBMetaData JavaDoc getEJBMetaData();
83
84    /**
85     * This method is called whenever the EJBHome implementation for this
86     * container is needed.
87     *
88     * @return An implementation of the home interface for this container.
89     */

90    Object JavaDoc getEJBHome();
91
92    /**
93     * This method is called whenever an EJBObject implementation for a
94     * stateless session bean is needed.
95     *
96     * @return An implementation of the remote interface for this container.
97     */

98    Object JavaDoc getStatelessSessionEJBObject();
99
100    /**
101     * This method is called whenever an EJBObject implementation for a stateful
102     * session bean is needed.
103     *
104     * @param id The id of the session.
105     * @return An implementation of the remote interface for this
106     * container.
107     */

108    Object JavaDoc getStatefulSessionEJBObject(Object JavaDoc id);
109
110    /**
111     * This method is called whenever an EJBObject implementation for an
112     * entitybean is needed.
113     *
114     * @param id The primary key of the entity.
115     * @return An implementation of the remote interface for this
116     * container.
117     */

118    Object JavaDoc getEntityEJBObject(Object JavaDoc id);
119
120    /**
121     * This method is called whenever a collection of EJBObjects for a
122     * collection of primary keys is needed.
123     *
124     * @param en Enumeration of primary keys.
125     * @return A collection of EJBObjects implementing the remote
126     * interface for this container.
127     */

128    Collection JavaDoc getEntityCollection(Collection JavaDoc en);
129 }
130
131
Popular Tags