JBossWS SVN: r18899 - in container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices: invocation and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-08-30 00:49:47 -0400 (Sat, 30 Aug 2014)
New Revision: 18899
Modified:
container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java
container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
Log:
[JBWS-3514] svn merge -r 18842:18841 .
Modified: container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java
===================================================================
--- container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java 2014-08-30 04:47:11 UTC (rev 18898)
+++ container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/deployers/WSComponentInstanceAssociationInterceptor.java 2014-08-30 04:49:47 UTC (rev 18899)
@@ -24,7 +24,6 @@
import org.jboss.as.ee.component.BasicComponentInstance;
import org.jboss.as.ee.component.Component;
import org.jboss.as.ee.component.ComponentInstance;
-import org.jboss.as.naming.ManagedReference;
import org.jboss.as.webservices.injection.WSComponent;
import org.jboss.invocation.ImmediateInterceptorFactory;
import org.jboss.invocation.Interceptor;
@@ -45,13 +44,7 @@
@Override
public Object processInvocation(final InterceptorContext interceptorContext) throws Exception {
final WSComponent wsComponent = (WSComponent)interceptorContext.getPrivateData(Component.class);
- BasicComponentInstance pojoComponentInstance = null;
- if (interceptorContext.getPrivateData(ManagedReference.class) != null) {
- ManagedReference reference = interceptorContext.getPrivateData(ManagedReference.class);
- pojoComponentInstance = (BasicComponentInstance)wsComponent.createInstance(reference.getInstance());
- } else {
- pojoComponentInstance = wsComponent.getComponentInstance();
- }
+ final BasicComponentInstance pojoComponentInstance = wsComponent.getComponentInstance();
interceptorContext.putPrivateData(ComponentInstance.class, pojoComponentInstance);
return interceptorContext.proceed();
}
Modified: container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java
===================================================================
--- container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2014-08-30 04:47:11 UTC (rev 18898)
+++ container/wildfly81/tags/jbossws-wildfly810-5.0.0.Beta1/server-integration/src/main/java/org/jboss/as/webservices/invocation/AbstractInvocationHandler.java 2014-08-30 04:49:47 UTC (rev 18899)
@@ -77,7 +77,7 @@
if (componentView == null) {
componentView = getMSCService(componentViewName, ComponentView.class);
if (componentView == null) {
- throw MESSAGES.cannotFindComponentView(componentViewName);
+ throw MESSAGES.cannotFindComponentView(componentViewName);
}
if (reference == null) {
try {
@@ -103,24 +103,22 @@
try {
// prepare for invocation
onBeforeInvocation(wsInvocation);
+ //for spring integration we don't need to go into ee's interceptors
+ if(wsInvocation.getInvocationContext().getTargetBean() != null && endpoint.getProperty("SpringBus") != null) {
+ this.reference = new ManagedReference() {
+ public void release() {
+ }
+
+ public Object getInstance() {
+ return wsInvocation.getInvocationContext().getTargetBean();
+ }
+ };
+ }
// prepare invocation data
final ComponentView componentView = getComponentView();
Component component = componentView.getComponent();
- //for spring integration and @FactoryType is annotated we don't need to go into ee's interceptors
- if(wsInvocation.getInvocationContext().getTargetBean() != null
- && (endpoint.getProperty("SpringBus") != null)
- || wsInvocation.getInvocationContext().getProperty("forceTargetBean") != null) {
- this.reference = new ManagedReference() {
- public void release() {
- }
-
- public Object getInstance() {
- return wsInvocation.getInvocationContext().getTargetBean();
- }
- };
- if (component instanceof WSComponent) {
- ((WSComponent) component).setReference(reference);
- }
+ if (component instanceof WSComponent && endpoint.getProperty("SpringBus") != null) {
+ ((WSComponent)component).setReference(reference);
}
final Method method = getComponentViewMethod(wsInvocation.getJavaMethod(), componentView.getViewMethods());
final InterceptorContext context = new InterceptorContext();
@@ -129,16 +127,13 @@
context.setParameters(wsInvocation.getArgs());
context.putPrivateData(Component.class, component);
context.putPrivateData(ComponentView.class, componentView);
- if(wsInvocation.getInvocationContext().getProperty("forceTargetBean") != null) {
- context.putPrivateData(ManagedReference.class, reference);
- }
// invoke method
final Object retObj = componentView.invoke(context);
// set return value
wsInvocation.setReturnValue(retObj);
}
catch (Throwable t) {
- WSLogger.ROOT_LOGGER.error(MESSAGES.methodInvocationFailed(t.getLocalizedMessage()), t);
+ WSLogger.ROOT_LOGGER.error(MESSAGES.methodInvocationFailed(t.getLocalizedMessage()), t);
handleInvocationException(t);
}
finally {
@@ -215,4 +210,5 @@
return true;
}
-}
\ No newline at end of file
+}
+