Author: struberg
Date: Sun Jan 6 10:04:22 2013
New Revision: 1429490
URL: http://svn.apache.org/viewvc?rev=1429490&view=rev
Log:
OWB-344 add passivationId field to our proxies
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
Modified:
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
URL:
http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java?rev=1429490&r1=1429489&r2=1429490&view=diff
==============================================================================
---
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
(original)
+++
openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
Sun Jan 6 10:04:22 2013
@@ -33,8 +33,14 @@ import org.objectweb.asm.Type;
public abstract class AbstractProxyFactory
{
/**
+ * The name of the field which stores the passivationID of the Bean this
proxy serves.
+ * This is needed in case the proxy gets de-serialized back into a JVM
+ * which didn't have this bean loaded yet.
+ */
+ public static final String FIELD_BEAN_PASSIVATION_ID =
"owbBeanPassivationId";
+
+ /**
* @return the marker interface which should be used for this proxy.
- * TODO this must be a list and for NormalScopeProxy we need add
Serializable
*/
protected abstract Class getMarkerInterface();
@@ -103,6 +109,11 @@ public abstract class AbstractProxyFacto
createInstanceVariables(cw, classToProxy, classFileName);
+
+ // create a static String Field which contains the passivationId of
the Bean or null if not PassivationCapable
+ cw.visitField(Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC,
+ FIELD_BEAN_PASSIVATION_ID, Type.getDescriptor(String.class),
null, null).visitEnd();
+
createConstructor(cw, proxyClassFileName, classToProxy, classFileName);