Author: alessio.soldano(a)jboss.com
Date: 2010-04-07 10:00:57 -0400 (Wed, 07 Apr 2010)
New Revision: 11956
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
Log:
[JBWS-2974] Removing support for lazy load of bus
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-04-07
13:59:41 UTC (rev 11955)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/CXFServletExt.java 2010-04-07
14:00:57 UTC (rev 11956)
@@ -23,7 +23,6 @@
import java.io.IOException;
import java.lang.reflect.Method;
-import java.net.URL;
import javax.management.ObjectName;
import javax.servlet.ServletConfig;
@@ -38,27 +37,20 @@
import org.apache.cxf.management.InstrumentationManager;
import org.apache.cxf.management.counters.CounterRepository;
import org.apache.cxf.resource.ResourceManager;
-import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.transport.servlet.CXFServlet;
import org.apache.cxf.transport.servlet.ServletContextResourceResolver;
import org.apache.cxf.transport.servlet.ServletController;
import org.apache.cxf.transport.servlet.ServletTransportFactory;
-import org.jboss.logging.Logger;
-import org.jboss.ws.Constants;
import org.jboss.wsf.common.ObjectNameFactory;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.binding.BindingCustomization;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointRegistry;
import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.wsf.stack.cxf.client.configuration.JBossWSCXFConfigurer;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.management.InstrumentationManagerExtImpl;
-import org.jboss.wsf.stack.cxf.transport.SoapTransportFactoryExt;
-import org.springframework.context.ApplicationContext;
/**
* An extension to the CXF servlet
@@ -68,20 +60,12 @@
*/
public class CXFServletExt extends CXFServlet
{
- private static final Logger log = Logger.getLogger(CXFServletExt.class);
public static final String ENABLE_CXF_MANAGEMENT = "enable.cxf.management";
protected Endpoint endpoint;
protected EndpointRegistry epRegistry;
- protected BusHolder lazyLoadedBusHolder;
@Override
- public void init(ServletConfig servletConfig) throws ServletException
- {
- super.init(servletConfig);
- }
-
- @Override
public ServletController createServletController(ServletConfig servletConfig)
{
ServletTransportFactory stf =
(ServletTransportFactory)createServletTransportFactory();
@@ -95,16 +79,8 @@
initEndpoint(servletConfig);
ServletContext svCtx = getServletContext();
- if (isBusLoadRequired(svCtx))
- {
- //reload bus using CXF servlet
- lazyLoadBus(servletConfig);
- }
- else
- {
- //keep the bus created during deployment and update it with the information
coming from the servlet config
- updateAvailableBusWithServletInfo(servletConfig);
- }
+ //keep the bus created during deployment and update it with the information coming
from the servlet config
+ updateAvailableBusWithServletInfo(servletConfig);
//register the InstrumentManagementImpl
//TODO!! remove reflection use inside this by providing proper hook in CXF and move
this configuration to BusHolder
@@ -113,37 +89,6 @@
}
}
- private static boolean isBusLoadRequired(ServletContext svCtx)
- {
- boolean result = Constants.LAZY_LOAD_CXF_BUS;
- result = result || (ApplicationContext)svCtx.getAttribute("interface
org.springframework.web.context.WebApplicationContext.ROOT") != null;
- result = result ||
(ApplicationContext)svCtx.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT")
!= null;
- return result;
- }
-
- private void lazyLoadBus(ServletConfig servletConfig) throws ServletException
- {
- log.debug("Loading Bus through CXF servlet...");
- super.loadBus(servletConfig);
- //set the controller in the servlet context now that the bus has been configured in
the servlet
- servletConfig.getServletContext().setAttribute(ServletController.class.getName(),
getController());
- //recreate holder from the new bus
- lazyLoadedBusHolder = BusHolder.create(getBus());
- //configure bus for jbossws use
- String jbossCxfXml =
servletConfig.getServletContext().getInitParameter(BusHolder.PARAM_CXF_BEANS_URL);
- try
- {
- ResourceResolver resolver = endpoint.getAttachment(ResourceResolver.class);
- BindingCustomization customizations =
endpoint.getAttachment(BindingCustomization.class);
- JBossWSCXFConfigurer configurer =
lazyLoadedBusHolder.createConfigurer(customizations, null);
- lazyLoadedBusHolder.configure(new URL(jbossCxfXml), new
SoapTransportFactoryExt(), resolver, configurer);
- }
- catch (IOException e)
- {
- throw new ServletException("Error while configuring bus for JBossWS
use", e);
- }
- }
-
private void updateAvailableBusWithServletInfo(ServletConfig servletConfig)
{
BusHolder holder = endpoint.getAttachment(BusHolder.class);
@@ -221,16 +166,6 @@
return endpoint;
}
- @Override
- public void destroy()
- {
- if (lazyLoadedBusHolder != null)
- {
- lazyLoadedBusHolder.close();
- }
- super.destroy();
- }
-
private void registerInstrumentManger(Bus bus) throws ServletException
{
InstrumentationManagerExtImpl instrumentationManagerImpl = new
InstrumentationManagerExtImpl();
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2010-04-07
13:59:41 UTC (rev 11955)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2010-04-07
14:00:57 UTC (rev 11956)
@@ -31,7 +31,6 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.cxf.transport.servlet.ServletController;
-import org.jboss.logging.Logger;
import org.jboss.util.NotImplementedException;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.InvocationContext;
@@ -45,9 +44,6 @@
*/
public class RequestHandlerImpl implements RequestHandler
{
- // provide logging
- private static final Logger log = Logger.getLogger(RequestHandlerImpl.class);
-
RequestHandlerImpl()
{
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-04-07
13:59:41 UTC (rev 11955)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2010-04-07
14:00:57 UTC (rev 11956)
@@ -26,7 +26,6 @@
import java.util.Map;
import org.apache.cxf.BusFactory;
-import org.jboss.ws.Constants;
import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.common.integration.WSConstants;
import org.jboss.wsf.spi.binding.BindingCustomization;
@@ -52,10 +51,6 @@
@Override
public void start(Deployment dep)
{
- if (Constants.LAZY_LOAD_CXF_BUS)
- return;
-
- log.debug("Lazy load of CXF bus disabled, loading bus during
deployment...");
BusHolder holder;
ClassLoader origClassLoader = SecurityActions.getContextClassLoader();
try
Show replies by date