Author: tho...@jb... Date: 2006-07-07 12:08:23 -0400 (Fri, 07 Jul 2006) New Revision: 584 Added: trunk/src/main/java/org/jboss/ws/jaxws/spi/EndpointImpl.java trunk/src/main/java/org/jboss/ws/server/HttpServer.java Modified: trunk/build.xml trunk/src/main/java/javax/xml/ws/spi/Provider.java trunk/src/main/java/org/jboss/ws/jaxws/spi/ProviderImpl.java trunk/src/main/java/org/jboss/ws/tools/wspublish.java Log: Add Endpoint API Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2006-07-07 15:55:12 UTC (rev 583) +++ trunk/build.xml 2006-07-07 16:08:23 UTC (rev 584) @@ -210,7 +210,7 @@ <!-- Build jbossws-tomcat-integration.jar --> <jar jarfile="${build.lib.dir}/jbossws-tomcat-integration.jar" manifest="${build.etc.dir}/default.mf"> <fileset dir="${build.classes.dir}"> - <include name="org/jboss/ws/integration/other/**"/> + <include name="org/jboss/ws/integration/tomcat/**"/> </fileset> </jar> @@ -227,7 +227,7 @@ <include name="javax/**"/> <include name="org/jboss/ws/**"/> <exclude name="org/jboss/ws/integration/jboss/**"/> - <exclude name="org/jboss/ws/integration/other/**"/> + <exclude name="org/jboss/ws/integration/tomcat/**"/> <exclude name="org/jboss/ws/transport/jms/**"/> </fileset> <fileset dir="${build.resources.dir}/jbossws.sar"> @@ -331,7 +331,7 @@ <include name="javax/**"/> <include name="org/jboss/ws/**"/> <exclude name="org/jboss/ws/integration/jboss/**"/> - <exclude name="org/jboss/ws/integration/other/**"/> + <exclude name="org/jboss/ws/integration/tomcat/**"/> <exclude name="org/jboss/ws/transport/jms/**"/> </fileset> <fileset dir="${build.resources.dir}/jbossws.sar"> Modified: trunk/src/main/java/javax/xml/ws/spi/Provider.java =================================================================== --- trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-07-07 15:55:12 UTC (rev 583) +++ trunk/src/main/java/javax/xml/ws/spi/Provider.java 2006-07-07 16:08:23 UTC (rev 584) @@ -69,7 +69,7 @@ public abstract ServiceDelegate createServiceDelegate(URL url, QName qname, Class class1); - public abstract Endpoint createEndpoint(String s, Object obj); + public abstract Endpoint createEndpoint(String bindingId, Object implementor); - public abstract Endpoint createAndPublishEndpoint(String s, Object obj); + public abstract Endpoint createAndPublishEndpoint(String bindingId, Object implementor); } \ No newline at end of file Added: trunk/src/main/java/org/jboss/ws/jaxws/spi/EndpointImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxws/spi/EndpointImpl.java 2006-07-07 15:55:12 UTC (rev 583) +++ trunk/src/main/java/org/jboss/ws/jaxws/spi/EndpointImpl.java 2006-07-07 16:08:23 UTC (rev 584) @@ -0,0 +1,135 @@ +/* + * 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.ws.jaxws.spi; + +// $Id$ + +import java.net.URL; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Executor; + +import javax.xml.namespace.QName; +import javax.xml.transform.Source; +import javax.xml.ws.Binding; +import javax.xml.ws.Endpoint; +import javax.xml.ws.spi.Provider; +import javax.xml.ws.spi.ServiceDelegate; + +import org.jboss.util.NotImplementedException; + +/** + * Service provider for ServiceDelegate and Endpoint objects. + * + * @author Tho...@jb... + * @since 03-May-2006 + */ +public class EndpointImpl extends Endpoint +{ + public EndpointImpl(String bindingId, Object implementor) + { + } + + @Override + public Binding getBinding() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getImplementor() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void publish(String s) + { + // TODO Auto-generated method stub + + } + + @Override + public void publish(Object obj) + { + // TODO Auto-generated method stub + + } + + @Override + public void stop() + { + // TODO Auto-generated method stub + + } + + @Override + public boolean isPublished() + { + // TODO Auto-generated method stub + return false; + } + + @Override + public List<Source> getMetadata() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setMetadata(List<Source> list) + { + // TODO Auto-generated method stub + + } + + @Override + public Executor getExecutor() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setExecutor(Executor executor) + { + // TODO Auto-generated method stub + + } + + @Override + public Map<String, Object> getProperties() + { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setProperties(Map<String, Object> map) + { + // TODO Auto-generated method stub + + } +} \ No newline at end of file Property changes on: trunk/src/main/java/org/jboss/ws/jaxws/spi/EndpointImpl.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Modified: trunk/src/main/java/org/jboss/ws/jaxws/spi/ProviderImpl.java =================================================================== --- trunk/src/main/java/org/jboss/ws/jaxws/spi/ProviderImpl.java 2006-07-07 15:55:12 UTC (rev 583) +++ trunk/src/main/java/org/jboss/ws/jaxws/spi/ProviderImpl.java 2006-07-07 16:08:23 UTC (rev 584) @@ -30,7 +30,7 @@ import javax.xml.ws.spi.Provider; import javax.xml.ws.spi.ServiceDelegate; -import org.jboss.util.NotImplementedException; +import org.jboss.ws.server.HttpServer; /** * Service provider for ServiceDelegate and Endpoint objects. @@ -48,14 +48,18 @@ } @Override - public Endpoint createEndpoint(String s, Object obj) + public Endpoint createEndpoint(String bindingId, Object implementor) { - throw new NotImplementedException(); + EndpointImpl endpoint = new EndpointImpl(bindingId, implementor); + return endpoint; } @Override - public Endpoint createAndPublishEndpoint(String s, Object obj) + public Endpoint createAndPublishEndpoint(String bindingId, Object implementor) { - throw new NotImplementedException(); + EndpointImpl endpoint = new EndpointImpl(bindingId, implementor); + HttpServer server = HttpServer.create(null); + server.publish(endpoint); + return endpoint; } } \ No newline at end of file Added: trunk/src/main/java/org/jboss/ws/server/HttpServer.java =================================================================== --- trunk/src/main/java/org/jboss/ws/server/HttpServer.java 2006-07-07 15:55:12 UTC (rev 583) +++ trunk/src/main/java/org/jboss/ws/server/HttpServer.java 2006-07-07 16:08:23 UTC (rev 584) @@ -0,0 +1,94 @@ +/* + * 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.ws.server; + +// $Id$ + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.xml.ws.Endpoint; + +import org.jboss.ws.integration.tomcat.TomcatHttpServer; +import org.jboss.ws.jaxws.util.FactoryFinder; + +/** + * An abstract HTTP Server + * + * @author Tho...@jb... + * @since 07-Jul-2006 + */ +public abstract class HttpServer +{ + public static String HTTP_SERVER_PROPERTY = HttpServer.class.getName(); + public static String DEFAULT_HTTP_SERVER_PROPERTY = TomcatHttpServer.class.getName(); + + private Map<String, Object> properties = new HashMap<String, Object>(); + + // Hide constructor + protected HttpServer () + { + } + + /** + * Create an instance of an HTTP server. + * The discovery algorithm is described in {@link FactoryFinder.find(String,String)} + */ + public static HttpServer create(Map<String, Object> props) + { + HttpServer server = (HttpServer)FactoryFinder.find(HTTP_SERVER_PROPERTY, DEFAULT_HTTP_SERVER_PROPERTY); + if (props != null) + { + for (String key : props.keySet()) + server.setProperty(key, props.get(key)); + } + return server; + } + + /** Start an instance of this HTTP server */ + public abstract void start(); + + /** Publish an JAXWS endpoint to the HTTP server */ + public abstract void publish(Endpoint endpoint); + + public void setProperty(String key, Object value) + { + properties.put(key, value); + } + + public Object getProperty(String key) + { + return properties.get(key); + } + + public void removeProperty(String key) + { + properties.remove(key); + } + + public Iterator<String> getPropertyNames() + { + return properties.keySet().iterator(); + } + +} Property changes on: trunk/src/main/java/org/jboss/ws/server/HttpServer.java ___________________________________________________________________ Name: svn:keywords + Id Revision Name: svn:eol-style + LF Modified: trunk/src/main/java/org/jboss/ws/tools/wspublish.java =================================================================== --- trunk/src/main/java/org/jboss/ws/tools/wspublish.java 2006-07-07 15:55:12 UTC (rev 583) +++ trunk/src/main/java/org/jboss/ws/tools/wspublish.java 2006-07-07 16:08:23 UTC (rev 584) @@ -32,7 +32,8 @@ import org.jboss.logging.Logger; import org.jboss.util.file.JarUtils; -import org.jboss.ws.integration.other.GenericServiceEndpointPublisher; +import org.jboss.ws.deployment.ServiceEndpointPublisher; +import org.jboss.ws.integration.tomcat.GenericServiceEndpointPublisher; /** * Publish a standard portable J2EE web service endpoint @@ -68,7 +69,7 @@ JarUtils.unjar(in, tmpDir); in.close(); - GenericServiceEndpointPublisher publisher = new GenericServiceEndpointPublisher(); + ServiceEndpointPublisher publisher = new GenericServiceEndpointPublisher(); publisher.setServiceEndpointServlet(servletName); publisher.rewriteWebXML(tmpDir.toURL()); |