User: user57 Date: 02/01/02 20:01:00 Modified: src/main/org/jboss/proxy/ejb/handle StatefulHandleImpl.java Log: o migrated all components to a new JMX domain name model. jboss.system is now where to core/spine components live. moved all components that were in JBOSS-SYSTEM that did not move into a jboss.* domain into jboss (where the server is now registered). The point was to limit the members of jboss.system to core bits only. o Created org.jboss.system.Server, which does the work of initialization that org.jboss.Main used to do. Main now only parses the command line, sets up basic legecy properties and creates a Server instance. o Moved functionality of Shutdown (component not cl tool) into Server ( which is bound as jboss.system:service=Server) o Moved more Runtime access from Info into Server. Exposed memory info as attributes. o Logging a WARN everywhere that uses System.getProperty("jboss.system.home") as that should go away soon/eventually. o Initialized the invokerMap in the harmi impl to avoid NPE o Made getopt.jar a member of the lib/* dir instead of adding it to the run.jar and shutdown.jars each time. o Minor cosmetic changes along the way. Revision Changes Path 1.2 +43 -63 jboss/src/main/org/jboss/proxy/ejb/handle/StatefulHandleImpl.java Index: StatefulHandleImpl.java =================================================================== RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/proxy/ejb/handle/StatefulHandleImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- StatefulHandleImpl.java 2001/12/19 07:22:27 1.1 +++ StatefulHandleImpl.java 2002/01/03 04:01:00 1.2 @@ -1,9 +1,10 @@ /* -* JBoss, the OpenSource J2EE webOS -* -* Distributable under LGPL license. -* See terms of license at gnu.org. -*/ + * JBoss, the OpenSource J2EE webOS + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ + package org.jboss.proxy.ejb.handle; import java.rmi.RemoteException; @@ -24,28 +25,21 @@ import org.jboss.security.SecurityAssociation; /** -* An EJB stateful session bean handle. -* -* @author <a href="mailto:[EMAIL PROTECTED]>Marc Fleury</a> -* @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a> -* @version $Revision: 1.1 $ -*/ + * An EJB stateful session bean handle. + * + * @author <a href="mailto:[EMAIL PROTECTED]>Marc Fleury</a> + * @author <a href="mailto:[EMAIL PROTECTED]">Jason Dillon</a> + * @version $Revision: 1.2 $ + */ public class StatefulHandleImpl -implements Handle + implements Handle { - // Constants ----------------------------------------------------- - - /** Serial Version Identifier. */ - // private static final long serialVersionUID = -2592509632957623102L; - - // Static -------------------------------------------------------- - /** A reference to {@link Handle#getEJBObject}. */ protected static final Method GET_EJB_OBJECT; /** - * Initialize <tt>Handle</tt> method references. - */ + * Initialize <tt>Handle</tt> method references. + */ static { try { GET_EJB_OBJECT = Handle.class.getMethod("getEJBObject", new Class[0]); @@ -56,24 +50,20 @@ } } - // Attributes ---------------------------------------------------- - /** The identity of the bean. */ public String jndiName; public String server; public Object id; - // Constructors -------------------------------------------------- - /** - * Construct a <tt>StatefulHandleImpl</tt>. - * - * @param handle The initial context handle that will be used - * to restore the naming context or null to use - * a fresh InitialContext object. - * @param name JNDI name. - * @param id Identity of the bean. - */ + * Construct a <tt>StatefulHandleImpl</tt>. + * + * @param handle The initial context handle that will be used + * to restore the naming context or null to use + * a fresh InitialContext object. + * @param name JNDI name. + * @param id Identity of the bean. + */ public StatefulHandleImpl(String jndiName, String server, Object id) { this.jndiName= jndiName; @@ -81,26 +71,23 @@ this.id = id; } - // Public -------------------------------------------------------- - /** - * Handle implementation. - * - * This differs from Stateless and Entity handles which just invoke standard methods - * (<tt>create</tt> and <tt>findByPrimaryKey</tt> respectively) on the Home interface (proxy). - * There is no equivalent option for stateful SBs, so a direct invocation on the container has to - * be made to locate the bean by its id (the stateful SB container provides an implementation of - * <tt>getEJBObject</tt>). - * - * This means the security context has to be set here just as it would be in the Proxy. - * - * @return <tt>EJBObject</tt> reference. - * - * @throws ServerException Could not get EJBObject. - */ + * Handle implementation. + * + * This differs from Stateless and Entity handles which just invoke standard methods + * (<tt>create</tt> and <tt>findByPrimaryKey</tt> respectively) on the Home interface (proxy). + * There is no equivalent option for stateful SBs, so a direct invocation on the container has to + * be made to locate the bean by its id (the stateful SB container provides an implementation of + * <tt>getEJBObject</tt>). + * + * This means the security context has to be set here just as it would be in the Proxy. + * + * @return <tt>EJBObject</tt> reference. + * + * @throws ServerException Could not get EJBObject. + */ public EJBObject getEJBObject() throws RemoteException { try { - // Get the invoker to the target server (cluster or node) Invoker invoker = (Invoker) new InitialContext().lookup("invokers/"+server+"/jrmp"); @@ -116,26 +103,19 @@ SecurityAssociation.getPrincipal(), SecurityAssociation.getCredential()); - invocation.setContainer("J2EE:service=EJB,jndiName="+jndiName); - //It is a home invocation + invocation.setContainer("jboss.j2ee:service=EJB,jndiName="+jndiName); + + // It is a home invocation invocation.setType("home"); - // Get the invoker to the target server (cluster or node) + + // Get the invoker to the target server (cluster or node) - //Ship it + // Ship it return (EJBObject) invoker.invoke(invocation); - } catch (Exception e) { throw new ServerException("Could not get EJBObject", e); } } - - // Package protected --------------------------------------------- - - // Protected ----------------------------------------------------- - - // Private ------------------------------------------------------- - - // Inner classes ------------------------------------------------- }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development