Author: richard.opalka(a)jboss.com
Date: 2009-07-02 07:22:52 -0400 (Thu, 02 Jul 2009)
New Revision: 10290
Removed:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/RewriteResults.java
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifier.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifierImpl.java
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppDeploymentAspect.java
Log:
[JBWS-2332][JBWS-2382] refactoring (WIP)
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java 2009-07-02
09:56:53 UTC (rev 10289)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java 2009-07-02
11:22:52 UTC (rev 10290)
@@ -46,10 +46,10 @@
import org.jboss.metadata.javaee.spec.ResourceInjectionTargetMetaData;
import org.jboss.metadata.web.jboss.JBossWebMetaData;
import org.jboss.wsf.common.injection.resolvers.ResourceReferenceResolver;
+import org.jboss.wsf.container.jboss50.ASIntegrationHelper;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
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;
import org.jboss.wsf.spi.metadata.injection.InjectionMetaData;
@@ -83,11 +83,11 @@
List<InjectionMetaData> injectionMD = new
LinkedList<InjectionMetaData>();
Map<Class<? extends Annotation>, ReferenceResolver> resolvers =
createResolvers(unit);
- DeploymentType deploymentType = dep.getType();
try
{
- if (deploymentType == DeploymentType.JAXWS_JSE)
+
+ if ( ASIntegrationHelper.isJaxwsPojoDeployment( unit ) )
{
injectionMD.addAll(buildInjectionMetaData(webMD.getEnvironmentEntries()));
for (Endpoint endpoint : dep.getService().getEndpoints())
@@ -96,7 +96,7 @@
endpoint.addAttachment(InjectionsMetaData.class, injectionsMD);
}
}
- else if (deploymentType == DeploymentType.JAXWS_EJB3)
+ else if ( ASIntegrationHelper.isJaxwsEjbDeployment( unit ) )
{
JBossMetaData jbossMD = unit.getAttachment(JBossMetaData.class);
JBossEnterpriseBeansMetaData jebMDs = jbossMD.getEnterpriseBeans();
Deleted:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/RewriteResults.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/RewriteResults.java 2009-07-02
09:56:53 UTC (rev 10289)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/RewriteResults.java 2009-07-02
11:22:52 UTC (rev 10290)
@@ -1,38 +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.wsf.container.jboss50.deployment.tomcat;
-
-import java.net.URL;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author Heiko.Braun(a)jboss.com
- * Created: Jul 19, 2007
- */
-public class RewriteResults
-{
- // The URL to the rewritten web.xml
- public URL webXML;
- // Maps the servlet name to the target bean
- public Map<String, String> sepTargetMap = new HashMap<String, String>();
-}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifier.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifier.java 2009-07-02
09:56:53 UTC (rev 10289)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifier.java 2009-07-02
11:22:52 UTC (rev 10290)
@@ -27,15 +27,13 @@
* Modifies the web app according to the stack requirements.
*
* @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2007
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public interface WebMetaDataModifier
{
- final static String PROPERTY_GENERATED_WEBAPP =
"org.jboss.ws.generated.webapp";
- final static String PROPERTY_WEBAPP_CONTEXT_PARAMETERS =
"org.jboss.ws.webapp.ContextParameterMap";
- final static String PROPERTY_WEBAPP_SERVLET_CLASS =
"org.jboss.ws.webapp.ServletClass";
- final static String PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER =
"org.jboss.ws.webapp.ServletContextListener";
- final static String PROPERTY_WEBAPP_URL = "org.jboss.ws.webapp.url";
+ static String PROPERTY_WEBAPP_CONTEXT_PARAMETERS =
"org.jboss.ws.webapp.ContextParameterMap";
+ static String PROPERTY_WEBAPP_SERVLET_CLASS =
"org.jboss.ws.webapp.ServletClass";
+ static String PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER =
"org.jboss.ws.webapp.ServletContextListener";
- RewriteResults modifyMetaData(Deployment dep) throws ClassNotFoundException;
+ void modifyMetaData( Deployment dep ) throws ClassNotFoundException;
}
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifierImpl.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifierImpl.java 2009-07-02
09:56:53 UTC (rev 10289)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/deployment/tomcat/WebMetaDataModifierImpl.java 2009-07-02
11:22:52 UTC (rev 10290)
@@ -39,14 +39,14 @@
* The rewriter for web.xml
*
* @author Thomas.Diesler(a)jboss.org
- * @since 19-May-2007
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class WebMetaDataModifierImpl implements WebMetaDataModifier
{
// logging support
private static Logger log = Logger.getLogger(WebMetaDataModifierImpl.class);
- public RewriteResults modifyMetaData(Deployment dep)
+ public void modifyMetaData(Deployment dep)
{
JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
if (jbwmd == null)
@@ -54,8 +54,7 @@
try
{
- RewriteResults results = modifyMetaData(dep, jbwmd);
- return results;
+ modifyMetaData(dep, jbwmd);
}
catch (RuntimeException rte)
{
@@ -67,10 +66,8 @@
}
}
- private RewriteResults modifyMetaData(Deployment dep, JBossWebMetaData jbwmd) throws
ClassNotFoundException
+ private void modifyMetaData(Deployment dep, JBossWebMetaData jbwmd) throws
ClassNotFoundException
{
- RewriteResults results = new RewriteResults();
-
String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
if (servletClass == null)
throw new IllegalStateException("Cannot obtain context property: " +
PROPERTY_WEBAPP_SERVLET_CLASS);
@@ -161,14 +158,6 @@
log.info("Ignore servlet: " + orgServletClassName);
continue;
}
- /*
- Legacy code: This shouldn't be used in recent AS 5 versions
-
- else if (orgServletClassName.endsWith("Servlet"))
- {
- log.info("Ignore <servlet-class> that ends with
'Servlet': " + orgServletClassName);
- continue;
- }*/
servlet.setServletClass(servletClass);
@@ -185,12 +174,7 @@
if (targetBeanName == null)
throw new IllegalStateException("Cannot obtain service endpoint bean
for: " + linkName);
-
- // remember the target bean name
- results.sepTargetMap.put(linkName, targetBeanName);
}
-
- return results;
}
// Return true if the web.xml is already modified
Modified:
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppDeploymentAspect.java
===================================================================
---
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppDeploymentAspect.java 2009-07-02
09:56:53 UTC (rev 10289)
+++
container/jboss50/branches/ropalka-jboss510/src/main/java/org/jboss/wsf/container/jboss50/transport/WebAppDeploymentAspect.java 2009-07-02
11:22:52 UTC (rev 10290)
@@ -72,7 +72,6 @@
// Attaching it to the DeploymentUnit will cause a new webapp deployment
unit.addAttachment(JBossWebMetaData.class, jbwmd);
- unit.addAttachment(WebMetaDataModifier.PROPERTY_GENERATED_WEBAPP,
Boolean.TRUE);
}
catch (Exception ex)
{