Title: [2447] trunk/openejb2/modules/core/src/java/org/openejb/EjbInvocationImpl.java: No longer externalizable, fields are now final
Revision
2447
Author
dblevins
Date
2006-02-15 23:53:46 -0500 (Wed, 15 Feb 2006)

Log Message

No longer externalizable, fields are now final

Modified Paths


Diff

Modified: trunk/openejb2/modules/core/src/java/org/openejb/EjbInvocationImpl.java (2446 => 2447)

--- trunk/openejb2/modules/core/src/java/org/openejb/EjbInvocationImpl.java	2006-02-16 04:04:55 UTC (rev 2446)
+++ trunk/openejb2/modules/core/src/java/org/openejb/EjbInvocationImpl.java	2006-02-16 04:53:46 UTC (rev 2447)
@@ -47,13 +47,12 @@
  */
 package org.openejb;
 
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
+import java.util.Map;
+import java.util.HashMap;
 
-import org.apache.geronimo.core.service.SimpleInvocation;
 import org.apache.geronimo.core.service.InvocationResult;
 import org.apache.geronimo.core.service.SimpleInvocationResult;
+import org.apache.geronimo.core.service.InvocationKey;
 
 import org.apache.geronimo.transaction.context.TransactionContext;
 
@@ -62,13 +61,14 @@
  *
  * @version $Revision$ $Date$
  */
-public class EjbInvocationImpl extends SimpleInvocation implements EjbInvocation {
-    // Fields are immutable, but not final due to readExternal
-    private EJBInterfaceType type;
-    private int index;
-    private Object[] arguments;
-    private Object id;
+public class EjbInvocationImpl implements EjbInvocation {
 
+    private final Map data = "" HashMap();
+    private final EJBInterfaceType type;
+    private final int index;
+    private final Object[] arguments;
+    private final Object id;
+
     // The deployment that we are invoking, this is set in the deployment before sending the invocation to the interceptor stack
     private transient ExtendedEjbDeployment ejbDeployment;
 
@@ -78,12 +78,6 @@
     // Valid in server-side interceptor stack once a TransactionContext has been created
     private transient TransactionContext transactionContext;
 
-    /**
-     * No-arg constructor needed for Externalizable
-     */
-    public EjbInvocationImpl() {
-    }
-
     public EjbInvocationImpl(EJBInterfaceType type, int index, Object[] arguments) {
         assert type != null : "Interface type may not be null";
         assert index >= 0 : "Invalid method index: "+index;
@@ -112,6 +106,17 @@
         this.instanceContext = instanceContext;
     }
 
+    public Object get(InvocationKey key) {
+        if(data="" {
+            return null;
+        }
+        return data.get(key);
+    }
+
+    public void put(InvocationKey key, Object value) {
+        data.put(key, value);
+    }
+
     public int getMethodIndex() {
         return index;
     }
@@ -159,20 +164,4 @@
     public InvocationResult createExceptionResult(Exception exception) {
         return new SimpleInvocationResult(false, exception);
     }
-
-    public void writeExternal(ObjectOutput out) throws IOException {
-        super.writeExternal(out);
-        out.writeObject(type);
-        out.writeInt(index);
-        out.writeObject(arguments);
-        out.writeObject(id);
-    }
-
-    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        super.readExternal(in);
-        type = (EJBInterfaceType) in.readObject();
-        index = in.readInt();
-        arguments = (Object[]) in.readObject();
-        id = in.readObject();
-    }
 }

Reply via email to