deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject deltaspike git commit: DELTASPIKE-834 use ApplicationScoped as workaround for Weld-1.x containers
Date Tue, 17 Feb 2015 17:30:49 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 7ad36c14c -> 77be425a7


DELTASPIKE-834 use ApplicationScoped as workaround for Weld-1.x containers

Weld did check passivationCapable with isSerializable(bean.getBeanClass())
This got fixed in Weld-2.x but we already need this working in Weld-1.x
so we went for ApplicationScoped.


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/77be425a
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/77be425a
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/77be425a

Branch: refs/heads/master
Commit: 77be425a75d56f1e998a9d5cf73e07baa387fd04
Parents: 7ad36c1
Author: Mark Struberg <struberg@apache.org>
Authored: Tue Feb 17 18:28:15 2015 +0100
Committer: Mark Struberg <struberg@apache.org>
Committed: Tue Feb 17 18:28:15 2015 +0100

----------------------------------------------------------------------
 .../deltaspike/core/impl/message/MessageBundleExtension.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/77be425a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/MessageBundleExtension.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/MessageBundleExtension.java
b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/MessageBundleExtension.java
index b27799f..649c75c 100644
--- a/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/MessageBundleExtension.java
+++ b/deltaspike/core/impl/src/main/java/org/apache/deltaspike/core/impl/message/MessageBundleExtension.java
@@ -27,6 +27,7 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
+import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.event.Observes;
 import javax.enterprise.inject.spi.*;
@@ -147,6 +148,7 @@ public class MessageBundleExtension implements Extension, Deactivatable
 
         beanBuilder.types(annotatedType.getJavaClass(), Object.class, Serializable.class);
         beanBuilder.passivationCapable(true);
+        beanBuilder.scope(ApplicationScoped.class); // needs to be a normalscope due to a
bug in older Weld versions
         beanBuilder.id("MessageBundleBean#" + annotatedType.getJavaClass().getName());
 
         return beanBuilder.create();
@@ -186,7 +188,7 @@ public class MessageBundleExtension implements Extension, Deactivatable
         private <T> T createMessageBundleProxy(Class<T> type, MessageBundleInvocationHandler
handler)
         {
             return type.cast(Proxy.newProxyInstance(ClassUtils.getClassLoader(null),
-                    new Class<?>[]{type}, handler));
+                    new Class<?>[]{type, Serializable.class}, handler));
         }
 
     }


Mime
View raw message