dblevins    2004/12/22 00:42:39

  Modified:    modules/core/src/test/org/openejb/slsb MockEJBContainer.java
  Log:

  Basic soap rpc/encoded deployment and container support along with a general 
revamping of the networkservice stacks.
  
  Revision  Changes    Path
  1.2       +39 -2     
openejb/modules/core/src/test/org/openejb/slsb/MockEJBContainer.java
  
  Index: MockEJBContainer.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb/modules/core/src/test/org/openejb/slsb/MockEJBContainer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MockEJBContainer.java     20 Dec 2004 06:43:36 -0000      1.1
  +++ MockEJBContainer.java     22 Dec 2004 05:42:39 -0000      1.2
  @@ -49,10 +49,18 @@
   import javax.ejb.EJBLocalHome;
   import javax.ejb.EJBLocalObject;
   import javax.ejb.EJBObject;
  +import javax.management.ObjectName;
   import javax.security.auth.Subject;
   
   import org.apache.geronimo.core.service.Invocation;
   import org.apache.geronimo.core.service.InvocationResult;
  +import org.apache.geronimo.gbean.GBeanData;
  +import org.apache.geronimo.gbean.GBeanInfo;
  +import org.apache.geronimo.gbean.GBeanInfoBuilder;
  +import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
  +import org.apache.geronimo.kernel.GBeanNotFoundException;
  +import org.apache.geronimo.kernel.Kernel;
  +import org.apache.geronimo.kernel.jmx.JMXUtil;
   import org.openejb.EJBComponentType;
   import org.openejb.EJBContainer;
   import org.openejb.dispatch.InterfaceMethodSignature;
  @@ -65,7 +73,7 @@
       private final Class ejbClass;
   
       public MockEJBContainer() {
  -        this.proxyInfo = new 
ProxyInfo(EJBComponentType.STATELESS,"foo",MockHome.class,MockRemote.class,MockLocalHome.class,MockLocal.class,MockServiceEndpoint.class,
 null);
  +        this.proxyInfo = new ProxyInfo(EJBComponentType.STATELESS, "foo", 
MockHome.class, MockRemote.class, MockLocalHome.class, MockLocal.class, 
MockServiceEndpoint.class, null);
           ejbClass = MockEJB.class;
       }
   
  @@ -135,4 +143,33 @@
       public InvocationResult invoke(Invocation invocation) throws Throwable {
           return null;
       }
  +
  +    public static final GBeanInfo GBEAN_INFO;
  +
  +    static {
  +        GBeanInfoBuilder infoFactory = new 
GBeanInfoBuilder(MockEJBContainer.class);
  +
  +        infoFactory.addOperation("invoke", new Class[]{Invocation.class});
  +        infoFactory.addOperation("invoke", new Class[]{Method.class, 
Object[].class, Object.class});
  +        infoFactory.addAttribute("EJBName", String.class, true);
  +        infoFactory.addAttribute("ProxyInfo", ProxyInfo.class, true);
  +
  +        GBEAN_INFO = infoFactory.getBeanInfo();
  +    }
  +
  +    public static GBeanInfo getGBeanInfo() {
  +        return GBEAN_INFO;
  +    }
  +
  +    public static ObjectName addGBean(Kernel kernel, String name) throws 
GBeanAlreadyExistsException, GBeanNotFoundException {
  +        ObjectName gbeanName = 
JMXUtil.getObjectName("openejb:j2eeType=StatelessSessionBean,name=" + name);
  +
  +        GBeanData gbean1 = new GBeanData(gbeanName, 
MockEJBContainer.GBEAN_INFO);
  +
  +        GBeanData gbean = gbean1;
  +        kernel.loadGBean(gbean, MockEJBContainer.class.getClassLoader());
  +        kernel.startGBean(gbean.getName());
  +        return gbean.getName();
  +    }
  +
   }
  
  
  

Reply via email to