You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2007/06/26 17:19:36 UTC
svn commit: r550827 - in
/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2:
./ pojo/
Author: gawor
Date: Tue Jun 26 08:19:34 2007
New Revision: 550827
URL: http://svn.apache.org/viewvc?view=rev&rev=550827
Log:
install our own HandlerLifecycleManager
Added:
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManager.java (with props)
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManagerFactory.java (with props)
Modified:
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java?view=diff&rev=550827&r1=550826&r2=550827
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/Axis2WebServiceContainer.java Tue Jun 26 08:19:34 2007
@@ -50,6 +50,8 @@
import org.apache.axis2.jaxws.description.xml.handler.HandlerChainType;
import org.apache.axis2.jaxws.description.xml.handler.HandlerChainsType;
import org.apache.axis2.jaxws.description.xml.handler.HandlerType;
+import org.apache.axis2.jaxws.handler.lifecycle.factory.HandlerLifecycleManagerFactory;
+import org.apache.axis2.jaxws.registry.FactoryRegistry;
import org.apache.axis2.jaxws.server.JAXWSMessageReceiver;
import org.apache.axis2.transport.OutTransportInfo;
import org.apache.axis2.transport.RequestResponseTransport;
@@ -131,6 +133,17 @@
configurationContext.getAxisConfiguration().addService(service);
this.wsdlQueryHandler = new WSDLQueryHandler(this.service);
+
+ /*
+ * This replaces HandlerLifecycleManagerFactory for all web services.
+ * This should be ok as we do our own handler instance managment and injection.
+ * Also, this does not affect service-ref clients, as we install our own
+ * HandlerResolver.
+ */
+ /*
+ FactoryRegistry.setFactory(HandlerLifecycleManagerFactory.class,
+ new GeronimoHandlerLifecycleManagerFactory());
+ */
}
protected AxisServiceGenerator createServiceGenerator() {
Added: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManager.java?view=auto&rev=550827
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManager.java (added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManager.java Tue Jun 26 08:19:34 2007
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.axis2;
+
+import javax.xml.ws.handler.Handler;
+
+import org.apache.axis2.jaxws.core.MessageContext;
+import org.apache.axis2.jaxws.handler.lifecycle.factory.HandlerLifecycleManager;
+import org.apache.axis2.jaxws.injection.ResourceInjectionException;
+import org.apache.axis2.jaxws.lifecycle.LifecycleException;
+
+public class GeronimoHandlerLifecycleManager implements HandlerLifecycleManager {
+
+ public Handler createHandlerInstance(MessageContext context, Class handlerClass)
+ throws LifecycleException, ResourceInjectionException {
+
+ Handler instance = null;
+
+ try {
+ instance = (Handler) handlerClass.newInstance();
+ } catch (Exception e) {
+ throw new LifecycleException("Failed to create handler", e);
+ }
+
+ return instance;
+ }
+
+ public void invokePostConstruct() throws LifecycleException {
+ }
+
+ public void invokePreDestroy() throws LifecycleException {
+ }
+
+}
Propchange: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManagerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManagerFactory.java?view=auto&rev=550827
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManagerFactory.java (added)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManagerFactory.java Tue Jun 26 08:19:34 2007
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.geronimo.axis2;
+
+import org.apache.axis2.jaxws.handler.lifecycle.factory.HandlerLifecycleManager;
+import org.apache.axis2.jaxws.handler.lifecycle.factory.HandlerLifecycleManagerFactory;
+
+public class GeronimoHandlerLifecycleManagerFactory extends HandlerLifecycleManagerFactory {
+
+ private GeronimoHandlerLifecycleManager lifecycleManager;
+
+ public GeronimoHandlerLifecycleManagerFactory() {
+ this.lifecycleManager = new GeronimoHandlerLifecycleManager();
+ }
+
+ @Override
+ public HandlerLifecycleManager createHandlerLifecycleManager() {
+ return this.lifecycleManager;
+ }
+
+}
Propchange: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/GeronimoHandlerLifecycleManagerFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java?view=diff&rev=550827&r1=550826&r2=550827
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/pojo/POJOWebServiceContainer.java Tue Jun 26 08:19:34 2007
@@ -60,7 +60,10 @@
public void init() throws Exception {
super.init();
- // XXX: This is a global operation
+ /*
+ * This replaces EndpointLifecycleManagerFactory for all web services.
+ * This should be ok as we do our own endpoint instance management and injection.
+ */
FactoryRegistry.setFactory(EndpointLifecycleManagerFactory.class,
new POJOEndpointLifecycleManagerFactory());