KickJava   Java API By Example, From Geeks To Geeks.

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

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

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

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

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

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

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

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

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

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

130    Collection JavaDoc getEntityCollection(Collection JavaDoc en);
131 }
132
133
Popular Tags