Author: richard.opalka(a)jboss.com
Date: 2008-11-27 10:25:51 -0500 (Thu, 27 Nov 2008)
New Revision: 8806
Modified:
container/jboss50/branches/jboss500CR2/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java
Log:
[JBWS-2268] call post construct for JSE endpoints
Modified:
container/jboss50/branches/jboss500CR2/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java
===================================================================
---
container/jboss50/branches/jboss500CR2/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java 2008-11-27
15:15:48 UTC (rev 8805)
+++
container/jboss50/branches/jboss500CR2/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java 2008-11-27
15:25:51 UTC (rev 8806)
@@ -26,6 +26,8 @@
import javax.xml.ws.WebServiceContext;
import org.jboss.wsf.common.JavaUtils;
+import org.jboss.wsf.common.javax.JavaxAnnotationHelper;
+import org.jboss.wsf.common.javax.PreDestroyHolder;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -39,6 +41,7 @@
* Handles invocations on JSE endpoints.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author richard.opalka(a)jboss.com
* @since 25-Apr-2007
*/
public class InvocationHandlerJSE extends InvocationHandler
@@ -61,7 +64,7 @@
{
}
- protected Object getTargetBean(Endpoint ep, Invocation epInv)
+ protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception
{
InvocationContext invCtx = epInv.getInvocationContext();
Object targetBean = invCtx.getTargetBean();
@@ -69,7 +72,7 @@
{
try
{
- Class epImpl = ep.getTargetBeanClass();
+ Class<?> epImpl = ep.getTargetBeanClass();
targetBean = epImpl.newInstance();
invCtx.setTargetBean(targetBean);
}
@@ -77,10 +80,14 @@
{
throw new IllegalStateException("Cannot get target bean instance",
ex);
}
+
+ JavaxAnnotationHelper.callPostConstructMethod(targetBean,
targetBean.getClass().getClassLoader());
+ ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
+
return targetBean;
}
-
+
public void invoke(Endpoint ep, Invocation epInv) throws Exception
{
try
@@ -105,13 +112,13 @@
}
}
- protected Method getImplMethod(Class implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
+ protected Method getImplMethod(Class<?> implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
{
String methodName = seiMethod.getName();
- Class[] paramTypes = seiMethod.getParameterTypes();
+ Class<?>[] paramTypes = seiMethod.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++)
{
- Class paramType = paramTypes[i];
+ Class<?> paramType = paramTypes[i];
if (JavaUtils.isPrimitive(paramType) == false)
{
String paramTypeName = paramType.getName();
Modified:
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java
===================================================================
---
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java 2008-11-27
15:15:48 UTC (rev 8805)
+++
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/invocation/InvocationHandlerJSE.java 2008-11-27
15:25:51 UTC (rev 8806)
@@ -26,6 +26,8 @@
import javax.xml.ws.WebServiceContext;
import org.jboss.wsf.common.JavaUtils;
+import org.jboss.wsf.common.javax.JavaxAnnotationHelper;
+import org.jboss.wsf.common.javax.PreDestroyHolder;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -39,6 +41,7 @@
* Handles invocations on JSE endpoints.
*
* @author Thomas.Diesler(a)jboss.org
+ * @author richard.opalka(a)jboss.com
* @since 25-Apr-2007
*/
public class InvocationHandlerJSE extends InvocationHandler
@@ -61,7 +64,7 @@
{
}
- protected Object getTargetBean(Endpoint ep, Invocation epInv)
+ protected Object getTargetBean(Endpoint ep, Invocation epInv) throws Exception
{
InvocationContext invCtx = epInv.getInvocationContext();
Object targetBean = invCtx.getTargetBean();
@@ -69,7 +72,7 @@
{
try
{
- Class epImpl = ep.getTargetBeanClass();
+ Class<?> epImpl = ep.getTargetBeanClass();
targetBean = epImpl.newInstance();
invCtx.setTargetBean(targetBean);
}
@@ -77,10 +80,14 @@
{
throw new IllegalStateException("Cannot get target bean instance",
ex);
}
+
+ JavaxAnnotationHelper.callPostConstructMethod(targetBean,
targetBean.getClass().getClassLoader());
+ ep.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
}
+
return targetBean;
}
-
+
public void invoke(Endpoint ep, Invocation epInv) throws Exception
{
try
@@ -105,13 +112,13 @@
}
}
- protected Method getImplMethod(Class implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
+ protected Method getImplMethod(Class<?> implClass, Method seiMethod) throws
ClassNotFoundException, NoSuchMethodException
{
String methodName = seiMethod.getName();
- Class[] paramTypes = seiMethod.getParameterTypes();
+ Class<?>[] paramTypes = seiMethod.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++)
{
- Class paramType = paramTypes[i];
+ Class<?> paramType = paramTypes[i];
if (JavaUtils.isPrimitive(paramType) == false)
{
String paramTypeName = paramType.getName();