Author: richard.opalka(a)jboss.com
Date: 2009-07-24 05:41:00 -0400 (Fri, 24 Jul 2009)
New Revision: 10379
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
Log:
[JBWS-2332] refactoring + fixing javadocs
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-24
09:37:05 UTC (rev 10378)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/deployers/WSDeploymentDeployer.java 2009-07-24
09:41:00 UTC (rev 10379)
@@ -189,7 +189,7 @@
{
final String servletName = pcmd.getServletLink();
final ServletMetaData servletMD = Helper.getServletForName( webMetaData,
servletName );
- final String servletClass = Helper.getTargetBean( servletMD );
+ final String servletClass = Helper.getEndpointName( servletMD );
this.createEndpoint( servletClass, servletName, dep );
}
@@ -213,7 +213,7 @@
for ( ServletMetaData servlet : servlets )
{
final String servletName = servlet.getName();
- final String servletClass = Helper.getTargetBean( servlet );
+ final String servletClass = Helper.getEndpointName( servlet );
this.createEndpoint( servletClass, servletName, dep );
}
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-24
09:37:05 UTC (rev 10378)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataBuilder.java 2009-07-24
09:41:00 UTC (rev 10379)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, 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.metadata;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.webservices.integration.util.Helper;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
-
-/**
- * Builds container independent deployment meta data.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="ropalka(a)redhat.com">Richard Opalka</a>
- */
-public final class ContainerMetaDataBuilder
-{
-
- /** JSE meta data builder. */
- private JSEMetaDataBuilder jseMetaDataBuilder = new JSEMetaDataBuilder();
- /** EJB3 meta data builder. */
- private EJB3MetaDataBuilder ejb3MetaDataBuilder = new EJB3MetaDataBuilder();
- /** EJB21 meta data builder. */
- private EJB21MetaDataBuilder ejb21MetaDataBuilder = new EJB21MetaDataBuilder();
-
- /**
- * Constructor.
- */
- public ContainerMetaDataBuilder()
- {
- super();
- }
-
- /**
- * Creates container independent meta data and deploys it to <b>dep</b>.
- *
- * @param dep webservice deployment
- * @param unit deployment unit
- */
- public void create( final Deployment dep, final DeploymentUnit unit )
- {
- if ( Helper.isJseDeployment( unit ) )
- {
- final JSEArchiveMetaData jseMetaData = this.jseMetaDataBuilder.create( dep, unit
);
- dep.addAttachment( JSEArchiveMetaData.class, jseMetaData );
- }
- else if ( Helper.isJaxwsEjbDeployment( unit ) )
- {
- final EJBArchiveMetaData ejbMetaData = this.ejb3MetaDataBuilder.create( dep,
unit );
- dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
- }
- else if ( Helper.isJaxrpcEjbDeployment( unit ) )
- {
- final EJBArchiveMetaData ejbMetaData = this.ejb21MetaDataBuilder.create( dep,
unit );
- dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
- }
- }
-
-}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-24
09:37:05 UTC (rev 10378)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/metadata/ContainerMetaDataDeploymentAspect.java 2009-07-24
09:41:00 UTC (rev 10379)
@@ -22,8 +22,11 @@
package org.jboss.webservices.integration.metadata;
import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.webservices.integration.util.Helper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
/**
* An aspect that builds container independent meta data.
@@ -34,8 +37,12 @@
public final class ContainerMetaDataDeploymentAspect extends DeploymentAspect
{
- /** Container independent meta data builder. */
- private ContainerMetaDataBuilder metaDataBuilder;
+ /** JSE meta data builder. */
+ private JSEMetaDataBuilder jseMetaDataBuilder = new JSEMetaDataBuilder();
+ /** EJB3 meta data builder. */
+ private EJB3MetaDataBuilder ejb3MetaDataBuilder = new EJB3MetaDataBuilder();
+ /** EJB21 meta data builder. */
+ private EJB21MetaDataBuilder ejb21MetaDataBuilder = new EJB21MetaDataBuilder();
/**
* Constructor.
@@ -46,16 +53,6 @@
}
/**
- * Sets container independent meta data builder via MC injection.
- *
- * @param builder meta data builder
- */
- public void setMetaDataBuilder( final ContainerMetaDataBuilder builder )
- {
- this.metaDataBuilder = builder;
- }
-
- /**
* Build container independent meta data.
*
* @param dep webservice deployment
@@ -65,7 +62,21 @@
{
final DeploymentUnit unit = dep.getAttachment( DeploymentUnit.class );
- this.metaDataBuilder.create( dep, unit );
+ if ( Helper.isJseDeployment( unit ) )
+ {
+ final JSEArchiveMetaData jseMetaData = this.jseMetaDataBuilder.create( dep, unit
);
+ dep.addAttachment( JSEArchiveMetaData.class, jseMetaData );
+ }
+ else if ( Helper.isJaxwsEjbDeployment( unit ) )
+ {
+ final EJBArchiveMetaData ejbMetaData = this.ejb3MetaDataBuilder.create( dep,
unit );
+ dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
+ }
+ else if ( Helper.isJaxrpcEjbDeployment( unit ) )
+ {
+ final EJBArchiveMetaData ejbMetaData = this.ejb21MetaDataBuilder.create( dep,
unit );
+ dep.addAttachment( EJBArchiveMetaData.class, ejbMetaData );
+ }
}
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java 2009-07-24
09:37:05 UTC (rev 10378)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/webservices/integration/util/Helper.java 2009-07-24
09:41:00 UTC (rev 10379)
@@ -22,7 +22,6 @@
package org.jboss.webservices.integration.util;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -36,8 +35,8 @@
import org.jboss.metadata.web.jboss.JBossServletMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.metadata.web.spec.ServletMetaData;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeclaration;
import org.jboss.wsf.spi.deployment.integration.WebServiceDeployment;
@@ -48,7 +47,7 @@
*/
public final class Helper
{
-
+
/*
* TODO: implement methods
* * getRequiredAttachment( DeploymentUnit unit, Class<?> attachmentType )
@@ -58,9 +57,9 @@
* * getOptionalAttachment( Deployment dep, Class<?> attachmentType )
* both methods will return null if attachment will not be found.
*/
-
+
/** Logger. */
- private static final Logger log = Logger.getLogger( Helper.class );
+ private static final Logger LOG = Logger.getLogger( Helper.class );
/**
* Forbidden constructor.
@@ -69,222 +68,267 @@
{
super();
}
-
+
+ /**
+ * Returns true if unit contains JAXWS JSE, JAXRPC JSE, JAXWS EJB or JAXRPC EJB
deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXWS JSE, JAXRPC JSE, JAXWS EJB or JAXRPC EJB deployment, false
otherwise.
+ */
public static boolean isWebServiceDeployment( final DeploymentUnit unit )
{
return unit.getAttachment( DeploymentType.class ) != null;
}
-
- public static boolean isJseDeployment( final DeploymentUnit unit )
+
+ /**
+ * Returns true if unit contains JAXRPC EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXRPC EJB deployment, false otherwise
+ */
+ public static boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
{
- if ( Helper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class
);
- final boolean isJaxrpcJse = DeploymentType.JAXRPC_JSE.equals( deploymentType );
- final boolean isJaxwsJse = DeploymentType.JAXWS_JSE.equals( deploymentType );
-
- return isJaxwsJse || isJaxrpcJse;
- }
-
- return false;
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+
+ return DeploymentType.JAXRPC_EJB21.equals( deploymentType );
}
-
- public static boolean isEjbDeployment( final DeploymentUnit unit )
+
+ /**
+ * Returns true if unit contains JAXRPC JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXRPC JSE deployment, false otherwise
+ */
+ public static boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
{
- if ( Helper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class
);
- final boolean isJaxwsEjb3 = DeploymentType.JAXWS_EJB3.equals( deploymentType );
- final boolean isJaxrpcEjb21 = DeploymentType.JAXRPC_EJB21.equals( deploymentType
);
-
- return isJaxwsEjb3 || isJaxrpcEjb21;
- }
-
- return false;
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+
+ return DeploymentType.JAXRPC_JSE.equals( deploymentType );
}
-
- public static boolean isJaxwsDeployment( final DeploymentUnit unit )
+
+ /**
+ * Returns true if unit contains JAXWS EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXWS EJB deployment, false otherwise
+ */
+ public static boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
{
- if ( Helper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class
);
- final boolean isJaxwsEjb3 = DeploymentType.JAXWS_EJB3.equals( deploymentType );
- final boolean isJaxwsJse = DeploymentType.JAXWS_JSE.equals( deploymentType );
-
- return isJaxwsEjb3 || isJaxwsJse;
- }
-
- return false;
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+
+ return DeploymentType.JAXWS_EJB3.equals( deploymentType );
}
-
- public static boolean isJaxrpcDeployment( final DeploymentUnit unit )
+
+ /**
+ * Returns true if unit contains JAXWS JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if JAXWS JSE deployment, false otherwise
+ */
+ public static boolean isJaxwsJseDeployment( final DeploymentUnit unit )
{
- if ( Helper.isWebServiceDeployment( unit ) )
- {
- final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class
);
- final boolean isJaxrpcEjb21 = DeploymentType.JAXRPC_EJB21.equals( deploymentType
);
- final boolean isJaxrpcJse = DeploymentType.JAXRPC_JSE.equals( deploymentType );
-
- return isJaxrpcEjb21 || isJaxrpcJse;
- }
-
- return false;
+ final DeploymentType deploymentType = unit.getAttachment( DeploymentType.class );
+
+ return DeploymentType.JAXWS_JSE.equals( deploymentType );
}
-
- public static boolean isJaxrpcJseDeployment( final DeploymentUnit unit )
+
+ /**
+ * Returns true if unit contains either JAXWS JSE or JAXRPC JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXWS JSE or JAXRPC JSE deployment, false otherwise.
+ */
+ public static boolean isJseDeployment( final DeploymentUnit unit )
{
- final boolean isJaxrpc = Helper.isJaxrpcDeployment( unit );
- final boolean isJse = Helper.isJseDeployment( unit );
-
- return isJse && isJaxrpc;
+ final boolean isJaxwsJse = Helper.isJaxwsJseDeployment( unit );
+ final boolean isJaxrpcJse = Helper.isJaxrpcJseDeployment( unit );
+
+ return isJaxwsJse || isJaxrpcJse;
}
- public static boolean isJaxwsJseDeployment( final DeploymentUnit unit )
+ /**
+ * Returns true if unit contains either JAXWS EJB or JAXRPC EJB deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXWS EJB or JAXRPC EJB deployment, false otherwise
+ */
+ public static boolean isEjbDeployment( final DeploymentUnit unit )
{
- final boolean isJaxws = Helper.isJaxwsDeployment( unit );
- final boolean isJse = Helper.isJseDeployment( unit );
-
- return isJse && isJaxws;
+ final boolean isJaxwsEjb = Helper.isJaxwsEjbDeployment( unit );
+ final boolean isJaxrpcEjb = Helper.isJaxrpcEjbDeployment( unit );
+
+ return isJaxwsEjb || isJaxrpcEjb;
}
- public static boolean isJaxrpcEjbDeployment( final DeploymentUnit unit )
+ /**
+ * Returns true if unit contains either JAXWS EJB or JAXWS JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXWS EJB or JAXWS JSE deployment, false otherwise
+ */
+ public static boolean isJaxwsDeployment( final DeploymentUnit unit )
{
- final boolean isJaxrpc = Helper.isJaxrpcDeployment( unit );
- final boolean isEjb = Helper.isEjbDeployment( unit );
-
- return isEjb && isJaxrpc;
+ final boolean isJaxwsEjb = Helper.isJaxwsEjbDeployment( unit );
+ final boolean isJaxwsJse = Helper.isJaxwsJseDeployment( unit );
+
+ return isJaxwsEjb || isJaxwsJse;
}
- public static boolean isJaxwsEjbDeployment( final DeploymentUnit unit )
+ /**
+ * Returns true if unit contains either JAXRPC EJB or JAXRPC JSE deployment.
+ *
+ * @param unit deployment unit
+ * @return true if either JAXRPC EJB or JAXRPC JSE deployment, false otherwise
+ */
+ public static boolean isJaxrpcDeployment( final DeploymentUnit unit )
{
- final boolean isJaxws = Helper.isJaxwsDeployment( unit );
- final boolean isEjb = Helper.isEjbDeployment( unit );
-
- return isEjb && isJaxws;
+ final boolean isJaxrpcEjb = Helper.isJaxrpcEjbDeployment( unit );
+ final boolean isJaxrpcJse = Helper.isJaxrpcJseDeployment( unit );
+
+ return isJaxrpcEjb || isJaxrpcJse;
}
- public static final boolean isWebServiceBean( final WebServiceDeclaration
ejbContainerAdapter )
+ /**
+ * Gets list of JAXWS servlets meta data.
+ *
+ * @param unit deployment unit
+ * @return list of JAXWS servlets meta data
+ */
+ public static List< ServletMetaData > getJaxwsServlets( final DeploymentUnit
unit )
{
- boolean isWebServiceBean = false;
- boolean isWebService = ejbContainerAdapter.getAnnotation(WebService.class) !=
null;
- boolean isWebServiceProvider =
ejbContainerAdapter.getAnnotation(WebServiceProvider.class) != null;
- isWebServiceBean = isWebService || isWebServiceProvider;
+ return Helper.getWebServiceServlets( unit, true );
+ }
- return isWebServiceBean;
+ /**
+ * Gets list of JAXRPC servlets meta data.
+ *
+ * @param unit deployment unit
+ * @return list of JAXRPC servlets meta data
+ */
+ public static List< ServletMetaData > getJaxrpcServlets( final DeploymentUnit
unit )
+ {
+ return Helper.getWebServiceServlets( unit, false );
}
-
- public static final boolean isEjb3Deployment( final DeploymentUnit unit )
+
+ public static boolean isWebServiceBean( final WebServiceDeclaration
ejbContainerAdapter )
{
+ final boolean isWebService = ejbContainerAdapter.getAnnotation( WebService.class )
!= null;
+ final boolean isWebServiceProvider = ejbContainerAdapter.getAnnotation(
WebServiceProvider.class ) != null;
+
+ return isWebService || isWebServiceProvider;
+ }
+
+ // TODO: review why we don't detect WS deployments in WebServiceDeployment
creation process
+ public static boolean isEjb3Deployment( final DeploymentUnit unit )
+ {
final WebServiceDeployment wsDeployment = unit.getAttachment(
WebServiceDeployment.class );
-
- Iterator<WebServiceDeclaration> it =
wsDeployment.getServiceEndpoints().iterator();
- while (it.hasNext())
+
+ final Iterator<WebServiceDeclaration> it =
wsDeployment.getServiceEndpoints().iterator();
+ while ( it.hasNext() )
{
- WebServiceDeclaration container = it.next();
- if (Helper.isWebServiceBean(container))
+ final WebServiceDeclaration container = it.next();
+ if ( Helper.isWebServiceBean( container ) )
{
return true;
}
}
-
+
return false;
}
- public static final List<ServletMetaData> getJaxwsServlets( final DeploymentUnit
unit )
+ /**
+ * Returns endpoint class name.
+ *
+ * @param servletMD servlet meta data
+ * @return endpoint class name
+ */
+ public static String getEndpointName( final ServletMetaData servletMD )
{
- return Helper.getRelevantServlets( unit, true );
+ final String endpointClass = servletMD.getServletClass();
+
+ return endpointClass != null ? endpointClass.trim() : null;
}
- public static List<ServletMetaData> getJaxrpcServlets( final DeploymentUnit unit
)
+ public static ServletMetaData getServletForName( final JBossWebMetaData jbossWebMD,
final String servletName )
{
- return Helper.getRelevantServlets( unit, false );
+ for ( JBossServletMetaData servlet : jbossWebMD.getServlets() )
+ {
+ if ( servlet.getName().equals( servletName ) )
+ {
+ return servlet;
+ }
+ }
+
+ throw new IllegalStateException( "Cannot find servlet for link: " +
servletName );
}
- private static final List< ServletMetaData > getRelevantServlets( final
DeploymentUnit unit, final boolean jaxws )
+ /**
+ * Gets list of JAXRPC or JAXWS servlets meta data.
+ *
+ * @param unit deployment unit
+ * @param jaxws if passed value is <b>true</b> JAXWS servlets list will be
returned, otherwise JAXRPC servlets list
+ * @return either JAXRPC or JAXWS servlets list
+ */
+ private static List< ServletMetaData > getWebServiceServlets( final
DeploymentUnit unit, final boolean jaxws )
{
- try
- {
- final JBossWebMetaData jbossWebMD = unit.getAttachment(JBossWebMetaData.class);
+ final JBossWebMetaData jbossWebMD = unit.getAttachment( JBossWebMetaData.class );
final ClassLoader loader = unit.getClassLoader();
-
- List<ServletMetaData> endpoints = new ArrayList<ServletMetaData>();
- for (ServletMetaData servlet : jbossWebMD.getServlets())
+ final List< ServletMetaData > endpoints = new ArrayList< ServletMetaData
>();
+
+ for ( ServletMetaData servletMD : jbossWebMD.getServlets() )
{
- String servletClassName = getTargetBean(servlet);
+ final Class< ? > endpointClass = Helper.getEndpointClass( servletMD,
loader );
- // Skip JSPs
- if (servletClassName == null || servletClassName.length() == 0)
- continue;
+ if ( endpointClass != null )
+ {
+ // check webservice annotations
+ final boolean isWebService = endpointClass.isAnnotationPresent(
WebService.class );
+ final boolean isWebServiceProvider = endpointClass.isAnnotationPresent(
WebServiceProvider.class );
+ // detect webservice type
+ final boolean isJaxwsEndpoint = jaxws && ( isWebService ||
isWebServiceProvider );
+ final boolean isJaxrpcEndpoint = !jaxws && ( !isWebService &&
!isWebServiceProvider );
- try
- {
- Class<?> servletClass = loader.loadClass(servletClassName.trim());
- boolean isServlet = servletClass.isAssignableFrom(Servlet.class);
- if (false == isServlet)
+ if ( isJaxwsEndpoint || isJaxrpcEndpoint )
{
- boolean isWebService =
servletClass.isAnnotationPresent(WebService.class);
- boolean isWebServiceProvider =
servletClass.isAnnotationPresent(WebServiceProvider.class);
- if ( jaxws )
- {
- if (isWebService || isWebServiceProvider)
- {
- endpoints.add(servlet); // jaxws endpoint
- }
- }
- else
- {
- if (!isWebService && !isWebServiceProvider)
- {
- endpoints.add(servlet); // jaxrpc endpoint
- }
- }
+ endpoints.add( servletMD );
}
}
- catch (ClassNotFoundException ex)
- {
- log.warn("Cannot load servlet class: " + servletClassName);
- continue;
- }
}
-
+
return endpoints;
- }
- catch (Exception ex)
- {
- log.error("Cannot process web deployment", ex);
- return Collections.emptyList();
- }
}
- public static String getTargetBean(ServletMetaData servlet)
+ /**
+ * Returns webservice endpoint class or null if passed servlet meta data belong to
either JSP or servlet instance.
+ *
+ * @param servletMD servlet meta data
+ * @param loader class loader
+ * @return webservice endpoint class or null
+ */
+ private static Class< ? > getEndpointClass( final ServletMetaData servletMD,
final ClassLoader loader )
{
- String endpointClass = servlet.getServletClass();
- List<ParamValueMetaData> initParams = servlet.getInitParam();
- if (initParams != null)
+ final String endpointClassName = Helper.getEndpointName( servletMD );
+ final boolean notJSP = endpointClassName != null &&
endpointClassName.length() > 0;
+
+ if ( notJSP )
{
- for (ParamValueMetaData param : initParams)
+ try
{
- if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(param.getParamName()))
+ final Class< ? > endpointClass = loader.loadClass( endpointClassName
);
+ final boolean notServlet = !endpointClass.isAssignableFrom( Servlet.class );
+
+ if ( notServlet )
{
- endpointClass = param.getParamValue();
- break;
+ return endpointClass;
}
}
- }
- return endpointClass;
- }
-
- public static ServletMetaData getServletForName( final JBossWebMetaData jbossWebMD,
final String servletName )
- {
- for ( JBossServletMetaData servlet : jbossWebMD.getServlets() )
- {
- if ( servlet.getName().equals( servletName ) )
+ catch ( ClassNotFoundException cnfe )
{
- return servlet;
+ Helper.LOG.warn( "Cannot load servlet class: " + endpointClassName,
cnfe );
}
}
-
- throw new IllegalStateException( "Cannot find servlet for link: " +
servletName );
+
+ return null;
}
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-24
09:37:05 UTC (rev 10378)
+++
container/jboss50/branches/ropalka-jboss510/src/main/resources/jbossws-jboss50.deployer/META-INF/stack-agnostic-jboss-beans.xml 2009-07-24
09:41:00 UTC (rev 10379)
@@ -67,12 +67,10 @@
<bean name="WSSecurityHandlerEJB21"
class="org.jboss.webservices.integration.tomcat.ejb.SecurityHandlerEJB21"/>
<bean name="WSSecurityHandlerEJB3"
class="org.jboss.webservices.integration.tomcat.ejb.SecurityHandlerEJB3"/>
<bean name="WSWebMetaDataModifier"
class="org.jboss.webservices.integration.tomcat.jse.WebMetaDataModifierImpl"/>
- <bean name="WSContainerMetaDataBuilder"
class="org.jboss.webservices.integration.metadata.ContainerMetaDataBuilder"/>
<!-- The AS specific deployment aspects -->
<bean name="WSContainerMetaDataDeploymentAspect"
class="org.jboss.webservices.integration.metadata.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData,
VFSRoot</property>
- <property name="metaDataBuilder"><inject
bean="WSContainerMetaDataBuilder"/></property>
<property name="relativeOrder">12</property> <!--
[JBDEPLOY-201] workaround -->
</bean>