Author: thomas.diesler(a)jboss.com
Date: 2007-05-04 09:48:53 -0400 (Fri, 04 May 2007)
New Revision: 2960
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistry.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistryMBean.java
Removed:
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml
Modified:
trunk/build/eclipse/jbossws.userlibraries
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service.xml
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/DeploymentInfoAdapter.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/UnifiedDeploymentInfoDeployer.java
trunk/integration-jboss42/src/resources/jbossws.beans/META-INF/jboss-beans.xml
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
trunk/jbossws-core/src/java/org/jboss/ws/core/server/RequestHandlerImpl.java
Log:
Fix JAXWS_EJB3 for AS42
Modified: trunk/build/eclipse/jbossws.userlibraries
===================================================================
--- trunk/build/eclipse/jbossws.userlibraries 2007-05-04 12:20:09 UTC (rev 2959)
+++ trunk/build/eclipse/jbossws.userlibraries 2007-05-04 13:48:53 UTC (rev 2960)
@@ -22,16 +22,14 @@
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-aop-jdk50.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-deployers.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-j2se.jar"/>
-<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-security-spi.jar"/>
+<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss-javaee.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-system.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-system-jmx.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jboss-vfs.jar"/>
-<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/lib/jbosssx.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jboss.jar"
source="/home/tdiesler/svn/jbossas/trunk/server/src/main"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/lib/jnpserver.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/jboss-aop-jboss5.deployer/jboss-aspect-library-jdk50.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-annotations-ejb3.jar"/>
<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3.jar"
source="/home/tdiesler/svn/jbossas/branches/Branch_4_2/ejb3/src/main"/>
-<archive
path="/home/tdiesler/svn/jbossas/trunk/build/output/jboss-5.0.0.Beta3/server/default/deployers/ejb3.deployer/jboss-ejb3x.jar"/>
</library>
</eclipse-userlibraries>
Deleted:
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml
===================================================================
---
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service-no-ejb3.xml 2007-05-04
13:48:53 UTC (rev 2960)
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id$ -->
-
-<server>
-
- <!--
- Bind JAXRPC ServiceRefs
- -->
- <mbean name="jboss.ws:service=WebServiceClientDeployer"
code="org.jboss.ws.integration.jboss40.WebServiceClientDeployer">
- <depends>jboss:service=Naming</depends>
- </mbean>
-
- <!--
- A deployer service for JSE endpoints.
- -->
- <mbean name="jboss.ws:service=WebServiceDeployerJSE"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorJSE">
- <depends-list optional-attribute-name="Interceptables">
-
<depends-list-element>jboss.web:service=WebServer</depends-list-element>
- </depends-list>
- </mbean>
-
- <!--
- A deployer service for EJB2.1 endpoints.
- -->
- <mbean name="jboss.ws:service=DeployerInterceptorEJB21"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorEJB21">
- <depends-list optional-attribute-name="Interceptables">
-
<depends-list-element>jboss.ejb:service=EJBDeployer</depends-list-element>
- </depends-list>
- </mbean>
-
- <!--
- A deployer service for EJB3 endpoints.
- <mbean name="jboss.ws:service=DeployerInterceptorEJB3"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorEJB3">
- <depends-list optional-attribute-name="Interceptables">
-
<depends-list-element>jboss.ejb3:service=EJB3Deployer</depends-list-element>
- </depends-list>
- </mbean>
- -->
-
- <!--
- A deployer service for JSE endpoints that are nested in service archives (sar).
- -->
- <mbean name="jboss.ws:service=DeployerInterceptorNestedJSE"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorNestedJSE">
- <depends optional-attribute-name="MainDeployer"
proxy-type="attribute">jboss.system:service=MainDeployer</depends>
- <depends>jboss.ws:service=WebServiceDeployerJSE</depends>
- </mbean>
-
-</server>
Modified: trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service.xml
===================================================================
---
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service.xml 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss40/src/resources/jbossws.sar/META-INF/jboss-service.xml 2007-05-04
13:48:53 UTC (rev 2960)
@@ -14,7 +14,7 @@
<!--
A deployer service for JSE endpoints.
-->
- <mbean name="jboss.ws:service=WebServiceDeployerJSE"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorJSE">
+ <mbean name="jboss.ws:service=DeployerInterceptorJSE"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorJSE">
<depends-list optional-attribute-name="Interceptables">
<depends-list-element>jboss.web:service=WebServer</depends-list-element>
</depends-list>
@@ -38,12 +38,4 @@
</depends-list>
</mbean>
- <!--
- A deployer service for JSE endpoints that are nested in service archives (sar).
- -->
- <mbean name="jboss.ws:service=DeployerInterceptorNestedJSE"
code="org.jboss.ws.integration.jboss42.DeployerInterceptorNestedJSE">
- <depends optional-attribute-name="MainDeployer"
proxy-type="attribute">jboss.system:service=MainDeployer</depends>
- <depends>jboss.ws:service=WebServiceDeployerJSE</depends>
- </mbean>
-
</server>
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/DeploymentInfoAdapter.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/DeploymentInfoAdapter.java 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/DeploymentInfoAdapter.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -26,13 +26,25 @@
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.ArrayList;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
import org.jboss.logging.Logger;
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.WebMetaData;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.integration.ResourceLoaderAdapter;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
/**
* Build container independent deployment info.
@@ -61,7 +73,7 @@
public UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentInfo di)
{
udi.addAttachment(DeploymentInfo.class, di);
-
+
if (di.parent != null)
{
udi.parent = new UnifiedDeploymentInfo(null);
@@ -113,5 +125,44 @@
{
udi.metaData = appMetaDataAdapter.buildUnifiedApplicationMetaData(udi,
(ApplicationMetaData)metaData);
}
+ else if (udi.deployedObject != null)
+ {
+ Ejb3ModuleMBean ejb3Module = getEJB3Module(udi.deployedObject);
+
+ ArrayList<UnifiedBeanMetaData> beans = new
ArrayList<UnifiedBeanMetaData>();
+ for (Object container : ejb3Module.getContainers().values())
+ {
+ if (container instanceof StatelessContainer)
+ {
+ StatelessContainer slc = (StatelessContainer)container;
+ UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
+ uslc.setEjbName(slc.getEjbName());
+ uslc.setEjbClass(slc.getBeanClassName());
+ beans.add(uslc);
+ }
+ }
+
+ UnifiedApplicationMetaData appMetaData = new UnifiedApplicationMetaData();
+ appMetaData.setEnterpriseBeans(beans);
+ udi.metaData = appMetaData;
+ }
}
+
+ public static Ejb3ModuleMBean getEJB3Module(ObjectName objectName)
+ {
+ Ejb3ModuleMBean ejb3Module;
+ try
+ {
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ejb3Module = (Ejb3ModuleMBean)MBeanProxy.get(Ejb3ModuleMBean.class, objectName,
server);
+ if (ejb3Module == null)
+ throw new WSException("Cannot obtain EJB3 module: " + objectName);
+
+ return ejb3Module;
+ }
+ catch (MBeanProxyCreationException ex)
+ {
+ throw new WSException("Cannot obtain proxy to EJB3 module");
+ }
+ }
}
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookEJB3.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -23,23 +23,17 @@
//$Id$
-import java.io.IOException;
-import java.util.Iterator;
-
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
import org.jboss.deployment.DeploymentInfo;
import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.Ejb3ModuleMBean;
import org.jboss.ejb3.stateless.StatelessContainer;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.integration.Endpoint;
import org.jboss.ws.integration.EndpointImpl;
import org.jboss.ws.integration.ObjectNameFactory;
-import org.jboss.ws.integration.ResourceLoaderAdapter;
import org.jboss.ws.integration.Service;
-import org.jboss.ws.integration.UnifiedVirtualFile;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.DeploymentImpl;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
@@ -68,28 +62,24 @@
Service service = dep.getService();
- Ejb3Deployment ejb3Deployment =
(Ejb3Deployment)unit.context.get(Ejb3Deployment.class);
- if (ejb3Deployment == null)
- throw new IllegalStateException("Deployment unit does not contain ejb3
deployment");
-
- // Copy the attachments
- dep.getContext().addAttachment(Ejb3Deployment.class, ejb3Deployment);
-
- Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
+ Ejb3ModuleMBean ejb3Module =
DeploymentInfoAdapter.getEJB3Module(unit.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
{
- EJBContainer container = (EJBContainer)it.next();
- if (isWebServiceBean(container))
+ if (manager instanceof EJBContainer)
{
- String ejbName = container.getEjbName();
- Class epBean = container.getBeanClass();
+ EJBContainer container = (EJBContainer)manager;
+ if (isWebServiceBean(container))
+ {
+ String ejbName = container.getEjbName();
+ Class epBean = container.getBeanClass();
- // Create the endpoint
- Endpoint endpoint = new EndpointImpl(service, epBean);
- String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbName;
- endpoint.setName(ObjectNameFactory.create(nameStr));
+ // Create the endpoint
+ Endpoint endpoint = new EndpointImpl(service, epBean);
+ String nameStr = Endpoint.SEPID_DOMAIN + ":" +
Endpoint.SEPID_PROPERTY_ENDPOINT + "=" + ejbName;
+ endpoint.setName(ObjectNameFactory.create(nameStr));
- service.addEndpoint(endpoint);
+ service.addEndpoint(endpoint);
+ }
}
}
@@ -99,24 +89,24 @@
@Override
public boolean isWebServiceDeployment(DeploymentInfo unit)
{
- Ejb3Deployment ejb3Deployment =
(Ejb3Deployment)unit.context.get(Ejb3Deployment.class);
- if (ejb3Deployment == null)
- return false;
+ boolean isWebserviceDeployment = false;
- boolean isWebServiceDeployment = false;
-
- Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
- while (it.hasNext())
+ // Check if the ejb3 contains annotated endpoints
+ Ejb3ModuleMBean ejb3Module =
DeploymentInfoAdapter.getEJB3Module(unit.deployedObject);
+ for (Object manager : ejb3Module.getContainers().values())
{
- EJBContainer container = (EJBContainer)it.next();
- if (isWebServiceBean(container))
+ if (manager instanceof EJBContainer)
{
- isWebServiceDeployment = true;
- break;
+ EJBContainer container = (EJBContainer)manager;
+ if (isWebServiceBean(container))
+ {
+ isWebserviceDeployment = true;
+ break;
+ }
}
}
- return isWebServiceDeployment;
+ return isWebserviceDeployment;
}
private boolean isWebServiceBean(EJBContainer container)
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/JAXWSDeployerHookJSE.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -69,14 +69,14 @@
Service service = dep.getService();
- WebMetaData webMetaData = (WebMetaData)unit.context.get(WebMetaData.class);
+ WebMetaData webMetaData = (WebMetaData)unit.metaData;
if (webMetaData == null)
throw new IllegalStateException("Deployment unit does not contain web meta
data");
// Copy the attachments
dep.getContext().addAttachment(WebMetaData.class, webMetaData);
- List<Servlet> servlets = getRelevantServlets(webMetaData, unit.ucl);
+ List<Servlet> servlets = getRelevantServlets(webMetaData,
unit.annotationsCl);
for (Servlet servlet : servlets)
{
String servletName = servlet.getServletName();
@@ -114,7 +114,7 @@
try
{
WebMetaData webMetaData = (WebMetaData)unit.metaData;
- List<Servlet> servlets = getRelevantServlets(webMetaData, unit.ucl);
+ List<Servlet> servlets = getRelevantServlets(webMetaData,
unit.annotationsCl);
isWebServiceDeployment = servlets.size() > 0;
}
catch (Exception ex)
Modified:
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/UnifiedDeploymentInfoDeployer.java
===================================================================
---
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/UnifiedDeploymentInfoDeployer.java 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss42/src/java/org/jboss/ws/integration/jboss42/jbossws/UnifiedDeploymentInfoDeployer.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -23,13 +23,26 @@
//$Id$
+import java.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
import org.jboss.deployment.DeploymentInfo;
+import org.jboss.ejb3.Ejb3ModuleMBean;
+import org.jboss.ejb3.stateless.StatelessContainer;
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanProxyCreationException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.deployment.JAXRPCDeployment;
import org.jboss.ws.core.deployment.JAXWSDeployment;
import org.jboss.ws.core.deployment.UnifiedDeploymentInfo;
import org.jboss.ws.integration.deployment.AbstractDeployer;
import org.jboss.ws.integration.deployment.Deployment;
import org.jboss.ws.integration.deployment.Deployment.DeploymentType;
+import org.jboss.ws.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedBeanMetaData;
import org.jboss.ws.metadata.webservices.WebservicesMetaData;
/**
Modified: trunk/integration-jboss42/src/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
trunk/integration-jboss42/src/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss42/src/resources/jbossws.beans/META-INF/jboss-beans.xml 2007-05-04
13:48:53 UTC (rev 2960)
@@ -26,7 +26,7 @@
</bean>
<!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry"
class="org.jboss.ws.integration.management.EndpointRegistryImpl"/>
+ <bean name="WSEndpointRegistry"
class="org.jboss.ws.core.server.ServiceEndpointRegistry"/>
<!-- A subscription manager for WS-Eventing -->
<bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
Modified: trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml
===================================================================
---
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/integration-jboss50/src/resources/jbossws.sar/META-INF/jbossws-beans.xml 2007-05-04
13:48:53 UTC (rev 2960)
@@ -26,7 +26,7 @@
</bean>
<!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry"
class="org.jboss.ws.integration.management.EndpointRegistryImpl"/>
+ <bean name="WSEndpointRegistry"
class="org.jboss.ws.core.server.ServiceEndpointRegistry"/>
<!-- A subscription manager for WS-Eventing -->
<bean name="WSSubscriptionManager"
class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"/>
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/AbstractServiceEndpointServlet.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -85,16 +85,28 @@
if (req.getParameter("wsdl") != null ||
req.getParameter("WSDL") != null)
{
res.setContentType("text/xml");
+ ServletOutputStream out = res.getOutputStream();
try
{
RequestHandler requestHandler = endpoint.getRequestHandler();
ServletRequestContext context = new
ServletRequestContext(getServletContext(), req, res);
- requestHandler.handleWSDLRequest(endpoint, res.getOutputStream(), context);
+ requestHandler.handleWSDLRequest(endpoint, out, context);
}
catch (Exception ex)
{
handleException(ex);
}
+ finally
+ {
+ try
+ {
+ out.close();
+ }
+ catch (IOException ioex)
+ {
+ log.error("Cannot close output stream");
+ }
+ }
}
else
{
@@ -102,7 +114,6 @@
res.setContentType("text/plain");
Writer out = res.getWriter();
out.write("HTTP GET not supported");
- out.flush();
out.close();
}
}
@@ -111,13 +122,13 @@
{
log.debug("doPost: " + req.getRequestURI());
- ServletInputStream inputStream = req.getInputStream();
- ServletOutputStream outputStream = res.getOutputStream();
+ ServletInputStream in = req.getInputStream();
+ ServletOutputStream out = res.getOutputStream();
try
{
RequestHandler requestHandler = endpoint.getRequestHandler();
ServletRequestContext context = new ServletRequestContext(getServletContext(),
req, res);
- requestHandler.handleRequest(endpoint, inputStream, outputStream, context);
+ requestHandler.handleRequest(endpoint, in, out, context);
}
catch (Exception ex)
{
@@ -127,14 +138,12 @@
{
try
{
- outputStream.flush();
- outputStream.close();
+ out.close();
}
catch (IOException ioex)
{
- log.error("Cannot flush output stream");
+ log.error("Cannot close output stream");
}
-
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/server/RequestHandlerImpl.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-04
12:20:09 UTC (rev 2959)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/RequestHandlerImpl.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -396,8 +396,6 @@
OutputStreamWriter writer = new OutputStreamWriter(outputStream);
new
DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
- outputStream.flush();
- outputStream.close();
}
catch (RuntimeException rte)
{
Added: trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistry.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistry.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistry.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -0,0 +1,81 @@
+/*
+ * 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.util.ArrayList;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.management.EndpointRegistryImpl;
+import org.jboss.ws.metadata.umdm.UnifiedMetaData;
+
+/**
+ * A Service Endpoint Registry
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 04-May-2007
+ */
+public class ServiceEndpointRegistry extends EndpointRegistryImpl implements
ServiceEndpointRegistryMBean
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ServiceEndpointRegistry.class);
+
+ public String getImplementationVersion()
+ {
+ return UnifiedMetaData.getImplementationVersion();
+ }
+
+ public void create() throws Exception
+ {
+ log.info(UnifiedMetaData.getImplementationVersion());
+ MBeanServer server = getMBeanServer();
+ if (server != null)
+ {
+ server.registerMBean(this, OBJECT_NAME);
+ }
+ }
+
+ public void destroy() throws Exception
+ {
+ log.debug("Destroy service endpoint manager");
+ MBeanServer server = getMBeanServer();
+ if (server != null)
+ {
+ server.unregisterMBean(OBJECT_NAME);
+ }
+ }
+
+ private MBeanServer getMBeanServer()
+ {
+ MBeanServer server = null;
+ ArrayList servers = MBeanServerFactory.findMBeanServer(null);
+ if (servers.size() > 0)
+ {
+ server = (MBeanServer)servers.get(0);
+ }
+ return server;
+ }
+}
Property changes on:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistry.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistryMBean.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistryMBean.java
(rev 0)
+++
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistryMBean.java 2007-05-04
13:48:53 UTC (rev 2960)
@@ -0,0 +1,38 @@
+/*
+ * 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;
+
+import javax.management.ObjectName;
+
+import org.jboss.ws.integration.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ServiceEndpointRegistryMBean
+{
+ // default object name
+ static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceEndpointRegistry");
+
+ String getImplementationVersion();
+}
Property changes on:
trunk/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointRegistryMBean.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF