[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/local LocalHomeProxy.java

2002-01-02 Thread Jason Dillon

  User: user57  
  Date: 02/01/02 20:00:58

  Modified:src/main/org/jboss/ejb/plugins/local LocalHomeProxy.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  ChangesPath
  1.5   +0 -5  jboss/src/main/org/jboss/ejb/plugins/local/LocalHomeProxy.java
  
  Index: LocalHomeProxy.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/local/LocalHomeProxy.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalHomeProxy.java   2001/11/24 20:43:28 1.4
  +++ LocalHomeProxy.java   2002/01/03 04:00:58 1.5
  @@ -6,7 +6,6 @@
*/
   package org.jboss.ejb.plugins.local;
   
  -
   import java.lang.reflect.Method;
   
   import javax.naming.Name;
  @@ -16,7 +15,6 @@
   import javax.ejb.Handle;
   import javax.ejb.HomeHandle;
   
  -
   /**
* The client-side proxy for an EJB Home object.
*  
  @@ -25,9 +23,6 @@
   public abstract class LocalHomeProxy
   extends LocalProxy
   {
  -
  -// Static 
  -
   /** {@link EJBHome#remove(Object)} method reference. */
   protected static final Method REMOVE_BY_PRIMARY_KEY;
   
  
  
  

___
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development



[JBoss-dev] CVS update: jboss/src/main/org/jboss/ejb/plugins/local LocalHomeProxy.java BaseLocalContainerInvoker.java LocalProxy.java

2001-06-03 Thread docodan

  User: docodan 
  Date: 01/06/03 10:11:03

  Modified:src/main/org/jboss/ejb/plugins/local
BaseLocalContainerInvoker.java LocalProxy.java
  Added:   src/main/org/jboss/ejb/plugins/local LocalHomeProxy.java
  Log:
  Added home local proxy (already had component local proxy).
  
  Revision  ChangesPath
  1.2   +82 -7 
jboss/src/main/org/jboss/ejb/plugins/local/BaseLocalContainerInvoker.java
  
  Index: BaseLocalContainerInvoker.java
  ===
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/local/BaseLocalContainerInvoker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BaseLocalContainerInvoker.java2001/06/03 16:28:48 1.1
  +++ BaseLocalContainerInvoker.java2001/06/03 17:11:02 1.2
  @@ -136,7 +136,10 @@
  // ContainerInvoker implementation ---
  public EJBLocalHome getEJBLocalHome()
  {
  -  throw new UnsupportedOperationException();
  +  ContainerInvokerContainer cic = (ContainerInvokerContainer) container;
  +  return (EJBLocalHome) Proxy.newProxyInstance( 
  + cic.getLocalHomeClass().getClassLoader(),
  + new Class[]{cic.getLocalHomeClass()}, new HomeProxy() );
  }
   
  public EJBLocalObject getStatelessSessionEJBLocalObject()
  @@ -177,8 +180,7 @@
  /**
   *  Invoke a Home interface method.
   */
  -   public Object invokeHome(Method m, Object[] args, Transaction tx,
  -  Principal identity, Object credential)
  +   public Object invokeHome(Method m, Object[] args)
  throws Exception
  {
 // Set the right context classloader
  @@ -187,8 +189,8 @@
   
 try
 {
  - return container.invokeHome(new MethodInvocation(null, m, args, tx,
  -identity, credential));
  + return container.invokeHome(new MethodInvocation(null, m, args, 
  +getTransaction(), getPrincipal(), getCredential()));
 } finally
 {
Thread.currentThread().setContextClassLoader(oldCl);
  @@ -242,6 +244,47 @@
Thread.currentThread().setContextClassLoader(oldCl);
 }
  }
  +   
  +
  +   class HomeProxy extends LocalHomeProxy
  +  implements InvocationHandler
  +   {
  +   protected String getJndiName()
  +   {
  +   return jndiName;
  +   }
  +   
  +   protected Object getId()
  +   {
  +   return jndiName;
  +   }
  +
  +   public final Object invoke(final Object proxy,
  +   final Method m,
  +   Object[] args)
  +throws Throwable
  +   {
  +  if (args == null)
  +  args = EMPTY_ARGS;
  +  
  +  Object retValue = super.invoke( proxy, m, args );
  +  if (retValue != null)
  + return retValue;
  +  
  +else if (m.equals(REMOVE_BY_PRIMARY_KEY)) {
  +// The trick is simple we trick the container in believe it
  +// is a remove() on the instance
  +Object id = new CacheKey(args[0]);
  +return BaseLocalContainerInvoker.this.invoke(
  +   id, REMOVE_OBJECT, EMPTY_ARGS);
  +}
  +  // If not taken care of, go on and call the container
  +  else {
  +  return BaseLocalContainerInvoker.this.invokeHome(
  +   m, args);
  +  }
  +   }
  +   }
   
  class EntityProxy extends LocalProxy 
 implements InvocationHandler
  @@ -255,6 +298,17 @@
cacheKey = (CacheKey) id;
 }
 
  +   protected String getJndiName()
  +   {
  +   return jndiName;
  +   }
  +   
  +   protected Object getId()
  +   {
  +   return cacheKey.id;
  +   }
  +  
  +  
 public final Object invoke(final Object proxy,
  final Method m,
  Object[] args)
  @@ -263,7 +317,7 @@
 if (args == null)
 args = EMPTY_ARGS;
 
  -  Object retValue = super.invoke( proxy, m, args, jndiName, cacheKey.id );
  +  Object retValue = super.invoke( proxy, m, args );
 if (retValue != null)
return retValue;
 // If not taken care of, go on and call the container
  @@ -284,6 +338,16 @@
 {
this.id = id;
 }
  +
  +   protected String getJndiName()
  +   {
  +   return jndiName;
  +   }
  +   
  +   protected Object getId()
  +   {
  +   return id;
  +   }  
 
 public final Object invoke(final Object proxy,
  final Method m,
  @@ -293,7 +357,7 @@
 if (args == null)
 args = EMPTY_ARGS;
 
  -  Object retValue =