Author: richard.opalka(a)jboss.com
Date: 2009-10-15 19:00:28 -0400 (Thu, 15 Oct 2009)
New Revision: 10919
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
Removed:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
Modified:
container/jboss50/branches/jbossws-jboss500/pom.xml
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
container/jboss50/branches/jbossws-jboss501/pom.xml
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
container/jboss50/branches/jbossws-jboss510/pom.xml
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
Log:
merge from ropalka branch
Modified: container/jboss50/branches/jbossws-jboss500/pom.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss500/pom.xml 2009-10-15 22:57:15 UTC (rev
10918)
+++ container/jboss50/branches/jbossws-jboss500/pom.xml 2009-10-15 23:00:28 UTC (rev
10919)
@@ -24,8 +24,8 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.2.0.GA</jbossws.common.version>
- <jbossws.spi.version>1.2.0.GA</jbossws.spi.version>
+ <jbossws.common.version>1.2.1-SNAPSHOT</jbossws.common.version>
+ <jbossws.spi.version>1.2.1-SNAPSHOT</jbossws.spi.version>
<!--
JBoss component versions taken from
http://repository.jboss.org/maven2/org/jboss/jbossas/jboss-as-component-m...
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.config;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+
+/**
+ * Retrieves webservices stack specific config from MC kernel.
+ *
+ * @author <a href="mailto:hbraun@redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class ServerConfigFactoryImpl extends ServerConfigFactory
+{
+
+ /** The bean name in the kernel registry. */
+ private static final String BEAN_NAME = "WSServerConfig";
+
+ /**
+ * Constructor.
+ */
+ public ServerConfigFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns config registered in MC kernel.
+ *
+ * @return config
+ */
+ public ServerConfig getServerConfig()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(ServerConfigFactoryImpl.BEAN_NAME,
ServerConfig.class);
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -81,14 +81,6 @@
}
/**
- * Starts an instance of this HTTP server.
- */
- public void start()
- {
- // Nothing to start, we're running inside JBoss AS
- }
-
- /**
* Creates an requested HTTP context.
*
* @param contextRoot context root name
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.endpoint;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * Lookups http server inside MC container.
+ *
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class HttpServerFactoryImpl extends HttpServerFactory
+{
+
+ /** The default bean name. */
+ private static final String BEAN_NAME = "WSHTTPServer";
+
+ /**
+ * Constructor.
+ */
+ public HttpServerFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns http server registered in MC kernel.
+ *
+ * @return http server
+ */
+ @Override
+ public HttpServer getHttpServer()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(HttpServerFactoryImpl.BEAN_NAME, HttpServer.class);
+ }
+
+}
Deleted:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-
-/**
- * Base class for all Web Service invocation handlers inside AS.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandler extends InvocationHandler
-{
-
- /** Logger. */
- protected final Logger log = Logger.getLogger(this.getClass());
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandler()
- {
- super();
- }
-
- /**
- * Creates invocation.
- *
- * @return invocation instance
- */
- public final Invocation createInvocation()
- {
- return new Invocation();
- }
-
- /**
- * Initialization method.
- *
- * @param endpoint endpoint
- */
- public void init(final Endpoint endpoint)
- {
- // does nothing
- }
-
- /**
- * Returns implementation method that will be used for invocation.
- *
- * @param implClass implementation endpoint class
- * @param seiMethod SEI interface method used for method finding algorithm
- * @return implementation method
- * @throws NoSuchMethodException if implementation method wasn't found
- */
- protected final Method getImplMethod(final Class<?> implClass, final Method
seiMethod) throws NoSuchMethodException
- {
- final String methodName = seiMethod.getName();
- final Class<?>[] paramTypes = seiMethod.getParameterTypes();
-
- return implClass.getMethod(methodName, paramTypes);
- }
-
-}
Deleted:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
-{
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandlerJSE()
- {
- super();
- }
-
- /**
- * Retrieves endpoint implementation bean that will be used in invocation process.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>tries to retrieve endpoint instance from invocation
context,</li>
- * <li>if endpoint instance is not found it's created and instantiated
(lazy initialization)</li>
- * <li>
- * if endpoint instance was created all subclasses will be notified about this
event
- * (using {@link #onEndpointInstantiated(Endpoint, Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint to lookup implementation instance for
- * @param invocation current invocation
- * @return endpoint implementation
- * @throws Exception if any error occurs
- */
- protected final Object getTargetBean(final Endpoint endpoint, final Invocation
invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- Object targetBean = invocationContext.getTargetBean();
-
- if (targetBean == null)
- {
- try
- {
- // create endpoint instance
- final Class<?> endpointImplClass = endpoint.getTargetBeanClass();
- targetBean = endpointImplClass.newInstance();
- invocationContext.setTargetBean(targetBean);
-
- // notify subclasses
- this.onEndpointInstantiated(endpoint, invocation);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot create endpoint instance:
", ex);
- }
- }
-
- return targetBean;
- }
-
- /**
- * Invokes method on endpoint implementation.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>lookups endpoint implementation method to be invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method is going to be
invoked<br/>
- * (using {@link #onBeforeInvocation(Invocation)} template method),
- * </li>
- * <li>endpoint implementation method is invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method invocation was
completed<br/>
- * (using {@link #onAfterInvocation(Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint which method is going to be invoked
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- public final void invoke(final Endpoint endpoint, final Invocation invocation) throws
Exception
- {
- try
- {
- // prepare for invocation
- final Object targetBean = this.getTargetBean(endpoint, invocation);
- final Class<?> implClass = targetBean.getClass();
- final Method seiMethod = invocation.getJavaMethod();
- final Method implMethod = this.getImplMethod(implClass, seiMethod);
- final Object[] args = invocation.getArgs();
-
- // notify subclasses
- this.onBeforeInvocation(invocation);
-
- // invoke implementation method
- final Object retObj = implMethod.invoke(targetBean, args);
-
- // set invocation result
- invocation.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- this.log.error("Method invocation failed with exception: " +
e.getMessage(), e);
- // propagate exception
- this.handleInvocationException(e);
- }
- finally
- {
- // notify subclasses
- this.onAfterInvocation(invocation);
- }
- }
-
- /**
- * Template method for notifying subclasses that endpoint instance have been
instantiated.
- *
- * @param endpoint instantiated endpoint
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation
invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method is going to be
invoked.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method invocation was
completed.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
-}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -39,6 +39,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -25,14 +25,16 @@
import javax.xml.ws.WebServiceException;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.integration.InvocationContextCallback;
import org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer;
-import org.jboss.wsf.spi.util.KernelLocator;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
/**
* Handles invocations on EJB3 endpoints.
@@ -44,7 +46,7 @@
{
/** MC kernel controller. */
- private final KernelController controller;
+ private final IoCContainerProxy iocContainer;
/** EJB3 container name. */
private String containerName;
@@ -59,7 +61,9 @@
{
super();
- this.controller = KernelLocator.getKernel().getController();
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ this.iocContainer = iocContainerFactory.getContainer();
}
/**
@@ -88,13 +92,11 @@
if (ejb3ContainerNotInitialized)
{
- final ControllerContext context =
this.controller.getInstalledContext(this.containerName);
- if (context == null)
+ this.serviceEndpointContainer = this.iocContainer.getBean(this.containerName,
ServiceEndpointContainer.class);
+ if (this.serviceEndpointContainer == null)
{
throw new WebServiceException("Cannot find service endpoint target:
" + this.containerName);
}
-
- this.serviceEndpointContainer = (ServiceEndpointContainer) context.getTarget();
}
return this.serviceEndpointContainer;
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXRPC;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
import org.jboss.wsf.spi.invocation.InvocationType;
Deleted:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JAXRPC endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXRPC extends AbstractInvocationHandlerJSE
-{
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXRPC()
- {
- super();
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- final ServletEndpointContext sepContext =
invocationContext.getAttachment(ServletEndpointContext.class);
- ((ServiceLifecycle) targetBean).init(sepContext);
- }
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- ((ServiceLifecycle) targetBean).destroy();
- }
- }
-
-}
Deleted:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.common.injection.InjectionHelper;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
-
-/**
- * Handles invocations on JAXWS endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXWS extends AbstractInvocationHandlerJSE
-{
-
- /** WebServiceContext injector. */
- private final ResourceInjector wsContextInjector;
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXWS()
- {
- super();
-
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ResourceInjectorFactory resourceInjectorFactory =
spiProvider.getSPI(ResourceInjectorFactory.class);
- this.wsContextInjector = resourceInjectorFactory.newResourceInjector();
- }
-
- /**
- * Injects resources on target bean and calls post construct method.
- * Finally it registers target bean for predestroy phase.
- *
- * @param endpoint used for predestroy phase registration process
- * @param invocation current invocation
- */
- @Override
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation
invocation)
- {
- final InjectionsMetaData injectionsMD =
endpoint.getAttachment(InjectionsMetaData.class);
- final Object targetBean = this.getTargetBean(invocation);
-
- this.log.debug("Injecting resources on JAXWS JSE endpoint: " +
targetBean);
- InjectionHelper.injectResources(targetBean, injectionsMD);
- this.log.debug("Calling postConstruct method on JAXWS JSE endpoint: " +
targetBean);
- InjectionHelper.callPostConstructMethod(targetBean);
-
- endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
- }
-
- /**
- * Injects webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
- this.wsContextInjector.inject(targetBean, wsContext);
- }
- }
-
- /**
- * Cleanups injected webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
-
- this.wsContextInjector.inject(targetBean, null);
- }
- }
-
- /**
- * Returns WebServiceContext associated with this invocation.
- *
- * @param invocation current invocation
- * @return web service context or null if not available
- */
- private WebServiceContext getWebServiceContext(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getAttachment(WebServiceContext.class);
- }
-
- /**
- * Returns endpoint instance associated with current invocation.
- *
- * @param invocation current invocation
- * @return target bean in invocation
- */
- private Object getTargetBean(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getTargetBean();
- }
-
-}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB21 endpoints.
*
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB3 endpoints.
*
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyFactoryImpl implements IoCContainerProxyFactory
+{
+
+ /** Container proxy singleton. */
+ private static final IoCContainerProxy CONTAINER =
IoCContainerProxyImpl.getInstance();
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory#getContainer()
+ *
+ * @return IoC container proxy
+ */
+ public IoCContainerProxy getContainer()
+ {
+ return IoCContainerProxyFactoryImpl.CONTAINER;
+ }
+
+}
Added:
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss500/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyImpl implements IoCContainerProxy
+{
+
+ /** Singleton. */
+ private static final IoCContainerProxy SINGLETON = new IoCContainerProxyImpl();
+ /** JBoss MC kernel. */
+ private static Kernel kernel;
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns container proxy instance.
+ *
+ * @return container proxy instance
+ */
+ static IoCContainerProxy getInstance()
+ {
+ return IoCContainerProxyImpl.SINGLETON;
+ }
+
+ /**
+ * Sets JBoss kernel - invoked via MC injection.
+ *
+ * @param kernel JBoss kernel
+ */
+ public void setKernel(final Kernel kernel)
+ {
+ IoCContainerProxyImpl.kernel = kernel;
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy#getBean(java.lang.String,
java.lang.Class)
+ *
+ * @param <T> bean type
+ * @param beanName bean name inside IoC registry
+ * @param clazz bean type class
+ * @return bean instance
+ * @throws IllegalArgumentException if bean is not found
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getBean(final String beanName, final Class<T> clazz)
+ {
+ final KernelController controller = IoCContainerProxyImpl.kernel.getController();
+ final ControllerContext ctx = controller.getInstalledContext(beanName);
+
+ return (T)ctx.getTarget();
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-15
23:00:28 UTC (rev 10919)
@@ -2,14 +2,18 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator"
class="org.jboss.wsf.spi.util.KernelLocator">
+ <!-- Wraps single instance of the kernel -->
+ <bean name="WSIoCContainerProxy"
class="org.jboss.webservices.integration.ioc.IoCContainerProxyImpl">
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
<!-- Locate the single instance of the MBeanServer -->
<bean name="WSMBeanServerLocator"
class="org.jboss.wsf.framework.management.MBeanServerLocator">
- <property name="mbeanServer"><inject bean="JMXKernel"
property="mbeanServer"/></property>
+ <constructor>
+ <parameter>
+ <inject bean="JMXKernel" property="mbeanServer"/>
+ </parameter>
+ </constructor>
</bean>
<!-- Endpoint API http server -->
Added:
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
(rev 0)
+++
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.endpoint.HttpServerFactoryImpl
\ No newline at end of file
Added:
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
(rev 0)
+++
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.ioc.IoCContainerProxyFactoryImpl
\ No newline at end of file
Modified:
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss500/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1 +1 @@
-org.jboss.wsf.framework.management.ServerConfigFactoryImpl
\ No newline at end of file
+org.jboss.webservices.integration.config.ServerConfigFactoryImpl
\ No newline at end of file
Modified: container/jboss50/branches/jbossws-jboss501/pom.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss501/pom.xml 2009-10-15 22:57:15 UTC (rev
10918)
+++ container/jboss50/branches/jbossws-jboss501/pom.xml 2009-10-15 23:00:28 UTC (rev
10919)
@@ -24,8 +24,8 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.2.0.GA</jbossws.common.version>
- <jbossws.spi.version>1.2.0.GA</jbossws.spi.version>
+ <jbossws.common.version>1.2.1-SNAPSHOT</jbossws.common.version>
+ <jbossws.spi.version>1.2.1-SNAPSHOT</jbossws.spi.version>
<!--
JBoss component versions taken from
Added:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.config;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+
+/**
+ * Retrieves webservices stack specific config from MC kernel.
+ *
+ * @author <a href="mailto:hbraun@redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class ServerConfigFactoryImpl extends ServerConfigFactory
+{
+
+ /** The bean name in the kernel registry. */
+ private static final String BEAN_NAME = "WSServerConfig";
+
+ /**
+ * Constructor.
+ */
+ public ServerConfigFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns config registered in MC kernel.
+ *
+ * @return config
+ */
+ public ServerConfig getServerConfig()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(ServerConfigFactoryImpl.BEAN_NAME,
ServerConfig.class);
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -81,14 +81,6 @@
}
/**
- * Starts an instance of this HTTP server.
- */
- public void start()
- {
- // Nothing to start, we're running inside JBoss AS
- }
-
- /**
* Creates an requested HTTP context.
*
* @param contextRoot context root name
Added:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.endpoint;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * Lookups http server inside MC container.
+ *
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class HttpServerFactoryImpl extends HttpServerFactory
+{
+
+ /** The default bean name. */
+ private static final String BEAN_NAME = "WSHTTPServer";
+
+ /**
+ * Constructor.
+ */
+ public HttpServerFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns http server registered in MC kernel.
+ *
+ * @return http server
+ */
+ @Override
+ public HttpServer getHttpServer()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(HttpServerFactoryImpl.BEAN_NAME, HttpServer.class);
+ }
+
+}
Deleted:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-
-/**
- * Base class for all Web Service invocation handlers inside AS.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandler extends InvocationHandler
-{
-
- /** Logger. */
- protected final Logger log = Logger.getLogger(this.getClass());
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandler()
- {
- super();
- }
-
- /**
- * Creates invocation.
- *
- * @return invocation instance
- */
- public final Invocation createInvocation()
- {
- return new Invocation();
- }
-
- /**
- * Initialization method.
- *
- * @param endpoint endpoint
- */
- public void init(final Endpoint endpoint)
- {
- // does nothing
- }
-
- /**
- * Returns implementation method that will be used for invocation.
- *
- * @param implClass implementation endpoint class
- * @param seiMethod SEI interface method used for method finding algorithm
- * @return implementation method
- * @throws NoSuchMethodException if implementation method wasn't found
- */
- protected final Method getImplMethod(final Class<?> implClass, final Method
seiMethod) throws NoSuchMethodException
- {
- final String methodName = seiMethod.getName();
- final Class<?>[] paramTypes = seiMethod.getParameterTypes();
-
- return implClass.getMethod(methodName, paramTypes);
- }
-
-}
Deleted:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
-{
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandlerJSE()
- {
- super();
- }
-
- /**
- * Retrieves endpoint implementation bean that will be used in invocation process.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>tries to retrieve endpoint instance from invocation
context,</li>
- * <li>if endpoint instance is not found it's created and instantiated
(lazy initialization)</li>
- * <li>
- * if endpoint instance was created all subclasses will be notified about this
event
- * (using {@link #onEndpointInstantiated(Endpoint, Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint to lookup implementation instance for
- * @param invocation current invocation
- * @return endpoint implementation
- * @throws Exception if any error occurs
- */
- protected final Object getTargetBean(final Endpoint endpoint, final Invocation
invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- Object targetBean = invocationContext.getTargetBean();
-
- if (targetBean == null)
- {
- try
- {
- // create endpoint instance
- final Class<?> endpointImplClass = endpoint.getTargetBeanClass();
- targetBean = endpointImplClass.newInstance();
- invocationContext.setTargetBean(targetBean);
-
- // notify subclasses
- this.onEndpointInstantiated(endpoint, invocation);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot create endpoint instance:
", ex);
- }
- }
-
- return targetBean;
- }
-
- /**
- * Invokes method on endpoint implementation.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>lookups endpoint implementation method to be invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method is going to be
invoked<br/>
- * (using {@link #onBeforeInvocation(Invocation)} template method),
- * </li>
- * <li>endpoint implementation method is invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method invocation was
completed<br/>
- * (using {@link #onAfterInvocation(Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint which method is going to be invoked
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- public final void invoke(final Endpoint endpoint, final Invocation invocation) throws
Exception
- {
- try
- {
- // prepare for invocation
- final Object targetBean = this.getTargetBean(endpoint, invocation);
- final Class<?> implClass = targetBean.getClass();
- final Method seiMethod = invocation.getJavaMethod();
- final Method implMethod = this.getImplMethod(implClass, seiMethod);
- final Object[] args = invocation.getArgs();
-
- // notify subclasses
- this.onBeforeInvocation(invocation);
-
- // invoke implementation method
- final Object retObj = implMethod.invoke(targetBean, args);
-
- // set invocation result
- invocation.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- this.log.error("Method invocation failed with exception: " +
e.getMessage(), e);
- // propagate exception
- this.handleInvocationException(e);
- }
- finally
- {
- // notify subclasses
- this.onAfterInvocation(invocation);
- }
- }
-
- /**
- * Template method for notifying subclasses that endpoint instance have been
instantiated.
- *
- * @param endpoint instantiated endpoint
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation
invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method is going to be
invoked.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method invocation was
completed.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
-}
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -39,6 +39,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -25,14 +25,16 @@
import javax.xml.ws.WebServiceException;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.integration.InvocationContextCallback;
import org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer;
-import org.jboss.wsf.spi.util.KernelLocator;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
/**
* Handles invocations on EJB3 endpoints.
@@ -44,7 +46,7 @@
{
/** MC kernel controller. */
- private final KernelController controller;
+ private final IoCContainerProxy iocContainer;
/** EJB3 container name. */
private String containerName;
@@ -59,7 +61,9 @@
{
super();
- this.controller = KernelLocator.getKernel().getController();
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ this.iocContainer = iocContainerFactory.getContainer();
}
/**
@@ -88,13 +92,11 @@
if (ejb3ContainerNotInitialized)
{
- final ControllerContext context =
this.controller.getInstalledContext(this.containerName);
- if (context == null)
+ this.serviceEndpointContainer = this.iocContainer.getBean(this.containerName,
ServiceEndpointContainer.class);
+ if (this.serviceEndpointContainer == null)
{
throw new WebServiceException("Cannot find service endpoint target:
" + this.containerName);
}
-
- this.serviceEndpointContainer = (ServiceEndpointContainer) context.getTarget();
}
return this.serviceEndpointContainer;
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXRPC;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
import org.jboss.wsf.spi.invocation.InvocationType;
Deleted:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JAXRPC endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXRPC extends AbstractInvocationHandlerJSE
-{
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXRPC()
- {
- super();
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- final ServletEndpointContext sepContext =
invocationContext.getAttachment(ServletEndpointContext.class);
- ((ServiceLifecycle) targetBean).init(sepContext);
- }
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- ((ServiceLifecycle) targetBean).destroy();
- }
- }
-
-}
Deleted:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.common.injection.InjectionHelper;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
-
-/**
- * Handles invocations on JAXWS endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXWS extends AbstractInvocationHandlerJSE
-{
-
- /** WebServiceContext injector. */
- private final ResourceInjector wsContextInjector;
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXWS()
- {
- super();
-
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ResourceInjectorFactory resourceInjectorFactory =
spiProvider.getSPI(ResourceInjectorFactory.class);
- this.wsContextInjector = resourceInjectorFactory.newResourceInjector();
- }
-
- /**
- * Injects resources on target bean and calls post construct method.
- * Finally it registers target bean for predestroy phase.
- *
- * @param endpoint used for predestroy phase registration process
- * @param invocation current invocation
- */
- @Override
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation
invocation)
- {
- final InjectionsMetaData injectionsMD =
endpoint.getAttachment(InjectionsMetaData.class);
- final Object targetBean = this.getTargetBean(invocation);
-
- this.log.debug("Injecting resources on JAXWS JSE endpoint: " +
targetBean);
- InjectionHelper.injectResources(targetBean, injectionsMD);
- this.log.debug("Calling postConstruct method on JAXWS JSE endpoint: " +
targetBean);
- InjectionHelper.callPostConstructMethod(targetBean);
-
- endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
- }
-
- /**
- * Injects webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
- this.wsContextInjector.inject(targetBean, wsContext);
- }
- }
-
- /**
- * Cleanups injected webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
-
- this.wsContextInjector.inject(targetBean, null);
- }
- }
-
- /**
- * Returns WebServiceContext associated with this invocation.
- *
- * @param invocation current invocation
- * @return web service context or null if not available
- */
- private WebServiceContext getWebServiceContext(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getAttachment(WebServiceContext.class);
- }
-
- /**
- * Returns endpoint instance associated with current invocation.
- *
- * @param invocation current invocation
- * @return target bean in invocation
- */
- private Object getTargetBean(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getTargetBean();
- }
-
-}
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB21 endpoints.
*
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB3 endpoints.
*
Added:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyFactoryImpl implements IoCContainerProxyFactory
+{
+
+ /** Container proxy singleton. */
+ private static final IoCContainerProxy CONTAINER =
IoCContainerProxyImpl.getInstance();
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory#getContainer()
+ *
+ * @return IoC container proxy
+ */
+ public IoCContainerProxy getContainer()
+ {
+ return IoCContainerProxyFactoryImpl.CONTAINER;
+ }
+
+}
Added:
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss501/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyImpl implements IoCContainerProxy
+{
+
+ /** Singleton. */
+ private static final IoCContainerProxy SINGLETON = new IoCContainerProxyImpl();
+ /** JBoss MC kernel. */
+ private static Kernel kernel;
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns container proxy instance.
+ *
+ * @return container proxy instance
+ */
+ static IoCContainerProxy getInstance()
+ {
+ return IoCContainerProxyImpl.SINGLETON;
+ }
+
+ /**
+ * Sets JBoss kernel - invoked via MC injection.
+ *
+ * @param kernel JBoss kernel
+ */
+ public void setKernel(final Kernel kernel)
+ {
+ IoCContainerProxyImpl.kernel = kernel;
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy#getBean(java.lang.String,
java.lang.Class)
+ *
+ * @param <T> bean type
+ * @param beanName bean name inside IoC registry
+ * @param clazz bean type class
+ * @return bean instance
+ * @throws IllegalArgumentException if bean is not found
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getBean(final String beanName, final Class<T> clazz)
+ {
+ final KernelController controller = IoCContainerProxyImpl.kernel.getController();
+ final ControllerContext ctx = controller.getInstalledContext(beanName);
+
+ return (T)ctx.getTarget();
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-15
23:00:28 UTC (rev 10919)
@@ -2,14 +2,18 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator"
class="org.jboss.wsf.spi.util.KernelLocator">
+ <!-- Wraps single instance of the kernel -->
+ <bean name="WSIoCContainerProxy"
class="org.jboss.webservices.integration.ioc.IoCContainerProxyImpl">
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
<!-- Locate the single instance of the MBeanServer -->
<bean name="WSMBeanServerLocator"
class="org.jboss.wsf.framework.management.MBeanServerLocator">
- <property name="mbeanServer"><inject bean="JMXKernel"
property="mbeanServer"/></property>
+ <constructor>
+ <parameter>
+ <inject bean="JMXKernel" property="mbeanServer"/>
+ </parameter>
+ </constructor>
</bean>
<!-- Endpoint API http server -->
Added:
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
(rev 0)
+++
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.endpoint.HttpServerFactoryImpl
\ No newline at end of file
Added:
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
(rev 0)
+++
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.ioc.IoCContainerProxyFactoryImpl
\ No newline at end of file
Modified:
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss501/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1 +1 @@
-org.jboss.wsf.framework.management.ServerConfigFactoryImpl
\ No newline at end of file
+org.jboss.webservices.integration.config.ServerConfigFactoryImpl
\ No newline at end of file
Modified: container/jboss50/branches/jbossws-jboss510/pom.xml
===================================================================
--- container/jboss50/branches/jbossws-jboss510/pom.xml 2009-10-15 22:57:15 UTC (rev
10918)
+++ container/jboss50/branches/jbossws-jboss510/pom.xml 2009-10-15 23:00:28 UTC (rev
10919)
@@ -24,8 +24,8 @@
<!-- Properties -->
<properties>
- <jbossws.common.version>1.2.0.GA</jbossws.common.version>
- <jbossws.spi.version>1.2.0.GA</jbossws.spi.version>
+ <jbossws.common.version>1.2.1-SNAPSHOT</jbossws.common.version>
+ <jbossws.spi.version>1.2.1-SNAPSHOT</jbossws.spi.version>
<!--
JBoss component versions taken from
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
(from rev 10872,
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java)
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/config/ServerConfigFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.config;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+
+/**
+ * Retrieves webservices stack specific config from MC kernel.
+ *
+ * @author <a href="mailto:hbraun@redhat.com">Heiko Braun</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class ServerConfigFactoryImpl extends ServerConfigFactory
+{
+
+ /** The bean name in the kernel registry. */
+ private static final String BEAN_NAME = "WSServerConfig";
+
+ /**
+ * Constructor.
+ */
+ public ServerConfigFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns config registered in MC kernel.
+ *
+ * @return config
+ */
+ public ServerConfig getServerConfig()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(ServerConfigFactoryImpl.BEAN_NAME,
ServerConfig.class);
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/EndpointAPIHttpServer.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -81,14 +81,6 @@
}
/**
- * Starts an instance of this HTTP server.
- */
- public void start()
- {
- // Nothing to start, we're running inside JBoss AS
- }
-
- /**
* Creates an requested HTTP context.
*
* @param contextRoot context root name
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
(from rev 10872,
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java)
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/endpoint/HttpServerFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.endpoint;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.http.HttpServer;
+import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * Lookups http server inside MC container.
+ *
+ * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class HttpServerFactoryImpl extends HttpServerFactory
+{
+
+ /** The default bean name. */
+ private static final String BEAN_NAME = "WSHTTPServer";
+
+ /**
+ * Constructor.
+ */
+ public HttpServerFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns http server registered in MC kernel.
+ *
+ * @return http server
+ */
+ @Override
+ public HttpServer getHttpServer()
+ {
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ final IoCContainerProxy iocContainer = iocContainerFactory.getContainer();
+
+ return iocContainer.getBean(HttpServerFactoryImpl.BEAN_NAME, HttpServer.class);
+ }
+
+}
Deleted:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandler.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,87 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-
-/**
- * Base class for all Web Service invocation handlers inside AS.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandler extends InvocationHandler
-{
-
- /** Logger. */
- protected final Logger log = Logger.getLogger(this.getClass());
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandler()
- {
- super();
- }
-
- /**
- * Creates invocation.
- *
- * @return invocation instance
- */
- public final Invocation createInvocation()
- {
- return new Invocation();
- }
-
- /**
- * Initialization method.
- *
- * @param endpoint endpoint
- */
- public void init(final Endpoint endpoint)
- {
- // does nothing
- }
-
- /**
- * Returns implementation method that will be used for invocation.
- *
- * @param implClass implementation endpoint class
- * @param seiMethod SEI interface method used for method finding algorithm
- * @return implementation method
- * @throws NoSuchMethodException if implementation method wasn't found
- */
- protected final Method getImplMethod(final Class<?> implClass, final Method
seiMethod) throws NoSuchMethodException
- {
- final String methodName = seiMethod.getName();
- final Class<?>[] paramTypes = seiMethod.getParameterTypes();
-
- return implClass.getMethod(methodName, paramTypes);
- }
-
-}
Deleted:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/AbstractInvocationHandlerJSE.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import java.lang.reflect.Method;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JSE endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-abstract class AbstractInvocationHandlerJSE extends AbstractInvocationHandler
-{
-
- /**
- * Constructor.
- */
- protected AbstractInvocationHandlerJSE()
- {
- super();
- }
-
- /**
- * Retrieves endpoint implementation bean that will be used in invocation process.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>tries to retrieve endpoint instance from invocation
context,</li>
- * <li>if endpoint instance is not found it's created and instantiated
(lazy initialization)</li>
- * <li>
- * if endpoint instance was created all subclasses will be notified about this
event
- * (using {@link #onEndpointInstantiated(Endpoint, Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint to lookup implementation instance for
- * @param invocation current invocation
- * @return endpoint implementation
- * @throws Exception if any error occurs
- */
- protected final Object getTargetBean(final Endpoint endpoint, final Invocation
invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- Object targetBean = invocationContext.getTargetBean();
-
- if (targetBean == null)
- {
- try
- {
- // create endpoint instance
- final Class<?> endpointImplClass = endpoint.getTargetBeanClass();
- targetBean = endpointImplClass.newInstance();
- invocationContext.setTargetBean(targetBean);
-
- // notify subclasses
- this.onEndpointInstantiated(endpoint, invocation);
- }
- catch (Exception ex)
- {
- throw new IllegalStateException("Cannot create endpoint instance:
", ex);
- }
- }
-
- return targetBean;
- }
-
- /**
- * Invokes method on endpoint implementation.
- *
- * This method does the following steps:
- *
- * <ul>
- * <li>lookups endpoint implementation method to be invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method is going to be
invoked<br/>
- * (using {@link #onBeforeInvocation(Invocation)} template method),
- * </li>
- * <li>endpoint implementation method is invoked,</li>
- * <li>
- * notifies all subclasses about endpoint method invocation was
completed<br/>
- * (using {@link #onAfterInvocation(Invocation)} template method).
- * </li>
- * </ul>
- *
- * @param endpoint which method is going to be invoked
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- public final void invoke(final Endpoint endpoint, final Invocation invocation) throws
Exception
- {
- try
- {
- // prepare for invocation
- final Object targetBean = this.getTargetBean(endpoint, invocation);
- final Class<?> implClass = targetBean.getClass();
- final Method seiMethod = invocation.getJavaMethod();
- final Method implMethod = this.getImplMethod(implClass, seiMethod);
- final Object[] args = invocation.getArgs();
-
- // notify subclasses
- this.onBeforeInvocation(invocation);
-
- // invoke implementation method
- final Object retObj = implMethod.invoke(targetBean, args);
-
- // set invocation result
- invocation.setReturnValue(retObj);
- }
- catch (Exception e)
- {
- this.log.error("Method invocation failed with exception: " +
e.getMessage(), e);
- // propagate exception
- this.handleInvocationException(e);
- }
- finally
- {
- // notify subclasses
- this.onAfterInvocation(invocation);
- }
- }
-
- /**
- * Template method for notifying subclasses that endpoint instance have been
instantiated.
- *
- * @param endpoint instantiated endpoint
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation
invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method is going to be
invoked.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
- /**
- * Template method for notifying subclasses that endpoint method invocation was
completed.
- *
- * @param invocation current invocation
- * @throws Exception subclasses have to throw exception on any failure
- */
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- // does nothing
- }
-
-}
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB21.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -39,6 +39,7 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.common.integration.WSHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Deployment;
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerEJB3.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -25,14 +25,16 @@
import javax.xml.ws.WebServiceException;
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.spi.dependency.KernelController;
import org.jboss.webservices.integration.util.ASHelper;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandler;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.Invocation;
import org.jboss.wsf.spi.invocation.integration.InvocationContextCallback;
import org.jboss.wsf.spi.invocation.integration.ServiceEndpointContainer;
-import org.jboss.wsf.spi.util.KernelLocator;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
/**
* Handles invocations on EJB3 endpoints.
@@ -44,7 +46,7 @@
{
/** MC kernel controller. */
- private final KernelController controller;
+ private final IoCContainerProxy iocContainer;
/** EJB3 container name. */
private String containerName;
@@ -59,7 +61,9 @@
{
super();
- this.controller = KernelLocator.getKernel().getController();
+ final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ final IoCContainerProxyFactory iocContainerFactory =
spiProvider.getSPI(IoCContainerProxyFactory.class);
+ this.iocContainer = iocContainerFactory.getContainer();
}
/**
@@ -88,13 +92,11 @@
if (ejb3ContainerNotInitialized)
{
- final ControllerContext context =
this.controller.getInstalledContext(this.containerName);
- if (context == null)
+ this.serviceEndpointContainer = this.iocContainer.getBean(this.containerName,
ServiceEndpointContainer.class);
+ if (this.serviceEndpointContainer == null)
{
throw new WebServiceException("Cannot find service endpoint target:
" + this.containerName);
}
-
- this.serviceEndpointContainer = (ServiceEndpointContainer) context.getTarget();
}
return this.serviceEndpointContainer;
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXRPC;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
import org.jboss.wsf.spi.invocation.InvocationHandler;
import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
import org.jboss.wsf.spi.invocation.InvocationType;
Deleted:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXRPC.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,90 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.rpc.server.ServiceLifecycle;
-import javax.xml.rpc.server.ServletEndpointContext;
-
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-
-/**
- * Handles invocations on JAXRPC endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXRPC extends AbstractInvocationHandlerJSE
-{
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXRPC()
- {
- super();
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#init(Object)}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- final ServletEndpointContext sepContext =
invocationContext.getAttachment(ServletEndpointContext.class);
- ((ServiceLifecycle) targetBean).init(sepContext);
- }
- }
-
- /**
- * Calls {@link javax.xml.rpc.server.ServiceLifecycle#destroy()}
- * method on target bean if this bean implements
- * {@link javax.xml.rpc.server.ServiceLifecycle} interface.
- *
- * @param invocation current invocation
- * @throws Exception if any error occurs
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation) throws Exception
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
- final Object targetBean = invocationContext.getTargetBean();
- final boolean isJaxrpcLifecycleBean = targetBean instanceof ServiceLifecycle;
-
- if (isJaxrpcLifecycleBean)
- {
- ((ServiceLifecycle) targetBean).destroy();
- }
- }
-
-}
Deleted:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerJAXWS.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,143 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.invocation;
-
-import javax.xml.ws.WebServiceContext;
-
-import org.jboss.wsf.common.injection.InjectionHelper;
-import org.jboss.wsf.common.injection.PreDestroyHolder;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.Invocation;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.ResourceInjector;
-import org.jboss.wsf.spi.invocation.ResourceInjectorFactory;
-import org.jboss.wsf.spi.metadata.injection.InjectionsMetaData;
-
-/**
- * Handles invocations on JAXWS endpoints.
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- * @author <a href="mailto:tdiesler@redhat.com">Thomas Diesler</a>
- */
-final class InvocationHandlerJAXWS extends AbstractInvocationHandlerJSE
-{
-
- /** WebServiceContext injector. */
- private final ResourceInjector wsContextInjector;
-
- /**
- * Constructor.
- */
- InvocationHandlerJAXWS()
- {
- super();
-
- final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- final ResourceInjectorFactory resourceInjectorFactory =
spiProvider.getSPI(ResourceInjectorFactory.class);
- this.wsContextInjector = resourceInjectorFactory.newResourceInjector();
- }
-
- /**
- * Injects resources on target bean and calls post construct method.
- * Finally it registers target bean for predestroy phase.
- *
- * @param endpoint used for predestroy phase registration process
- * @param invocation current invocation
- */
- @Override
- protected void onEndpointInstantiated(final Endpoint endpoint, final Invocation
invocation)
- {
- final InjectionsMetaData injectionsMD =
endpoint.getAttachment(InjectionsMetaData.class);
- final Object targetBean = this.getTargetBean(invocation);
-
- this.log.debug("Injecting resources on JAXWS JSE endpoint: " +
targetBean);
- InjectionHelper.injectResources(targetBean, injectionsMD);
- this.log.debug("Calling postConstruct method on JAXWS JSE endpoint: " +
targetBean);
- InjectionHelper.callPostConstructMethod(targetBean);
-
- endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
- }
-
- /**
- * Injects webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onBeforeInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
- this.wsContextInjector.inject(targetBean, wsContext);
- }
- }
-
- /**
- * Cleanups injected webservice context on target bean.
- *
- * @param invocation current invocation
- */
- @Override
- protected void onAfterInvocation(final Invocation invocation)
- {
- final WebServiceContext wsContext = this.getWebServiceContext(invocation);
-
- if (wsContext != null)
- {
- final Object targetBean = this.getTargetBean(invocation);
-
- this.wsContextInjector.inject(targetBean, null);
- }
- }
-
- /**
- * Returns WebServiceContext associated with this invocation.
- *
- * @param invocation current invocation
- * @return web service context or null if not available
- */
- private WebServiceContext getWebServiceContext(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getAttachment(WebServiceContext.class);
- }
-
- /**
- * Returns endpoint instance associated with current invocation.
- *
- * @param invocation current invocation
- * @return target bean in invocation
- */
- private Object getTargetBean(final Invocation invocation)
- {
- final InvocationContext invocationContext = invocation.getInvocationContext();
-
- return invocationContext.getTargetBean();
- }
-
-}
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB21.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB21 endpoints.
*
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/invocation/InvocationHandlerMDB3.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -21,6 +21,8 @@
*/
package org.jboss.webservices.integration.invocation;
+import org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE;
+
/**
* Handles invocations on MDB EJB3 endpoints.
*
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc
(from rev 10872,
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/ioc)
Deleted:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
===================================================================
---
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2009-10-09
12:44:26 UTC (rev 10872)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.ioc;
-
-import org.jboss.wsf.spi.ioc.IoCContainerProxy;
-import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
-
-/**
- * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class IoCContainerProxyFactoryImpl implements IoCContainerProxyFactory
-{
-
- /** Container proxy singleton. */
- private static final IoCContainerProxy CONTAINER =
IoCContainerProxyImpl.getInstance();
-
- /**
- * Constructor.
- */
- public IoCContainerProxyFactoryImpl()
- {
- super();
- }
-
- /**
- * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory#getContainer()
- *
- * @return IoC container proxy
- */
- public IoCContainerProxy getContainer()
- {
- return IoCContainerProxyFactoryImpl.CONTAINER;
- }
-
-}
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
(from rev 10872,
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java)
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyFactoryImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+import org.jboss.wsf.spi.ioc.IoCContainerProxyFactory;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyFactoryImpl implements IoCContainerProxyFactory
+{
+
+ /** Container proxy singleton. */
+ private static final IoCContainerProxy CONTAINER =
IoCContainerProxyImpl.getInstance();
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyFactoryImpl()
+ {
+ super();
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxyFactory#getContainer()
+ *
+ * @return IoC container proxy
+ */
+ public IoCContainerProxy getContainer()
+ {
+ return IoCContainerProxyFactoryImpl.CONTAINER;
+ }
+
+}
Deleted:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
===================================================================
---
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2009-10-09
12:44:26 UTC (rev 10872)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.webservices.integration.ioc;
-
-import org.jboss.dependency.spi.ControllerContext;
-import org.jboss.kernel.Kernel;
-import org.jboss.kernel.spi.dependency.KernelController;
-import org.jboss.wsf.spi.ioc.IoCContainerProxy;
-
-/**
- * @see org.jboss.wsf.spi.ioc.IoCContainerProxy
- *
- * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
- */
-public final class IoCContainerProxyImpl implements IoCContainerProxy
-{
-
- /** Singleton. */
- private static final IoCContainerProxy SINGLETON = new IoCContainerProxyImpl();
- /** JBoss MC kernel. */
- private static Kernel kernel;
-
- /**
- * Constructor.
- */
- public IoCContainerProxyImpl()
- {
- super();
- }
-
- /**
- * Returns container proxy instance.
- *
- * @return container proxy instance
- */
- static IoCContainerProxy getInstance()
- {
- return IoCContainerProxyImpl.SINGLETON;
- }
-
- /**
- * Sets JBoss kernel - invoked via MC injection.
- *
- * @param kernel JBoss kernel
- */
- public void setKernel(final Kernel kernel)
- {
- IoCContainerProxyImpl.kernel = kernel;
- }
-
- /**
- * @see org.jboss.wsf.spi.ioc.IoCContainerProxy#getBean(java.lang.String,
java.lang.Class)
- *
- * @param <T> bean type
- * @param beanName bean name inside IoC registry
- * @param clazz bean type class
- * @return bean instance
- * @throws IllegalArgumentException if bean is not found
- */
- @SuppressWarnings("unchecked")
- public <T> T getBean(final String beanName, final Class<T> clazz)
- {
- final KernelController controller = IoCContainerProxyImpl.kernel.getController();
- final ControllerContext ctx = controller.getInstalledContext(beanName);
-
- return (T)ctx.getTarget();
- }
-
-}
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
(from rev 10872,
container/jboss50/branches/ropalka/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java)
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510/src/main/java/org/jboss/webservices/integration/ioc/IoCContainerProxyImpl.java 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.webservices.integration.ioc;
+
+import org.jboss.dependency.spi.ControllerContext;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.spi.dependency.KernelController;
+import org.jboss.wsf.spi.ioc.IoCContainerProxy;
+
+/**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+public final class IoCContainerProxyImpl implements IoCContainerProxy
+{
+
+ /** Singleton. */
+ private static final IoCContainerProxy SINGLETON = new IoCContainerProxyImpl();
+ /** JBoss MC kernel. */
+ private static Kernel kernel;
+
+ /**
+ * Constructor.
+ */
+ public IoCContainerProxyImpl()
+ {
+ super();
+ }
+
+ /**
+ * Returns container proxy instance.
+ *
+ * @return container proxy instance
+ */
+ static IoCContainerProxy getInstance()
+ {
+ return IoCContainerProxyImpl.SINGLETON;
+ }
+
+ /**
+ * Sets JBoss kernel - invoked via MC injection.
+ *
+ * @param kernel JBoss kernel
+ */
+ public void setKernel(final Kernel kernel)
+ {
+ IoCContainerProxyImpl.kernel = kernel;
+ }
+
+ /**
+ * @see org.jboss.wsf.spi.ioc.IoCContainerProxy#getBean(java.lang.String,
java.lang.Class)
+ *
+ * @param <T> bean type
+ * @param beanName bean name inside IoC registry
+ * @param clazz bean type class
+ * @return bean instance
+ * @throws IllegalArgumentException if bean is not found
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getBean(final String beanName, final Class<T> clazz)
+ {
+ final KernelController controller = IoCContainerProxyImpl.kernel.getController();
+ final ControllerContext ctx = controller.getInstalledContext(beanName);
+
+ return (T)ctx.getTarget();
+ }
+
+}
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-10-15
23:00:28 UTC (rev 10919)
@@ -2,14 +2,18 @@
<deployment xmlns="urn:jboss:bean-deployer:2.0">
- <!-- Locate the single instance of the kernel -->
- <bean name="WSKernelLocator"
class="org.jboss.wsf.spi.util.KernelLocator">
+ <!-- Wraps single instance of the kernel -->
+ <bean name="WSIoCContainerProxy"
class="org.jboss.webservices.integration.ioc.IoCContainerProxyImpl">
<property name="kernel"><inject
bean="jboss.kernel:service=Kernel"/></property>
</bean>
<!-- Locate the single instance of the MBeanServer -->
<bean name="WSMBeanServerLocator"
class="org.jboss.wsf.framework.management.MBeanServerLocator">
- <property name="mbeanServer"><inject bean="JMXKernel"
property="mbeanServer"/></property>
+ <constructor>
+ <parameter>
+ <inject bean="JMXKernel" property="mbeanServer"/>
+ </parameter>
+ </constructor>
</bean>
<!-- Endpoint API http server -->
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
(from rev 10872,
container/jboss50/branches/ropalka/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory)
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.endpoint.HttpServerFactoryImpl
\ No newline at end of file
Copied:
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
(from rev 10872,
container/jboss50/branches/ropalka/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory)
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory
(rev 0)
+++
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.ioc.IoCContainerProxyFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.ioc.IoCContainerProxyFactoryImpl
\ No newline at end of file
Modified:
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
---
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
22:57:15 UTC (rev 10918)
+++
container/jboss50/branches/jbossws-jboss510/src/main/resources/jbossws-jboss.jar/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory 2009-10-15
23:00:28 UTC (rev 10919)
@@ -1 +1 @@
-org.jboss.wsf.framework.management.ServerConfigFactoryImpl
\ No newline at end of file
+org.jboss.webservices.integration.config.ServerConfigFactoryImpl
\ No newline at end of file