Author: heiko.braun(a)jboss.com
Date: 2007-10-22 14:47:55 -0400 (Mon, 22 Oct 2007)
New Revision: 4858
Added:
stack/metro/branches/hbraun/metro_b_hbraun.iml
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/RuntimeModelDeploymentAspect.java
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/VFSResourceLoader.java
Modified:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/WSServletContextListenerExt.java
stack/metro/branches/hbraun/src/main/resources/jbossws-sunri-config.xml
Log:
Refactoring first cut
Added: stack/metro/branches/hbraun/metro_b_hbraun.iml
===================================================================
--- stack/metro/branches/hbraun/metro_b_hbraun.iml (rev 0)
+++ stack/metro/branches/hbraun/metro_b_hbraun.iml 2007-10-22 18:47:55 UTC (rev 4858)
@@ -0,0 +1,295 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true"
type="JAVA_MODULE">
+ <component name="ModuleRootManager" />
+ <component name="NewModuleRootManager"
inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/main/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/test-framework/java"
isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/sun-rt_sources"
isTestSource="false" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-common.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-logging-spi.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/servlet-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-spi.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/thirdparty/jboss-common-core-sources.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-javaee.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/thirdparty/jbossws-framework-scripts.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jsr181-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/saaj-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jboss-common-core.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/streambuffer.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root
url="jar://$MODULE_DIR$/thirdparty/jbossws-jboss42-resources.zip!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/FastInfoset.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/resolver.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxrpc-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/saaj-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/stax-ex.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/http.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxb-impl.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/wstx.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/sjsxp.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxws-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxb-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxws-tools.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxws-ri-src.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jsr250-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxws-rt.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jsr173_api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/wsdl4j.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jaxb-xjc.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/thirdparty/jbossws-framework.jar!/"
/>
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntryProperties />
+ </component>
+</module>
+
Modified:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java
===================================================================
---
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java 2007-10-22
14:38:44 UTC (rev 4857)
+++
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/RequestHandlerImpl.java 2007-10-22
18:47:55 UTC (rev 4858)
@@ -23,27 +23,27 @@
//$Id$
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
+import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
+import com.sun.xml.ws.util.exception.JAXWSExceptionBase;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.invocation.InvocationContext;
+import org.jboss.wsf.spi.invocation.RequestHandler;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.logging.Level;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.invocation.InvocationContext;
-import org.jboss.wsf.spi.invocation.RequestHandler;
-
-import com.sun.xml.ws.transport.http.servlet.WSServlet;
-import com.sun.xml.ws.transport.http.servlet.WSServletDelegate;
-
/**
* A request handler
- *
+ *
* @author Thomas.Diesler(a)jboss.org
* @since 25-Apr-2007
*/
@@ -52,39 +52,91 @@
// provide logging
private static final Logger log = Logger.getLogger(RequestHandlerImpl.class);
+ // TODO: unify logging
+ private static final java.util.logging.Logger logger =
+ java.util.logging.Logger.getLogger( com.sun.xml.ws.util.Constants.LoggingDomain +
".jboss.requestHandler");
+
RequestHandlerImpl()
{
}
public void handleHttpRequest(Endpoint endpoint, HttpServletRequest req,
HttpServletResponse res, ServletContext context) throws ServletException, IOException
{
- WSServletDelegate delegate =
(WSServletDelegate)context.getAttribute(WSServlet.JAXWS_RI_RUNTIME_INFO);
- if (delegate == null)
- throw new IllegalStateException("Cannot obtain servlet delegate");
-
+ ServletAdapter target = endpoint.getAttachment(ServletAdapter.class);
+ if(null == target)
+ throw new IllegalArgumentException("Cannot obtain ServletAdapter");
+
String method = req.getMethod();
if (method.equals("POST"))
{
- delegate.doPost(req, res, context);
+ doPost(target, context, req, res);
}
- else if (method.equals("GET"))
+ else if(method.equals("GET"))
{
- delegate.doGet(req, res, context);
+ doGet(target, req, context, res);
}
- else if (method.equals("PUT"))
+ else
{
- delegate.doPut(req, res, context);
+ throw new WebServiceException("Unsupported method: " + method);
}
- else if (method.equals("DELETE"))
+ }
+
+ private void doGet(ServletAdapter target, HttpServletRequest req, ServletContext
context, HttpServletResponse res)
+ throws ServletException
+ {
+ try {
+
+ if (target != null)
+ {
+ String query = req.getQueryString();
+ if (target.isMetadataQuery(query)) {
+ // Sends published WSDL and schema documents
+ target.publishWSDL(context, req, res);
+ return;
+ }
+ else
+ {
+ res.setStatus(405);
+ res.setContentType("text/plain");
+ Writer out = res.getWriter();
+ out.write("HTTP GET not supported");
+ out.close();
+ }
+ }
+ else
+ {
+ res.setStatus(404);
+ res.setContentType("text/plain");
+ Writer out = res.getWriter();
+ out.write("Not found");
+ out.close();
+ }
+ } catch (Exception e) {
+ logger.log(Level.SEVERE, e.getMessage(), e);
+ throw new ServletException(e.getMessage());
+ }
+ }
+
+ private void doPost(ServletAdapter target, ServletContext context, HttpServletRequest
req, HttpServletResponse res)
+ {
+ try
{
- delegate.doDelete(req, res, context);
+ target.handle(context, req, res);
}
- else
+ catch (JAXWSExceptionBase e)
{
- throw new WebServiceException("Unsupported method: " + method);
+ logger.log(Level.SEVERE, e.getMessage());
+ res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
+ catch (Throwable e)
+ {
+ logger.log(Level.SEVERE, "caught throwable", e);
+ res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
}
+
+
public void handleRequest(Endpoint endpoint, InputStream inStream, OutputStream
outStream, InvocationContext context)
{
throw new IllegalArgumentException("Not implemented");
Modified:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/WSServletContextListenerExt.java
===================================================================
---
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/WSServletContextListenerExt.java 2007-10-22
14:38:44 UTC (rev 4857)
+++
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/WSServletContextListenerExt.java 2007-10-22
18:47:55 UTC (rev 4858)
@@ -47,7 +47,7 @@
/**
* A copy of WSServletContextListener that externalizes
*
- * getDeploymentDescriptorURL()
+ * getDDUrlFromResourceLoader()
* createDeploymentDescriptorParser()
*
* @author WS Development Team
Added:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/RuntimeModelDeploymentAspect.java
===================================================================
---
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/RuntimeModelDeploymentAspect.java
(rev 0)
+++
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/RuntimeModelDeploymentAspect.java 2007-10-22
18:47:55 UTC (rev 4858)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.stack.sunri.metadata;
+
+import com.sun.istack.NotNull;
+import com.sun.xml.ws.api.server.BoundEndpoint;
+import com.sun.xml.ws.api.server.Container;
+import com.sun.xml.ws.api.server.Module;
+import com.sun.xml.ws.api.server.ResourceInjector;
+import com.sun.xml.ws.resources.WsservletMessages;
+import com.sun.xml.ws.transport.http.DeploymentDescriptorParser;
+import com.sun.xml.ws.transport.http.ResourceLoader;
+import com.sun.xml.ws.transport.http.servlet.ServletAdapter;
+import com.sun.xml.ws.transport.http.servlet.ServletAdapterList;
+import org.jboss.wsf.common.ResourceLoaderAdapter;
+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.UnifiedVirtualFile;
+import org.jboss.wsf.stack.sunri.DeploymentDescriptorParserExt;
+import org.jboss.wsf.stack.sunri.WSServletContextListenerJBWS;
+
+import javax.xml.ws.WebServiceException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.HashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Creates a METRO runtime model and associates it with the deployment.
+ *
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class RuntimeModelDeploymentAspect extends DeploymentAspect
+{
+
+ protected static final String JAXWS_RI_RUNTIME = "/WEB-INF/sun-jaxws.xml";
+
+ private static final Logger logger =
Logger.getLogger(com.sun.xml.ws.util.Constants.LoggingDomain +
".jboss.metadata");
+
+ public void create(Deployment deployment)
+ {
+ ClassLoader runtimeLoader = deployment.getRuntimeClassLoader();
+ if(null == runtimeLoader)
+ throw new IllegalArgumentException("Null runtimeLoader");
+
+ JBossWSContainer container = new JBossWSContainer();
+ try
+ {
+ ResourceLoaderAdapter resourceLoaderAdapter = new
ResourceLoaderAdapter(runtimeLoader);
+ ResourceLoader resourceLoader = new VFSResourceLoader(resourceLoaderAdapter);
+
+ // TODO: refactor to general HTTPAdapter usage
+ ServletAdapterList adapterList = new ServletAdapterList();
+
+ // Parse the descriptor file and build endpoint infos
+ DeploymentDescriptorParserExt<ServletAdapter> parser =
+ createDeploymentDescriptorParser(runtimeLoader, container, resourceLoader,
adapterList);
+
+ //URL sunJaxWsXml = getDDUrlFromResourceLoader(resourceLoaderAdapter);
+ URL sunJaxWsXml = getDDUrlFromContext(deployment);
+
+ List<ServletAdapter> adapters = parser.parse(sunJaxWsXml.toExternalForm(),
sunJaxWsXml.openStream());
+
+ // Created on the fly in SunJaxwsDeploymentAspect
+ //DDEndpoints dd = deployment.getAttachment(DDEndpoints.class);
+
+ // TODO: the whole matching can be skipped when we use the DD model directly
+ // See SunJaxwsDeploymentAspect -> dep.addAttachment(DDEndpoints.class,
dd);
+ for(ServletAdapter adapter : adapters)
+ {
+ for(Endpoint ep : deployment.getService().getEndpoints() )
+ {
+ // TODO matching need to be improved
+ if(ep.getShortName().equals(adapter.getName())&&
+
ep.getTargetBeanClass().equals(adapter.getEndpoint().getImplementationClass()))
+ {
+ ep.addAttachment(ServletAdapter.class, adapter);
+ break;
+ }
+ }
+ }
+
+ }
+ catch (Throwable e)
+ {
+ logger.log(Level.SEVERE, WsservletMessages.LISTENER_PARSING_FAILED(e), e);
+ throw new WebServiceException("listener.parsingFailed", e);
+ }
+
+
+ }
+
+ private URL getDDUrlFromContext(Deployment deployment)
+ throws MalformedURLException
+ {
+ HashMap<String, String> contextProperties =
+ (HashMap<String,
String>)deployment.getProperty("org.jboss.ws.webapp.ContextParameterMap");
+ URL sunJaxWsXml = new
URL(contextProperties.get(WSServletContextListenerJBWS.PARAM_SUN_JAXWS_URL));
+ return sunJaxWsXml;
+ }
+
+ /**
+ * Externalized for integration
+ */
+ protected DeploymentDescriptorParserExt<ServletAdapter>
createDeploymentDescriptorParser(
+ ClassLoader classLoader, JBossWSContainer container,
+ ResourceLoader resourceLoader,
DeploymentDescriptorParser.AdapterFactory<ServletAdapter> adapterList)
+ throws MalformedURLException
+ {
+ DeploymentDescriptorParserExt<ServletAdapter> parser =
+ new DeploymentDescriptorParserExt<ServletAdapter>(classLoader,
resourceLoader, container, adapterList);
+ return parser;
+ }
+
+ /**
+ * Externalized for integration
+ */
+ protected URL getDDUrlFromResourceLoader(UnifiedVirtualFile vfsRoot) throws
IOException
+ {
+ URL sunJaxWsXml = vfsRoot.findChild(JAXWS_RI_RUNTIME).toURL();
+ return sunJaxWsXml;
+ }
+
+
+ /**
+ * Provides access to {@link javax.servlet.ServletContext} via {@link
com.sun.xml.ws.api.server.Container}. Pipes
+ * can get ServletContext from Container and use it to load some resources.
+ */
+ static class JBossWSContainer extends Container
+ {
+ private final Module module = new Module()
+ {
+ private final List<BoundEndpoint> endpoints = new
ArrayList<BoundEndpoint>();
+
+ public @NotNull
+ List<BoundEndpoint> getBoundEndpoints()
+ {
+ return endpoints;
+ }
+ };
+
+ JBossWSContainer()
+ {
+ }
+
+ public <T> T getSPI(Class<T> spiType)
+ {
+ if (spiType == Module.class)
+ {
+ return spiType.cast(module);
+ }
+ else if(spiType == ResourceInjector.class)
+ {
+ return (T)ResourceInjector.STANDALONE;
+ }
+
+ logger.log(Level.WARNING, "Unable to resolve SPI for type: " +
spiType);
+ return null;
+ }
+ }
+
+}
Property changes on:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/RuntimeModelDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/VFSResourceLoader.java
===================================================================
---
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/VFSResourceLoader.java
(rev 0)
+++
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/VFSResourceLoader.java 2007-10-22
18:47:55 UTC (rev 4858)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.stack.sunri.metadata;
+
+import com.sun.xml.ws.transport.http.ResourceLoader;
+
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
+
+/**
+ * @author Heiko.Braun(a)jboss.com
+ * @version $Revision$
+ */
+public class VFSResourceLoader implements ResourceLoader
+{
+ UnifiedVirtualFile vfs;
+
+
+ public VFSResourceLoader(UnifiedVirtualFile vfs)
+ {
+ this.vfs = vfs;
+ }
+
+ public URL getResource(String path) throws MalformedURLException
+ {
+ try
+ {
+ return vfs.findChild(path).toURL();
+ }
+ catch (IOException e)
+ {
+ throw new MalformedURLException(e.getMessage());
+ }
+ }
+
+ public URL getCatalogFile() throws MalformedURLException
+ {
+ System.out.println("!!! getCatalogFile() not implemented");
+ return null;
+ }
+
+ public Set<String> getResourcePaths(String path)
+ {
+ System.out.println("!!! getResourcePaths() not implemented");
+ return new HashSet<String>();
+ }
+}
Property changes on:
stack/metro/branches/hbraun/src/main/java/org/jboss/wsf/stack/sunri/metadata/VFSResourceLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/metro/branches/hbraun/src/main/resources/jbossws-sunri-config.xml
===================================================================
--- stack/metro/branches/hbraun/src/main/resources/jbossws-sunri-config.xml 2007-10-22
14:38:44 UTC (rev 4857)
+++ stack/metro/branches/hbraun/src/main/resources/jbossws-sunri-config.xml 2007-10-22
18:47:55 UTC (rev 4858)
@@ -57,24 +57,28 @@
<property name="provides">ContextProperties</property>
<property name="contextProperties">
<map keyClass="java.lang.String"
valueClass="java.lang.String">
-
<entry><key>org.jboss.ws.webapp.ServletClass</key><value>org.jboss.wsf.stack.sunri.EndpointServlet</value></entry>
-
<entry><key>org.jboss.ws.webapp.ServletContextListener</key><value>org.jboss.wsf.stack.sunri.WSServletContextListenerJBWS</value></entry>
+
<entry><key>org.jboss.ws.webapp.ServletClass</key><value>org.jboss.wsf.stack.sunri.EndpointServlet</value></entry>
</map>
</property>
</bean>
-
+
+
<bean name="WSMetroEndpointHandlerDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect">
<property name="requires">ContainerEndpointHandler</property>
- <property name="provides">StackEndpointHandler</property>
+ <property name="provides">StackEndpointHandler</property>
</bean>
-
+
<bean name="WSMetroDescriptorDeploymentAspect"
class="org.jboss.wsf.stack.sunri.SunJaxwsDeploymentAspect">
<property name="requires">URLPattern</property>
<property name="provides">StackDescriptor</property>
</bean>
-
- <!-- Deployment aspect installers -->
+ <bean name="WSRuntimeModelDeploymentAspect"
class="org.jboss.wsf.stack.sunri.metadata.RuntimeModelDeploymentAspect">
+ <property name="requires">RuntimeLoader,
StackDescriptor</property>
+ <property name="provides">RuntimeModel</property>
+ </bean>
+ <!-- Deployment aspect installers -->
+
<!-- Phase 1 -->
<bean name="WSMetroDeploymentAspectInstallerPreJSE"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
<property name="manager"><inject
bean="WSDeploymentAspectManagerPreJSE"/></property>
@@ -95,6 +99,7 @@
<property name="aspects">
<set class="java.util.HashSet"
elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
<inject bean="WSMetroEndpointHandlerDeploymentAspect"/>
+ <inject bean="WSRuntimeModelDeploymentAspect"/>
</set>
</property>
<depends>WSDeploymentAspectInstallerPostJSE</depends>
@@ -108,6 +113,7 @@
<inject bean="WSMetroContextPropertiesDeploymentAspect"/>
<inject bean="WSMetroEndpointHandlerDeploymentAspect"/>
<inject bean="WSMetroDescriptorDeploymentAspect"/>
+ <inject bean="WSRuntimeModelDeploymentAspect"/>
</set>
</property>
<depends>WSDeploymentAspectInstallerEJB</depends>