[jboss-cvs] JBossAS SVN: r95544 - in projects/weld-int/trunk: ejb/src/main/java/org/jboss/weld/integration/ejb/interceptor and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Oct 24 15:11:18 EDT 2009
Author: marius.bogoevici
Date: 2009-10-24 15:11:18 -0400 (Sat, 24 Oct 2009)
New Revision: 95544
Modified:
projects/weld-int/trunk/ejb/src/main/java/org/jboss/weld/integration/ejb/interceptor/Jsr299BindingsInterceptor.java
projects/weld-int/trunk/pom.xml
Log:
Updating weld.api dependencies. Make the interceptors serializable.
Modified: projects/weld-int/trunk/ejb/src/main/java/org/jboss/weld/integration/ejb/interceptor/Jsr299BindingsInterceptor.java
===================================================================
--- projects/weld-int/trunk/ejb/src/main/java/org/jboss/weld/integration/ejb/interceptor/Jsr299BindingsInterceptor.java 2009-10-24 07:51:30 UTC (rev 95543)
+++ projects/weld-int/trunk/ejb/src/main/java/org/jboss/weld/integration/ejb/interceptor/Jsr299BindingsInterceptor.java 2009-10-24 19:11:18 UTC (rev 95544)
@@ -40,6 +40,8 @@
import org.jboss.weld.integration.ejb.SessionBeanInterceptor;
import org.jboss.weld.integration.ejb.JBossEjbServices;
import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance;
+import org.jboss.weld.serialization.spi.ContextualStore;
/**
* Interceptor for applying the JSR-299 specific interceptor bindings.
@@ -62,7 +64,7 @@
private InterceptorBindings interceptorBindings;
- private Map<String, Object> interceptorInstances;
+ private Map<String, SerializableContextualInstance<Interceptor<Object>, Object>> interceptorInstances;
@PostConstruct
public void doPostConstruct(InvocationContext invocationContext) throws Exception
@@ -74,7 +76,7 @@
private void init(InvocationContext invocationContext)
{
// create contextual instances for inteDITrceptors
- interceptorInstances = new ConcurrentHashMap<String, Object>();
+ interceptorInstances = new ConcurrentHashMap<String, SerializableContextualInstance<Interceptor<Object>, Object>>();
EjbDescriptor<?> ejbDescriptor = (EjbDescriptor<?>) invocationContext.getContextData().get(SessionBeanInterceptor.EJB_DESCRIPTOR);
EjbServices ejbServices = beanManager.getServices().get(EjbServices.class);
if (ejbServices instanceof ForwardingEjbServices)
@@ -90,17 +92,20 @@
{
for (Interceptor<?> interceptor : interceptorBindings.getAllInterceptors())
{
- addInterceptorInstance(interceptor, invocationContext);
+ addInterceptorInstance((Interceptor<Object>)interceptor, invocationContext);
}
}
}
@SuppressWarnings("unchecked")
- private <T> void addInterceptorInstance(Interceptor<T> interceptor, InvocationContext invocationContext)
+ private void addInterceptorInstance(Interceptor<Object> interceptor, InvocationContext invocationContext)
{
- CreationalContext<T> creationalContext = (CreationalContext<T>) invocationContext.getContextData().get(SessionBeanInterceptor.CREATIONAL_CONTEXT);
- interceptorInstances.put(interceptor.getBeanClass().getName(), beanManager.getContext(interceptor.getScope()).get(interceptor, creationalContext));
+ CreationalContext<Object> creationalContext = (CreationalContext<Object>) invocationContext.getContextData().get(SessionBeanInterceptor.CREATIONAL_CONTEXT);
+ Object instance = beanManager.getContext(interceptor.getScope()).get(interceptor, creationalContext);
+ SerializableContextualInstance<Interceptor<Object>,Object> serializableContextualInstance
+ = beanManager.getServices().get(ContextualStore.class).getSerializableContextualInstance(interceptor, instance, creationalContext);
+ interceptorInstances.put(interceptor.getBeanClass().getName(), serializableContextualInstance);
}
@PreDestroy
@@ -149,7 +154,7 @@
List<Object> currentInterceptorInstances = new ArrayList<Object>();
for (Interceptor<?> interceptor: currentInterceptors)
{
- currentInterceptorInstances.add(interceptorInstances.get(interceptor.getBeanClass().getName()));
+ currentInterceptorInstances.add(interceptorInstances.get(interceptor.getBeanClass().getName()).getInstance());
}
if (currentInterceptorInstances.size() > 0)
{
Modified: projects/weld-int/trunk/pom.xml
===================================================================
--- projects/weld-int/trunk/pom.xml 2009-10-24 07:51:30 UTC (rev 95543)
+++ projects/weld-int/trunk/pom.xml 2009-10-24 19:11:18 UTC (rev 95544)
@@ -25,8 +25,8 @@
<properties>
<version.weld>1.0.0-SNAPSHOT</version.weld>
- <version.weld.api>1.0-CR1</version.weld.api>
- <version.jboss.interceptor>1.0.0-SNAPSHOT</version.jboss.interceptor>
+ <version.weld.api>1.0-SNAPSHOT</version.weld.api>
+ <version.jboss.interceptor>1.0.0-CR4</version.jboss.interceptor>
<version.jboss.vfs>2.1.2.GA</version.jboss.vfs>
<version.jboss.man>2.1.0.GA</version.jboss.man>
<version.jboss.microcontainer>2.0.8.GA</version.jboss.microcontainer>
More information about the jboss-cvs-commits
mailing list