dain 2005/06/24 03:54:14
Modified: modules/core/src/java/org/openejb/corba Adapter.java
AdapterEntity.java AdapterStateful.java
AdapterStateless.java CSSBean.java
ClientContextHolder.java StandardServant.java
Log:
Switched over to StandardServent instead of generating ties
Fixed client context propigation to objects nested in a graph
Removed stub delegate
Revision Changes Path
1.11 +4 -17
openejb/modules/core/src/java/org/openejb/corba/Adapter.java
Index: Adapter.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/Adapter.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Adapter.java 8 May 2005 19:37:04 -0000 1.10
+++ Adapter.java 24 Jun 2005 07:54:14 -0000 1.11
@@ -44,9 +44,6 @@
*/
package org.openejb.corba;
-import java.rmi.Remote;
-import javax.rmi.CORBA.Tie;
-
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Policy;
@@ -61,10 +58,9 @@
import org.omg.PortableServer.ImplicitActivationPolicyValue;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.RequestProcessingPolicyValue;
-import org.omg.PortableServer.Servant;
import org.omg.PortableServer.ServantRetentionPolicyValue;
-
import org.openejb.EJBContainer;
+import org.openejb.EJBInterfaceType;
import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
import org.openejb.corba.util.TieLoader;
import org.openejb.proxy.ProxyInfo;
@@ -74,9 +70,7 @@
* @version $Revision$ $Date$
*/
public abstract class Adapter implements RefGenerator {
-
private final EJBContainer container;
- private final POA parentPOA;
protected final POA homePOA;
private final NamingContextExt initialContext;
private final TieLoader tieLoader;
@@ -85,7 +79,6 @@
protected Adapter(EJBContainer container, ORB orb, POA parentPOA,
TieLoader tieLoader, Policy securityPolicy) throws CORBAException {
this.container = container;
- this.parentPOA = parentPOA;
this.tieLoader = tieLoader;
this.home_id = container.getContainerID().toString().getBytes();
@@ -106,13 +99,7 @@
homePOA.the_POAManager().activate();
- Servant servant =
tieLoader.loadTieClass(container.getProxyInfo().getHomeInterface(),
container.getClassLoader());
- AdapterProxyFactory factory = new
AdapterProxyFactory(container.getProxyInfo().getHomeInterface(),
container.getClassLoader());
- Remote remote = (Remote) factory.create(container.getEjbHome(),
container.getClassLoader());
-
- if (servant instanceof Tie) {
- ((Tie) servant).setTarget(remote);
- }
+ StandardServant servant = new
StandardServant(EJBInterfaceType.HOME, container);
homePOA.activate_object_with_id(home_id, servant);
homeReference = homePOA.servant_to_reference(servant);
1.11 +7 -19
openejb/modules/core/src/java/org/openejb/corba/AdapterEntity.java
Index: AdapterEntity.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterEntity.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AdapterEntity.java 8 May 2005 19:37:05 -0000 1.10
+++ AdapterEntity.java 24 Jun 2005 07:54:14 -0000 1.11
@@ -49,29 +49,26 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.rmi.Remote;
-import javax.rmi.CORBA.Tie;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.Any;
import org.omg.CORBA.LocalObject;
import org.omg.CORBA.OBJECT_NOT_EXIST;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Policy;
-import org.omg.CORBA.Any;
import org.omg.PortableServer.IdAssignmentPolicyValue;
import org.omg.PortableServer.ImplicitActivationPolicyValue;
-import org.omg.PortableServer.LifespanPolicyValue;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.RequestProcessingPolicyValue;
import org.omg.PortableServer.Servant;
import org.omg.PortableServer.ServantLocator;
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder;
import org.omg.PortableServer.ServantRetentionPolicyValue;
-
import org.openejb.EJBContainer;
-import org.openejb.corba.util.TieLoader;
+import org.openejb.EJBInterfaceType;
import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
+import org.openejb.corba.util.TieLoader;
import org.openejb.proxy.ProxyInfo;
@@ -79,12 +76,10 @@
* @version $Revision$ $Date$
*/
public final class AdapterEntity extends Adapter {
-
private final Log log = LogFactory.getLog(AdapterEntity.class);
private final POA poa;
private final String referenceInterface;
- private final AdapterProxyFactory factory;
public AdapterEntity(EJBContainer container, ORB orb, POA parentPOA,
TieLoader tieLoader, Policy securityPolicy) throws CORBAException {
super(container, orb, parentPOA, tieLoader, securityPolicy);
@@ -107,10 +102,8 @@
poa.the_POAManager().activate();
- Servant servant =
getTieLoader().loadTieClass(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
+ StandardServant servant = new
StandardServant(EJBInterfaceType.REMOTE, container);
referenceInterface = servant._all_interfaces(null, null)[0];
-
- factory = new
AdapterProxyFactory(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
} catch (Exception e) {
throw new CORBAException(e);
}
@@ -155,12 +148,7 @@
is.close();
EJBContainer container = getContainer();
- Servant servant =
getTieLoader().loadTieClass(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
- Remote remote = (Remote)
factory.create(container.getEjbObject(pk), container.getClassLoader());
-
- if (servant instanceof Tie) {
- ((Tie) servant).setTarget(remote);
- }
+ StandardServant servant = new
StandardServant(EJBInterfaceType.REMOTE, container, pk);
return servant;
} catch (IOException e) {
// if we can't deserialize, then this object can't exist in
this process
1.11 +7 -18
openejb/modules/core/src/java/org/openejb/corba/AdapterStateful.java
Index: AdapterStateful.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterStateful.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AdapterStateful.java 8 May 2005 19:37:05 -0000 1.10
+++ AdapterStateful.java 24 Jun 2005 07:54:14 -0000 1.11
@@ -49,16 +49,14 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.rmi.Remote;
-import javax.rmi.CORBA.Tie;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.Any;
import org.omg.CORBA.LocalObject;
import org.omg.CORBA.OBJECT_NOT_EXIST;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Policy;
-import org.omg.CORBA.Any;
import org.omg.PortableServer.IdAssignmentPolicyValue;
import org.omg.PortableServer.ImplicitActivationPolicyValue;
import org.omg.PortableServer.LifespanPolicyValue;
@@ -68,10 +66,10 @@
import org.omg.PortableServer.ServantLocator;
import org.omg.PortableServer.ServantLocatorPackage.CookieHolder;
import org.omg.PortableServer.ServantRetentionPolicyValue;
-
import org.openejb.EJBContainer;
-import org.openejb.corba.util.TieLoader;
+import org.openejb.EJBInterfaceType;
import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
+import org.openejb.corba.util.TieLoader;
import org.openejb.proxy.ProxyInfo;
@@ -79,12 +77,10 @@
* @version $Revision$ $Date$
*/
public class AdapterStateful extends Adapter {
-
private final Log log = LogFactory.getLog(AdapterStateful.class);
private final POA poa;
private final String referenceInterface;
- private final AdapterProxyFactory factory;
public AdapterStateful(EJBContainer container, ORB orb, POA parentPOA,
TieLoader tieLoader, Policy securityPolicy) throws CORBAException {
super(container, orb, parentPOA, tieLoader, securityPolicy);
@@ -107,10 +103,8 @@
poa.the_POAManager().activate();
- Servant servant =
getTieLoader().loadTieClass(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
+ StandardServant servant = new
StandardServant(EJBInterfaceType.REMOTE, container);
referenceInterface = servant._all_interfaces(null, null)[0];
-
- factory = new
AdapterProxyFactory(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
} catch (Exception e) {
throw new CORBAException(e);
}
@@ -155,12 +149,7 @@
is.close();
EJBContainer container = getContainer();
- Servant servant =
getTieLoader().loadTieClass(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
- Remote remote = (Remote)
factory.create(container.getEjbObject(pk), container.getClassLoader());
-
- if (servant instanceof Tie) {
- ((Tie) servant).setTarget(remote);
- }
+ StandardServant servant = new
StandardServant(EJBInterfaceType.REMOTE, container, pk);
return servant;
} catch (IOException e) {
// if we can't deserialize, then this object can't exist in
this process
1.11 +6 -19
openejb/modules/core/src/java/org/openejb/corba/AdapterStateless.java
Index: AdapterStateless.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/AdapterStateless.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- AdapterStateless.java 8 May 2005 19:37:05 -0000 1.10
+++ AdapterStateless.java 24 Jun 2005 07:54:14 -0000 1.11
@@ -44,25 +44,20 @@
*/
package org.openejb.corba;
-import java.rmi.Remote;
-import javax.rmi.CORBA.Tie;
-
+import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Policy;
-import org.omg.CORBA.Any;
import org.omg.PortableServer.IdAssignmentPolicyValue;
import org.omg.PortableServer.ImplicitActivationPolicyValue;
-import org.omg.PortableServer.LifespanPolicyValue;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.POAPackage.ObjectNotActive;
import org.omg.PortableServer.POAPackage.WrongPolicy;
import org.omg.PortableServer.RequestProcessingPolicyValue;
-import org.omg.PortableServer.Servant;
import org.omg.PortableServer.ServantRetentionPolicyValue;
-
import org.openejb.EJBContainer;
-import org.openejb.corba.util.TieLoader;
+import org.openejb.EJBInterfaceType;
import org.openejb.corba.transaction.ServerTransactionPolicyFactory;
+import org.openejb.corba.util.TieLoader;
import org.openejb.proxy.ProxyInfo;
@@ -70,7 +65,6 @@
* @version $Revision$ $Date$
*/
public final class AdapterStateless extends Adapter {
-
private final POA poa;
private final byte[] object_id;
private final org.omg.CORBA.Object objectReference;
@@ -94,13 +88,7 @@
poa.the_POAManager().activate();
- Servant servant =
tieLoader.loadTieClass(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
- AdapterProxyFactory factory = new
AdapterProxyFactory(container.getProxyInfo().getRemoteInterface(),
container.getClassLoader());
- Remote remote = (Remote)
factory.create(container.getEjbObject(null), container.getClassLoader());
-
- if (servant instanceof Tie) {
- ((Tie) servant).setTarget(remote);
- }
+ StandardServant servant = new
StandardServant(EJBInterfaceType.REMOTE, container);
poa.activate_object_with_id(object_id =
container.getContainerID().toString().getBytes(), servant);
objectReference = poa.servant_to_reference(servant);
@@ -125,5 +113,4 @@
public org.omg.CORBA.Object genObjectReference(ProxyInfo proxyInfo) {
return objectReference;
}
-
}
1.13 +2 -5
openejb/modules/core/src/java/org/openejb/corba/CSSBean.java
Index: CSSBean.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/CSSBean.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- CSSBean.java 23 Jun 2005 06:59:19 -0000 1.12
+++ CSSBean.java 24 Jun 2005 07:54:14 -0000 1.13
@@ -187,9 +187,6 @@
} finally {
ClientContextManager.setClientContext(oldClientContext);
}
- if (bean instanceof ClientContextHolder) {
- ((ClientContextHolder)bean).setClientContext(context);
- }
return bean;
} catch (UserException ue) {
1.2 +2 -5
openejb/modules/core/src/java/org/openejb/corba/ClientContextHolder.java
Index: ClientContextHolder.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/ClientContextHolder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClientContextHolder.java 27 Mar 2005 02:04:40 -0000 1.1
+++ ClientContextHolder.java 24 Jun 2005 07:54:14 -0000 1.2
@@ -49,8 +49,5 @@
* @version $Revision$ $Date$
*/
public interface ClientContextHolder {
-
public ClientContext getClientContext();
-
- public void setClientContext(ClientContext context);
}
1.4 +73 -104
openejb/modules/core/src/java/org/openejb/corba/StandardServant.java
Index: StandardServant.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/StandardServant.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- StandardServant.java 23 Jun 2005 00:56:43 -0000 1.3
+++ StandardServant.java 24 Jun 2005 07:54:14 -0000 1.4
@@ -44,7 +44,6 @@
*/
package org.openejb.corba;
-import java.io.Serializable;
import java.lang.reflect.Method;
import java.rmi.AccessException;
import java.rmi.MarshalException;
@@ -53,18 +52,18 @@
import java.rmi.RemoteException;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Map;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import javax.rmi.CORBA.Util;
-import javax.rmi.PortableRemoteObject;
+import java.util.Map;
+import javax.ejb.Handle;
import javax.transaction.InvalidTransactionException;
import javax.transaction.TransactionRequiredException;
import javax.transaction.TransactionRolledbackException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.core.service.InvocationResult;
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.INVALID_TRANSACTION;
import org.omg.CORBA.MARSHAL;
@@ -75,32 +74,51 @@
import org.omg.CORBA.TRANSACTION_ROLLEDBACK;
import org.omg.CORBA.UNKNOWN;
import org.omg.CORBA.portable.InputStream;
+import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
import org.omg.CORBA.portable.ResponseHandler;
import org.omg.CORBA.portable.UnknownException;
import org.omg.PortableServer.Servant;
import org.openejb.EJBContainer;
+import org.openejb.EJBInterfaceType;
+import org.openejb.EJBInvocation;
+import org.openejb.EJBInvocationImpl;
+import org.openejb.client.EJBObjectHandler;
+import org.openejb.client.EJBObjectProxy;
import org.openejb.corba.compiler.IiopOperation;
import org.openejb.corba.compiler.PortableStubCompiler;
/**
* @version $Revision$ $Date$
*/
-public class StandardServant extends Servant implements
org.omg.CORBA.portable.InvokeHandler {
+public class StandardServant extends Servant implements InvokeHandler {
private static final Log log = LogFactory.getLog(StandardServant.class);
+ private final EJBInterfaceType ejbInterfaceType;
private final EJBContainer ejbContainer;
private final Object primaryKey;
private final String[] typeIds;
private final Map operations;
- public StandardServant(Class type, EJBContainer ejbContainer) {
- this(type, ejbContainer, null);
+ public StandardServant(EJBInterfaceType ejbInterfaceType, EJBContainer
ejbContainer) {
+ this(ejbInterfaceType, ejbContainer, null);
}
- public StandardServant(Class type, EJBContainer ejbContainer, Object
primaryKey) {
+ public StandardServant(EJBInterfaceType ejbInterfaceType, EJBContainer
ejbContainer, Object primaryKey) {
+ this.ejbInterfaceType = ejbInterfaceType;
this.ejbContainer = ejbContainer;
this.primaryKey = primaryKey;
+ // get the interface class
+ Class type;
+ if (EJBInterfaceType.HOME == ejbInterfaceType) {
+ type = ejbContainer.getProxyInfo().getHomeInterface();
+ } else if (EJBInterfaceType.REMOTE == ejbInterfaceType) {
+ type = ejbContainer.getProxyInfo().getRemoteInterface();
+ } else {
+ throw new IllegalArgumentException("Only home and remote
interfaces are supported in this servant: " + ejbInterfaceType);
+ }
+
+ // build the operations index
IiopOperation[] iiopOperations =
PortableStubCompiler.createIiopOperations(type);
Map operations = new HashMap(iiopOperations.length);
for (int i = 0; i < iiopOperations.length; i++) {
@@ -109,6 +127,7 @@
}
this.operations = Collections.unmodifiableMap(operations);
+ // creat the corba ids array
List ids = new LinkedList();
for (Iterator iterator =
PortableStubCompiler.getAllInterfaces(type).iterator(); iterator.hasNext();) {
Class superInterface = (Class) iterator.next();
@@ -119,6 +138,18 @@
typeIds = (String[]) ids.toArray(new String[ids.size()]);
}
+ public EJBInterfaceType getEjbInterfaceType() {
+ return ejbInterfaceType;
+ }
+
+ public EJBContainer getEjbContainer() {
+ return ejbContainer;
+ }
+
+ public Object getPrimaryKey() {
+ return primaryKey;
+ }
+
public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte[]
objectId) {
return typeIds;
}
@@ -127,14 +158,20 @@
try {
// get the method object
Method method = (Method) operations.get(operationName);
- if (method == null) {
- throw new BAD_OPERATION();
+ int index = ejbContainer.getMethodIndex(method);
+ if (index < 0) {
+ throw new BAD_OPERATION(operationName);
}
org.omg.CORBA_2_3.portable.InputStream in =
(org.omg.CORBA_2_3.portable.InputStream) _in;
// read in all of the arguments
- Object[] args = readArguments(method, in);
+ Class[] parameterTypes = method.getParameterTypes();
+ Object[] arguments = new Object[parameterTypes.length];
+ for (int i = 0; i < parameterTypes.length; i++) {
+ Class parameterType = parameterTypes[i];
+ arguments[i] =
org.openejb.corba.util.Util.readObject(parameterType, in);
+ }
// invoke the method
Object result = null;
@@ -144,7 +181,29 @@
if (log.isDebugEnabled()) log.debug("Calling " +
method.getName());
- result = ejbContainer.invoke(method, args, primaryKey);
+ // extract the primary key from home ejb remove invocations
+ Object primaryKey = this.primaryKey;
+ if (ejbInterfaceType == EJBInterfaceType.HOME &&
method.getName().equals("remove")) {
+ primaryKey = arguments[0];
+ if (primaryKey instanceof Handle) {
+ Handle handle = (Handle) primaryKey;
+ EJBObjectProxy ejbObject = (EJBObjectProxy)
handle.getEJBObject();
+ EJBObjectHandler handler =
ejbObject.getEJBObjectHandler();
+ primaryKey = handler.getRegistryId();
+ }
+ }
+
+ // create the invocation object
+ EJBInvocation invocation = new
EJBInvocationImpl(ejbInterfaceType, primaryKey, index, arguments);
+
+ // invoke the container
+ InvocationResult invocationResult =
ejbContainer.invoke(invocation);
+
+ // process the result
+ if (invocationResult.isException()) {
+ throw invocationResult.getException();
+ }
+ result = invocationResult.getResult();
} catch (TransactionRolledbackException e) {
log.debug("TransactionRolledbackException", e);
throw new TRANSACTION_ROLLEDBACK(e.toString());
@@ -170,17 +229,16 @@
// all other exceptions are written to stream
// if this is an unknown exception type it will
// be thrown out of writeException
- return writeException(method, reply, e);
+ return org.openejb.corba.util.Util.writeException(method,
reply, e);
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);
}
-
// creat the output stream
org.omg.CORBA_2_3.portable.OutputStream out =
(org.omg.CORBA_2_3.portable.OutputStream) reply.createReply();
// write the output value
- writeResult(method.getReturnType(), result, out);
+ org.openejb.corba.util.Util.writeObject(method.getReturnType(),
result, out);
return out;
} catch (SystemException ex) {
@@ -188,94 +246,5 @@
} catch (Throwable ex) {
throw new UnknownException(ex);
}
- }
-
- private Object[] readArguments(Method method,
org.omg.CORBA_2_3.portable.InputStream in) {
- Class[] parameterTypes = method.getParameterTypes();
- Object[] arguments = new Object[parameterTypes.length];
- for (int i = 0; i < parameterTypes.length; i++) {
- Class parameterType = parameterTypes[i];
- arguments[i] = readArgument(parameterType, in);
- }
- return arguments;
- }
-
- private Object readArgument(Class type,
org.omg.CORBA_2_3.portable.InputStream in) {
- if (type == boolean.class) {
- return new Boolean(in.read_boolean());
- } else if (type == byte.class) {
- return new Byte(in.read_octet());
- } else if (type == char.class) {
- return new Character(in.read_wchar());
- } else if (type == double.class) {
- return new Double(in.read_double());
- } else if (type == float.class) {
- return new Float(in.read_float());
- } else if (type == int.class) {
- return new Integer(in.read_long());
- } else if (type == long.class) {
- return new Long(in.read_longlong());
- } else if (type == short.class) {
- return new Short(in.read_short());
- } else if (type == Object.class || type == Serializable.class) {
- return Util.readAny(in);
- } else if (Remote.class.isAssignableFrom(type)) {
- return PortableRemoteObject.narrow(in.read_Object(), type);
- } else {
- return in.read_value(type);
- }
- }
-
- private void writeResult(Class type, Object result,
org.omg.CORBA_2_3.portable.OutputStream out) {
- if (type == void.class) {
- // do nothing for a void
- } else if (type == boolean.class) {
- out.write_boolean(((Boolean)result).booleanValue());
- } else if (type == byte.class) {
- out.write_octet(((Byte)result).byteValue());
- } else if (type == char.class) {
- out.write_wchar(((Character)result).charValue());
- } else if (type == double.class) {
- out.write_double(((Double)result).doubleValue());
- } else if (type == float.class) {
- out.write_float(((Float)result).floatValue());
- } else if (type == int.class) {
- out.write_long(((Integer)result).intValue());
- } else if (type == long.class) {
- out.write_longlong(((Long)result).longValue());
- } else if (type == short.class) {
- out.write_short(((Short)result).shortValue());
- } else if (type == Object.class || type == Serializable.class) {
- Util.writeAny(out, result);
- } else if (Remote.class.isAssignableFrom(type)) {
- Util.writeRemoteObject(out, result);
- } else {
- out.write_value((Serializable)result, type);
- }
- }
-
- private OutputStream writeException(Method method, ResponseHandler
reply, Exception exception) throws Throwable {
- Class[] exceptionTypes = method.getExceptionTypes();
- for (int i = 0; i < exceptionTypes.length; i++) {
- Class exceptionType = exceptionTypes[i];
- if (RemoteException.class.isAssignableFrom(exceptionType) ||
- RuntimeException.class.isAssignableFrom(exceptionType) )
{
- continue;
- }
-
- // Determine the exception id
- String exceptionName = exceptionType.getName().replace('.', '/');
- if (exceptionName.endsWith("Exception")) {
- exceptionName = exceptionName.substring(0,
exceptionName.length() - "Exception".length());
- }
- exceptionName += "Ex";
- String id = "IDL:" + exceptionName + ":1.0";
-
- org.omg.CORBA_2_3.portable.OutputStream out =
(org.omg.CORBA_2_3.portable.OutputStream) reply.createExceptionReply();
- out.write_string(id);
- out.write_value(exception, exceptionType);
- return out;
- }
- throw exception;
}
}