geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r505168 - /geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
Date Fri, 09 Feb 2007 04:15:16 GMT
Author: dain
Date: Thu Feb  8 20:15:15 2007
New Revision: 505168

URL: http://svn.apache.org/viewvc?view=rev&rev=505168
Log:
Exposed more of the deployment info

Modified:
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java?view=diff&rev=505168&r1=505167&r2=505168
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
Thu Feb  8 20:15:15 2007
@@ -18,15 +18,22 @@
 package org.apache.geronimo.openejb;
 
 import java.util.Set;
+import java.lang.reflect.Method;
 import javax.ejb.EJBHome;
 import javax.ejb.EJBLocalHome;
+import javax.ejb.EJBObject;
 import javax.naming.Context;
 import javax.security.auth.Subject;
 
 import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
 import org.apache.geronimo.management.EJB;
+import org.apache.openejb.BeanType;
+import org.apache.openejb.Container;
+import org.apache.openejb.ProxyInfo;
+import org.apache.openejb.RpcContainer;
 import org.apache.openejb.core.CoreDeploymentInfo;
-import org.apache.openejb.DeploymentInfo;
+import org.apache.openejb.core.entity.EntityEjbHomeHandler;
+import org.apache.openejb.util.proxy.ProxyManager;
 
 public class EjbDeployment implements EJB {
     private final String objectName;
@@ -53,7 +60,6 @@
 
     private final OpenEjbSystem openEjbSystem;
 
-
     private CoreDeploymentInfo deploymentInfo;
 
     public EjbDeployment(String objectName,
@@ -92,6 +98,10 @@
         this.openEjbSystem = openEjbSystem;
     }
 
+    public CoreDeploymentInfo getDeploymentInfo() {
+        return deploymentInfo;
+    }
+
     public String getDeploymentId() {
         return deploymentId;
     }
@@ -160,12 +170,79 @@
         return deploymentInfo.getEJBLocalHome();
     }
 
-    public DeploymentInfo.BusinessLocalHome getBusinessLocalHome() {
+    public Object getBusinessLocalHome() {
         return deploymentInfo.getBusinessLocalHome();
     }
 
-    public DeploymentInfo.BusinessRemoteHome getBusinessRemoteHome() {
+    public Object getBusinessRemoteHome() {
         return deploymentInfo.getBusinessRemoteHome();
+    }
+
+    public EJBObject getEjbObject(Object primaryKey) {
+        // get the local interface
+        Class localInterface = deploymentInfo.getLocalInterface();
+
+        // get the container
+        RpcContainer container = (RpcContainer) deploymentInfo.getContainer();
+
+        // create a new ProxyInfo based on the deployment info and primary key
+        ProxyInfo proxyInfo = new ProxyInfo(deploymentInfo, primaryKey, localInterface, container);
+
+        // get the home proxy handler
+        EJBHome homeProxy = deploymentInfo.getEJBHome();
+        EntityEjbHomeHandler handler = (EntityEjbHomeHandler) ProxyManager.getInvocationHandler(homeProxy);
+
+        // create the proxy
+        EJBObject ejbObject = (EJBObject) handler.createProxy(proxyInfo);
+        return ejbObject;
+    }
+
+    public Class getHomeInterface() {
+        return deploymentInfo.getHomeInterface();
+    }
+
+    public Class getRemoteInterface() {
+        return deploymentInfo.getRemoteInterface();
+    }
+
+    public Class getLocalHomeInterface() {
+        return deploymentInfo.getLocalHomeInterface();
+    }
+
+    public Class getLocalInterface() {
+        return deploymentInfo.getLocalInterface();
+    }
+
+    public Class getBeanClass() {
+        return deploymentInfo.getBeanClass();
+    }
+
+    public Class getBusinessLocalInterface() {
+        return deploymentInfo.getBusinessLocalInterface();
+    }
+
+    public Class getBusinessRemoteInterface() {
+        return deploymentInfo.getBusinessRemoteInterface();
+    }
+
+    public Class getMdbInterface() {
+        return deploymentInfo.getMdbInterface();
+    }
+
+    public BeanType getComponentType() {
+        return deploymentInfo.getComponentType();
+    }
+
+    public Container getContainer() {
+        return deploymentInfo.getContainer();
+    }
+
+    public boolean isBeanManagedTransaction() {
+        return deploymentInfo.isBeanManagedTransaction();
+    }
+
+    public byte getTransactionAttribute(Method method) {
+        return deploymentInfo.getTransactionAttribute(method);
     }
 
     public String getObjectName() {



Mime
View raw message