Author: thomas.diesler(a)jboss.com
Date: 2007-07-27 02:00:11 -0400 (Fri, 27 Jul 2007)
New Revision: 4016
Added:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
Removed:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ContextServlet.java
Modified:
trunk/integration/native/src/main/resources/jbossws-context.war/WEB-INF/web.xml
trunk/integration/sunri/src/main/resources/jbossws-context.war/WEB-INF/web.xml
trunk/integration/xfire/src/main/resources/jbossws-context.war/WEB-INF/web.xml
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
Log:
Delegate endpoint address access
Modified: trunk/integration/native/src/main/resources/jbossws-context.war/WEB-INF/web.xml
===================================================================
---
trunk/integration/native/src/main/resources/jbossws-context.war/WEB-INF/web.xml 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/integration/native/src/main/resources/jbossws-context.war/WEB-INF/web.xml 2007-07-27
06:00:11 UTC (rev 4016)
@@ -14,7 +14,7 @@
<servlet>
<servlet-name>ContextServlet</servlet-name>
- <servlet-class>org.jboss.ws.core.server.ContextServlet</servlet-class>
+
<servlet-class>org.jboss.wsf.framework.management.ContextServlet</servlet-class>
</servlet>
<servlet>
Copied:
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
(from rev 4012,
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ContextServlet.java)
===================================================================
---
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java
(rev 0)
+++
trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ContextServlet.java 2007-07-27
06:00:11 UTC (rev 4016)
@@ -0,0 +1,181 @@
+/*
+ * 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.framework.management;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.Set;
+
+import javax.management.ObjectName;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+import org.jboss.wsf.spi.management.EndpointRegistry;
+import org.jboss.wsf.spi.management.EndpointRegistryFactory;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+
+/**
+ * The servlet that that is associated with context /jbossws
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 21-Mar-2005
+ */
+public class ContextServlet extends HttpServlet
+{
+ // provide logging
+ protected final Logger log = Logger.getLogger(ContextServlet.class);
+
+ protected EndpointRegistry epRegistry;
+
+ public void init(ServletConfig config) throws ServletException
+ {
+ super.init(config);
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ epRegistry =
spiProvider.getSPI(EndpointRegistryFactory.class).createEndpointRegistry();
+ }
+
+ /** Process GET requests.
+ */
+ public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
+ {
+ PrintWriter writer = res.getWriter();
+ res.setContentType("text/html");
+
+ writer.print("<html>");
+ setupHTMLResponseHeader(writer);
+
+ URL requestURL = new URL(req.getRequestURL().toString());
+
+ writer.print("<body>");
+
+ writer.print("<div
class='pageHeader'>JBossWS/Services</div>");
+ writer.print("<div class='pageSection'>");
+ writer.print("<fieldset>");
+ writer.print("<legend><b>Registered Service
Endpoints</b></legend>");
+ writer.print("<table>");
+
+ // begin iteration
+ Set<ObjectName> epNames = epRegistry.getEndpoints();
+
+ if (epNames.isEmpty())
+ {
+ writer.print("<tr>");
+ writer.print(" <td><h3>There are currently no endpoints
deployed</h3></td>");
+ writer.print("</tr>");
+ }
+
+ for (ObjectName oname : epNames)
+ {
+ Endpoint ep = epRegistry.getEndpoint(oname);
+
+ writer.print("<tr>");
+ writer.print(" <td>Endpoint Name</td>");
+ writer.print(" <td>" + ep.getName() + "</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>Endpoint Address</td>");
+ writer.print(" <td><a href='" + ep.getAddress() +
"?wsdl'>" + ep.getAddress() + "?wsdl</a></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td colspan=2>");
+ writer.print(" ");
+ writer.print("");
+
+ EndpointMetrics metrics = ep.getEndpointMetrics();
+ if (metrics != null)
+ {
+ writer.print("<table class='metrics'>");
+ writer.print("<tr>");
+ writer.print(" <td>StartTime</td>");
+ writer.print(" <td>StopTime</td>");
+ writer.print(" <td></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>" + metrics.getStartTime() +
"</td>");
+
+ String stopTime = metrics.getStopTime() != null ?
metrics.getStopTime().toString() : "";
+ writer.print(" <td>" + stopTime + "</td>");
+ writer.print(" <td></td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+
+ writer.print(" <td>RequestCount</td>");
+ writer.print(" <td>ResponseCount</td>");
+ writer.print(" <td>FaultCount</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>" + metrics.getRequestCount() +
"</td>");
+ writer.print(" <td>" + metrics.getResponseCount() +
"</td>");
+ writer.print(" <td>" + metrics.getFaultCount() +
"</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>MinProcessingTime</td>");
+ writer.print(" <td>MaxProcessingTime</td>");
+ writer.print(" <td>AvgProcessingTime</td>");
+ writer.print("</tr>");
+ writer.print("<tr>");
+ writer.print(" <td>" + metrics.getMinProcessingTime() +
"</td>");
+ writer.print(" <td>" + metrics.getMaxProcessingTime() +
"</td>");
+ writer.print(" <td>" + metrics.getAverageProcessingTime() +
"</td>");
+ writer.print("</tr>");
+ writer.print("");
+ writer.print("");
+ writer.print("</table>");
+ writer.print("");
+ }
+
+ writer.print(" </td>");
+ writer.print("</tr>");
+
+ writer.print("<tr><td
colspan='3'> </td></tr>");
+ }
+ // end iteration
+ writer.print("</table>");
+ writer.print("");
+ writer.print("</fieldset>");
+ writer.print("</div>");
+
+ writer.print("</body>");
+ writer.print("</html>");
+ writer.close();
+ }
+
+ private void setupHTMLResponseHeader(PrintWriter writer)
+ {
+ Package wsPackage = Package.getPackage("org.jboss.ws");
+ writer.println("<head>");
+ writer.println("<meta http-equiv='Content-Type content='text/html;
charset=iso-8859-1'>");
+ writer.println("<title>JBossWS / " +
wsPackage.getImplementationVersion() + "</title>");
+ writer.println("<link rel='stylesheet'
href='./styles.css'>");
+ writer.println("</head>");
+ }
+}
Modified: trunk/integration/sunri/src/main/resources/jbossws-context.war/WEB-INF/web.xml
===================================================================
---
trunk/integration/sunri/src/main/resources/jbossws-context.war/WEB-INF/web.xml 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/integration/sunri/src/main/resources/jbossws-context.war/WEB-INF/web.xml 2007-07-27
06:00:11 UTC (rev 4016)
@@ -14,14 +14,9 @@
<servlet>
<servlet-name>ContextServlet</servlet-name>
- <servlet-class>org.jboss.ws.core.server.ContextServlet</servlet-class>
+
<servlet-class>org.jboss.wsf.framework.management.ContextServlet</servlet-class>
</servlet>
- <servlet>
- <servlet-name>PortComponentLinkServlet</servlet-name>
-
<servlet-class>org.jboss.ws.core.server.PortComponentLinkServlet</servlet-class>
- </servlet>
-
<!-- now the mappings -->
<servlet-mapping>
@@ -29,11 +24,6 @@
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>PortComponentLinkServlet</servlet-name>
- <url-pattern>/pclink</url-pattern>
- </servlet-mapping>
-
<!--
currently the W3C haven't settled on a media type for WSDL;
http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
Modified: trunk/integration/xfire/src/main/resources/jbossws-context.war/WEB-INF/web.xml
===================================================================
---
trunk/integration/xfire/src/main/resources/jbossws-context.war/WEB-INF/web.xml 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/integration/xfire/src/main/resources/jbossws-context.war/WEB-INF/web.xml 2007-07-27
06:00:11 UTC (rev 4016)
@@ -14,14 +14,9 @@
<servlet>
<servlet-name>ContextServlet</servlet-name>
- <servlet-class>org.jboss.ws.core.server.ContextServlet</servlet-class>
+
<servlet-class>org.jboss.wsf.framework.management.ContextServlet</servlet-class>
</servlet>
- <servlet>
- <servlet-name>PortComponentLinkServlet</servlet-name>
-
<servlet-class>org.jboss.ws.core.server.PortComponentLinkServlet</servlet-class>
- </servlet>
-
<!-- now the mappings -->
<servlet-mapping>
@@ -29,11 +24,6 @@
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>PortComponentLinkServlet</servlet-name>
- <url-pattern>/pclink</url-pattern>
- </servlet-mapping>
-
<!--
currently the W3C haven't settled on a media type for WSDL;
http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
Deleted: trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ContextServlet.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ContextServlet.java 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/ContextServlet.java 2007-07-27
06:00:11 UTC (rev 4016)
@@ -1,183 +0,0 @@
-/*
- * 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.core.server;
-
-// $Id$
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.URL;
-import java.util.Set;
-
-import javax.management.ObjectName;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointMetrics;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-
-/**
- * The servlet that that is associated with context /jbossws
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 21-Mar-2005
- */
-public class ContextServlet extends HttpServlet
-{
- // provide logging
- protected final Logger log = Logger.getLogger(ContextServlet.class);
-
- protected EndpointRegistry epRegistry;
-
- public void init(ServletConfig config) throws ServletException
- {
- super.init(config);
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- epRegistry =
spiProvider.getSPI(EndpointRegistryFactory.class).createEndpointRegistry();
- }
-
- /** Process GET requests.
- */
- public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException
- {
- PrintWriter writer = res.getWriter();
- res.setContentType("text/html");
-
- writer.print("<html>");
- setupHTMLResponseHeader(writer);
-
- URL requestURL = new URL(req.getRequestURL().toString());
-
- writer.print("<body>");
-
- writer.print("<div
class='pageHeader'>JBossWS/Services</div>");
- writer.print("<div class='pageSection'>");
- writer.print("<fieldset>");
- writer.print("<legend><b>Registered Service
Endpoints</b></legend>");
- writer.print("<table>");
-
- // begin iteration
- Set<ObjectName> epNames = epRegistry.getEndpoints();
-
- if (epNames.isEmpty())
- {
- writer.print("<tr>");
- writer.print(" <td><h3>There are currently no endpoints
deployed</h3></td>");
- writer.print("</tr>");
- }
-
- for (ObjectName oname : epNames)
- {
- Endpoint ep = epRegistry.getEndpoint(oname);
- ServerEndpointMetaData sepMetaData =
ep.getAttachment(ServerEndpointMetaData.class);
-
- writer.print("<tr>");
- writer.print(" <td>Endpoint Name</td>");
- writer.print(" <td>" + ep.getName() + "</td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>Endpoint Address</td>");
- writer.print(" <td><a href='" +
sepMetaData.getEndpointAddress() + "?wsdl'>" +
sepMetaData.getEndpointAddress() + "?wsdl</a></td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td colspan=2>");
- writer.print(" ");
- writer.print("");
-
- EndpointMetrics metrics = ep.getEndpointMetrics();
- if (metrics != null)
- {
- writer.print("<table class='metrics'>");
- writer.print("<tr>");
- writer.print(" <td>StartTime</td>");
- writer.print(" <td>StopTime</td>");
- writer.print(" <td></td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>" + metrics.getStartTime() +
"</td>");
-
- String stopTime = metrics.getStopTime() != null ?
metrics.getStopTime().toString() : "";
- writer.print(" <td>" + stopTime + "</td>");
- writer.print(" <td></td>");
- writer.print("</tr>");
- writer.print("<tr>");
-
- writer.print(" <td>RequestCount</td>");
- writer.print(" <td>ResponseCount</td>");
- writer.print(" <td>FaultCount</td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>" + metrics.getRequestCount() +
"</td>");
- writer.print(" <td>" + metrics.getResponseCount() +
"</td>");
- writer.print(" <td>" + metrics.getFaultCount() +
"</td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>MinProcessingTime</td>");
- writer.print(" <td>MaxProcessingTime</td>");
- writer.print(" <td>AvgProcessingTime</td>");
- writer.print("</tr>");
- writer.print("<tr>");
- writer.print(" <td>" + metrics.getMinProcessingTime() +
"</td>");
- writer.print(" <td>" + metrics.getMaxProcessingTime() +
"</td>");
- writer.print(" <td>" + metrics.getAverageProcessingTime() +
"</td>");
- writer.print("</tr>");
- writer.print("");
- writer.print("");
- writer.print("</table>");
- writer.print("");
- }
-
- writer.print(" </td>");
- writer.print("</tr>");
-
- writer.print("<tr><td
colspan='3'> </td></tr>");
- }
- // end iteration
- writer.print("</table>");
- writer.print("");
- writer.print("</fieldset>");
- writer.print("</div>");
-
- writer.print("</body>");
- writer.print("</html>");
- writer.close();
- }
-
- private void setupHTMLResponseHeader(PrintWriter writer)
- {
- Package wsPackage = Package.getPackage("org.jboss.ws");
- writer.println("<head>");
- writer.println("<meta http-equiv='Content-Type content='text/html;
charset=iso-8859-1'>");
- writer.println("<title>JBossWS / " +
wsPackage.getImplementationVersion() + "</title>");
- writer.println("<link rel='stylesheet'
href='./styles.css'>");
- writer.println("</head>");
- }
-}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ClientEndpointMetaData.java 2007-07-27
06:00:11 UTC (rev 4016)
@@ -36,6 +36,8 @@
*/
public class ClientEndpointMetaData extends EndpointMetaData
{
+ // The endpoint address
+ private String endpointAddress;
public ClientEndpointMetaData(ServiceMetaData service, QName qname, QName
portTypeName, Type type)
{
@@ -48,6 +50,16 @@
configFile = ConfigurationProvider.DEFAULT_JAXWS_CLIENT_CONFIG_FILE;
}
+ public String getEndpointAddress()
+ {
+ return endpointAddress;
+ }
+
+ public void setEndpointAddress(String endpointAddress)
+ {
+ this.endpointAddress = endpointAddress;
+ }
+
public String toString()
{
StringBuilder buffer = new StringBuilder("\nClientEndpointMetaData:");
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-07-27
06:00:11 UTC (rev 4016)
@@ -110,8 +110,6 @@
protected String configName;
// The REQUIRED config-file
protected String configFile;
- // The endpoint address
- private String endpointAddress;
// The endpoint interface name
private String seiName;
// The endpoint interface
@@ -180,15 +178,9 @@
return portTypeName;
}
- public String getEndpointAddress()
- {
- return endpointAddress;
- }
+ public abstract String getEndpointAddress();
- public void setEndpointAddress(String endpointAddress)
- {
- this.endpointAddress = endpointAddress;
- }
+ public abstract void setEndpointAddress(String endpointAddress);
public String getBindingId()
{
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/metadata/umdm/ServerEndpointMetaData.java 2007-07-27
06:00:11 UTC (rev 4016)
@@ -190,6 +190,18 @@
this.secureWSDLAccess = secureWSDLAccess;
}
+ @Override
+ public String getEndpointAddress()
+ {
+ return endpoint.getAddress();
+ }
+
+ @Override
+ public void setEndpointAddress(String endpointAddress)
+ {
+ endpoint.setAddress(endpointAddress);
+ }
+
/**
* Will be set through a deployment aspect
* @return List<BindingCustomization> of available customizations
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2007-07-27
05:29:21 UTC (rev 4015)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/tools/metadata/ToolsEndpointMetaData.java 2007-07-27
06:00:11 UTC (rev 4016)
@@ -37,6 +37,7 @@
public class ToolsEndpointMetaData extends EndpointMetaData
{
public String typeNamespace;
+ private String endpointAddress;
public ToolsEndpointMetaData(ServiceMetaData service, QName portName, QName
portTypeName)
{
@@ -44,4 +45,14 @@
super.configName = ConfigurationProvider.DEFAULT_CLIENT_CONFIG_NAME;
super.configFile = ConfigurationProvider.DEFAULT_JAXRPC_CLIENT_CONFIG_FILE;
}
+
+ public String getEndpointAddress()
+ {
+ return endpointAddress;
+ }
+
+ public void setEndpointAddress(String endpointAddress)
+ {
+ this.endpointAddress = endpointAddress;
+ }
}
\ No newline at end of file