openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1468046 - in /openwebbeans/trunk: webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/ webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ webbeans-impl/src/main/java/org/apache/webbeans/component/ webbeans-spi/src/mai...
Date Mon, 15 Apr 2013 13:27:17 GMT
Author: rmannibucau
Date: Mon Apr 15 13:27:17 2013
New Revision: 1468046

URL: http://svn.apache.org/r1468046
Log:
OWB-835 resource should be ser.

Modified:
    openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalProvider.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionProvider.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryProvider.java
    openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorProvider.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ResourceProvider.java
    openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/api/ResourceReference.java

Modified: openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalProvider.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalProvider.java?rev=1468046&r1=1468045&r2=1468046&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalProvider.java
(original)
+++ openwebbeans/trunk/webbeans-ee-common/src/main/java/org/apache/webbeans/ee/common/beans/PrincipalProvider.java
Mon Apr 15 13:27:17 2013
@@ -18,6 +18,8 @@
  */
 package org.apache.webbeans.ee.common.beans;
 
+import java.io.ObjectStreamException;
+import java.io.Serializable;
 import java.security.Principal;
 
 import javax.inject.Provider;
@@ -25,10 +27,10 @@ import javax.inject.Provider;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.spi.SecurityService;
 
-public class PrincipalProvider implements Provider<Principal>
+public class PrincipalProvider implements Provider<Principal>, Serializable
 {
 
-    private WebBeansContext webBeansContext;
+    private transient WebBeansContext webBeansContext;
 
     public PrincipalProvider(WebBeansContext webBeansContext)
     {
@@ -38,6 +40,11 @@ public class PrincipalProvider implement
     @Override
     public Principal get()
     {
+        if (webBeansContext == null)
+        {
+            webBeansContext = WebBeansContext.currentInstance();
+        }
+
         SecurityService securityService = webBeansContext.getService(SecurityService.class);
         if(securityService == null)
         {
@@ -48,4 +55,9 @@ public class PrincipalProvider implement
             return securityService.getCurrentPrincipal();
         }
     }
+
+    Object readResolve() throws ObjectStreamException
+    {
+        return get();
+    }
 }

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionProvider.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionProvider.java?rev=1468046&r1=1468045&r2=1468046&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionProvider.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/UserTransactionProvider.java
Mon Apr 15 13:27:17 2013
@@ -24,10 +24,13 @@ import javax.transaction.UserTransaction
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.spi.TransactionService;
 
-public class UserTransactionProvider implements Provider<UserTransaction>
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+public class UserTransactionProvider implements Provider<UserTransaction>, Serializable
 {
 
-    private WebBeansContext webBeansContext;
+    private transient WebBeansContext webBeansContext;
     
     public UserTransactionProvider(WebBeansContext webBeansContext)
     {
@@ -37,6 +40,11 @@ public class UserTransactionProvider imp
     @Override
     public UserTransaction get()
     {
+        if (webBeansContext == null)
+        {
+            webBeansContext = WebBeansContext.currentInstance();
+        }
+
         TransactionService transactionService = webBeansContext.getService(TransactionService.class);
         if(transactionService != null)
         {
@@ -44,4 +52,9 @@ public class UserTransactionProvider imp
         }
         return null;
     }
+
+    Object readResolve() throws ObjectStreamException
+    {
+        return get();
+    }
 }

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryProvider.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryProvider.java?rev=1468046&r1=1468045&r2=1468046&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryProvider.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorFactoryProvider.java
Mon Apr 15 13:27:17 2013
@@ -24,10 +24,13 @@ import javax.validation.ValidatorFactory
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.spi.ValidatorService;
 
-public class ValidatorFactoryProvider implements Provider<ValidatorFactory>
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+public class ValidatorFactoryProvider implements Provider<ValidatorFactory>, Serializable
 {
 
-    private WebBeansContext webBeansContext;
+    private transient WebBeansContext webBeansContext;
     
     public ValidatorFactoryProvider(WebBeansContext webBeansContext)
     {
@@ -37,6 +40,11 @@ public class ValidatorFactoryProvider im
     @Override
     public ValidatorFactory get()
     {
+        if (webBeansContext == null)
+        {
+            webBeansContext = WebBeansContext.currentInstance();
+        }
+
         ValidatorService validatorService = webBeansContext.getService(ValidatorService.class);
         if(validatorService != null)
         {
@@ -44,4 +52,9 @@ public class ValidatorFactoryProvider im
         }        
         return null;
     }
+
+    Object readResolve() throws ObjectStreamException
+    {
+        return get();
+    }
 }

Modified: openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorProvider.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorProvider.java?rev=1468046&r1=1468045&r2=1468046&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorProvider.java
(original)
+++ openwebbeans/trunk/webbeans-ee/src/main/java/org/apache/webbeans/ee/beans/ValidatorProvider.java
Mon Apr 15 13:27:17 2013
@@ -24,10 +24,13 @@ import javax.validation.Validator;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.spi.ValidatorService;
 
-public class ValidatorProvider implements Provider<Validator>
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+public class ValidatorProvider implements Provider<Validator>, Serializable
 {
 
-    private WebBeansContext webBeansContext;
+    private transient WebBeansContext webBeansContext;
     
     public ValidatorProvider(WebBeansContext webBeansContext)
     {
@@ -37,6 +40,11 @@ public class ValidatorProvider implement
     @Override
     public Validator get()
     {
+        if (webBeansContext == null)
+        {
+            webBeansContext = WebBeansContext.currentInstance();
+        }
+
         ValidatorService validatorService = webBeansContext.getService(ValidatorService.class);
         if(validatorService != null)
         {
@@ -44,4 +52,9 @@ public class ValidatorProvider implement
         }        
         return null;
     }
+
+    Object readResolve() throws ObjectStreamException
+    {
+        return get();
+    }
 }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ResourceProvider.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ResourceProvider.java?rev=1468046&r1=1468045&r2=1468046&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ResourceProvider.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ResourceProvider.java
Mon Apr 15 13:27:17 2013
@@ -25,11 +25,14 @@ import org.apache.webbeans.exception.Web
 import org.apache.webbeans.spi.ResourceInjectionService;
 import org.apache.webbeans.spi.api.ResourceReference;
 
-public class ResourceProvider<T> implements Provider<T>
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+
+public class ResourceProvider<T> implements Provider<T>, Serializable
 {
     
     private ResourceReference<T, ?> resourceReference = null;
-    private WebBeansContext webBeansContext;
+    private transient WebBeansContext webBeansContext;
 
     public ResourceProvider(ResourceReference<T, ?> resourceReference, WebBeansContext
webBeansContext)
     {
@@ -40,6 +43,11 @@ public class ResourceProvider<T> impleme
     @Override
     public T get()
     {
+        if (webBeansContext == null)
+        {
+            webBeansContext = WebBeansContext.currentInstance();
+        }
+
         try
         {
             ResourceInjectionService resourceService = webBeansContext.getService(ResourceInjectionService.class);
@@ -50,4 +58,9 @@ public class ResourceProvider<T> impleme
             throw new WebBeansException(e);
         }
     }
+
+    Object readResolve() throws ObjectStreamException
+    {
+        return get();
+    }
 }

Modified: openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/api/ResourceReference.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/api/ResourceReference.java?rev=1468046&r1=1468045&r2=1468046&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/api/ResourceReference.java
(original)
+++ openwebbeans/trunk/webbeans-spi/src/main/java/org/apache/webbeans/spi/api/ResourceReference.java
Mon Apr 15 13:27:17 2013
@@ -18,11 +18,12 @@
  */
 package org.apache.webbeans.spi.api;
 
+import java.io.Serializable;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 
 
-public class ResourceReference<X,T extends Annotation>
+public class ResourceReference<X,T extends Annotation> implements Serializable
 {
     private final T annotation;
     



Mime
View raw message