maguro 2005/01/13 12:00:24
Modified: modules/core/src/java/org/openejb/proxy BaseEJB.java
EJBObjectImpl.java ProxyInfo.java
Log:
Add support for CORBA
Intermediate checkin.
Revision Changes Path
1.4 +120 -69
openejb/modules/core/src/java/org/openejb/proxy/BaseEJB.java
Index: BaseEJB.java
===================================================================
RCS file:
/scm/openejb/openejb/modules/core/src/java/org/openejb/proxy/BaseEJB.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- BaseEJB.java 21 Mar 2004 21:26:35 -0000 1.3
+++ BaseEJB.java 13 Jan 2005 17:00:23 -0000 1.4
@@ -1,69 +1,120 @@
-/**
- * Redistribution and use of this software and associated documentation
- * ("Software"), with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright
- * statements and notices. Redistributions must also contain a
- * copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the
- * above copyright notice, this list of conditions and the
- * following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. The name "OpenEJB" must not be used to endorse or promote
- * products derived from this Software without prior written
- * permission of The OpenEJB Group. For written permission,
- * please contact [EMAIL PROTECTED]
- *
- * 4. Products derived from this Software may not be called "OpenEJB"
- * nor may "OpenEJB" appear in their names without prior written
- * permission of The OpenEJB Group. OpenEJB is a registered
- * trademark of The OpenEJB Group.
- *
- * 5. Due credit should be given to the OpenEJB Project
- * (http://openejb.org/).
- *
- * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
- * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Copyright 2001 (C) The OpenEJB Group. All Rights Reserved.
- *
- * $Id$
- */
-package org.openejb.proxy;
-
-import java.io.ObjectStreamException;
-import java.io.Serializable;
-
-public class BaseEJB implements Serializable {
-
- EJBMethodInterceptor ejbHandler;
-
- public BaseEJB(EJBMethodInterceptor handler) {
- ejbHandler = handler;
- }
-
- public ProxyInfo getProxyInfo(){
- return ejbHandler.getProxyInfo();
- }
-
- public EJBProxyFactory getProxyFactory() {
- return ejbHandler.getProxyFactory();
- }
-
- protected Object writeReplace() throws ObjectStreamException{
- return SerializationHanlder.writeReplace(this, getProxyInfo());
- }
-}
+/**
+
+ * Redistribution and use of this software and associated documentation
+
+ * ("Software"), with or without modification, are permitted provided
+
+ * that the following conditions are met:
+
+ *
+
+ * 1. Redistributions of source code must retain copyright
+
+ * statements and notices. Redistributions must also contain a
+
+ * copy of this document.
+
+ *
+
+ * 2. Redistributions in binary form must reproduce the
+
+ * above copyright notice, this list of conditions and the
+
+ * following disclaimer in the documentation and/or other
+
+ * materials provided with the distribution.
+
+ *
+
+ * 3. The name "OpenEJB" must not be used to endorse or promote
+
+ * products derived from this Software without prior written
+
+ * permission of The OpenEJB Group. For written permission,
+
+ * please contact [EMAIL PROTECTED]
+
+ *
+
+ * 4. Products derived from this Software may not be called "OpenEJB"
+
+ * nor may "OpenEJB" appear in their names without prior written
+
+ * permission of The OpenEJB Group. OpenEJB is a registered
+
+ * trademark of The OpenEJB Group.
+
+ *
+
+ * 5. Due credit should be given to the OpenEJB Project
+
+ * (http://openejb.org/).
+
+ *
+
+ * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
+
+ * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+
+ * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ *
+
+ * Copyright 2001 (C) The OpenEJB Group. All Rights Reserved.
+
+ *
+
+ * $Id$
+
+ */
+package org.openejb.proxy;
+
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class BaseEJB implements Serializable {
+
+ EJBMethodInterceptor ejbHandler;
+
+
+ public BaseEJB(EJBMethodInterceptor handler) {
+ ejbHandler = handler;
+ }
+
+ public ProxyInfo getProxyInfo() {
+ return ejbHandler.getProxyInfo();
+ }
+
+ public EJBProxyFactory getProxyFactory() {
+ return ejbHandler.getProxyFactory();
+ }
+
+
+ protected Object writeReplace() throws ObjectStreamException {
+ return SerializationHanlder.writeReplace(this, getProxyInfo());
+ }
+
+}
+
1.4 +119 -72
openejb/modules/core/src/java/org/openejb/proxy/EJBObjectImpl.java
Index: EJBObjectImpl.java
===================================================================
RCS file:
/scm/openejb/openejb/modules/core/src/java/org/openejb/proxy/EJBObjectImpl.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EJBObjectImpl.java 21 Mar 2004 21:26:35 -0000 1.3
+++ EJBObjectImpl.java 13 Jan 2005 17:00:23 -0000 1.4
@@ -1,72 +1,119 @@
-/**
- * Redistribution and use of this software and associated documentation
- * ("Software"), with or without modification, are permitted provided
- * that the following conditions are met:
- *
- * 1. Redistributions of source code must retain copyright
- * statements and notices. Redistributions must also contain a
- * copy of this document.
- *
- * 2. Redistributions in binary form must reproduce the
- * above copyright notice, this list of conditions and the
- * following disclaimer in the documentation and/or other
- * materials provided with the distribution.
- *
- * 3. The name "OpenEJB" must not be used to endorse or promote
- * products derived from this Software without prior written
- * permission of The OpenEJB Group. For written permission,
- * please contact [EMAIL PROTECTED]
- *
- * 4. Products derived from this Software may not be called "OpenEJB"
- * nor may "OpenEJB" appear in their names without prior written
- * permission of The OpenEJB Group. OpenEJB is a registered
- * trademark of The OpenEJB Group.
- *
- * 5. Due credit should be given to the OpenEJB Project
- * (http://openejb.org/).
- *
- * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
- * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
- * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Copyright 2001 (C) The OpenEJB Group. All Rights Reserved.
- *
- * $Id$
- */
-package org.openejb.proxy;
-
-import java.io.ObjectStreamException;
-import java.rmi.RemoteException;
-
-import javax.ejb.EJBHome;
-import javax.ejb.EJBObject;
-import javax.ejb.Handle;
-
-
-public abstract class EJBObjectImpl extends BaseEJB implements EJBObject {
-
- public EJBObjectImpl(EJBMethodInterceptor handler) {
- super(handler);
- }
-
- public EJBHome getEJBHome() throws RemoteException {
- return getProxyFactory().getEJBHome();
- }
-
- public Handle getHandle() throws RemoteException {
- return new HandleImpl(this, HandleImpl.HANDLE);
- }
-
- public Object writeReplace() throws ObjectStreamException{
- return SerializationHanlder.writeReplace(this, getProxyInfo());
- }
-}
+/**
+
+ * Redistribution and use of this software and associated documentation
+
+ * ("Software"), with or without modification, are permitted provided
+
+ * that the following conditions are met:
+
+ *
+
+ * 1. Redistributions of source code must retain copyright
+
+ * statements and notices. Redistributions must also contain a
+
+ * copy of this document.
+
+ *
+
+ * 2. Redistributions in binary form must reproduce the
+
+ * above copyright notice, this list of conditions and the
+
+ * following disclaimer in the documentation and/or other
+
+ * materials provided with the distribution.
+
+ *
+
+ * 3. The name "OpenEJB" must not be used to endorse or promote
+
+ * products derived from this Software without prior written
+
+ * permission of The OpenEJB Group. For written permission,
+
+ * please contact [EMAIL PROTECTED]
+
+ *
+
+ * 4. Products derived from this Software may not be called "OpenEJB"
+
+ * nor may "OpenEJB" appear in their names without prior written
+
+ * permission of The OpenEJB Group. OpenEJB is a registered
+
+ * trademark of The OpenEJB Group.
+
+ *
+
+ * 5. Due credit should be given to the OpenEJB Project
+
+ * (http://openejb.org/).
+
+ *
+
+ * THIS SOFTWARE IS PROVIDED BY THE OPENEJB GROUP AND CONTRIBUTORS
+
+ * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+
+ * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+
+ * THE OPENEJB GROUP OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ *
+
+ * Copyright 2001 (C) The OpenEJB Group. All Rights Reserved.
+
+ *
+
+ * $Id$
+
+ */
+package org.openejb.proxy;
+
+import java.io.ObjectStreamException;
+import java.rmi.RemoteException;
+import javax.ejb.EJBHome;
+import javax.ejb.EJBObject;
+import javax.ejb.Handle;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public abstract class EJBObjectImpl extends BaseEJB implements EJBObject {
+
+ public EJBObjectImpl(EJBMethodInterceptor handler) {
+ super(handler);
+ }
+
+ public EJBHome getEJBHome() throws RemoteException {
+ return getProxyFactory().getEJBHome();
+ }
+
+ public Handle getHandle() throws RemoteException {
+ return new HandleImpl(this, HandleImpl.HANDLE);
+ }
+
+ public Object writeReplace() throws ObjectStreamException {
+ return SerializationHanlder.writeReplace(this, getProxyInfo());
+ }
+
+}
+
1.7 +21 -1
openejb/modules/core/src/java/org/openejb/proxy/ProxyInfo.java
Index: ProxyInfo.java
===================================================================
RCS file:
/scm/openejb/openejb/modules/core/src/java/org/openejb/proxy/ProxyInfo.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ProxyInfo.java 16 Dec 2004 19:28:35 -0000 1.6
+++ ProxyInfo.java 13 Jan 2005 17:00:23 -0000 1.7
@@ -104,6 +104,26 @@
return componentType == EJBComponentType.STATELESS || componentType
== EJBComponentType.STATEFUL;
}
+ public boolean isStatefulSessionBean() {
+ return componentType == EJBComponentType.STATEFUL;
+ }
+
+ public boolean isStatelessSessionBean() {
+ return componentType == EJBComponentType.STATELESS;
+ }
+
+ public boolean isBMPEntityBean() {
+ return componentType == EJBComponentType.BMP_ENTITY;
+ }
+
+ public boolean isCMPEntityBean() {
+ return componentType == EJBComponentType.CMP_ENTITY;
+ }
+
+ public boolean isMessageBean() {
+ return componentType == EJBComponentType.MESSAGE_DRIVEN;
+ }
+
public int getComponentType() {
return componentType;
}