Author: darran.lofthouse(a)jboss.com
Date: 2009-02-09 07:28:52 -0500 (Mon, 09 Feb 2009)
New Revision: 9265
Modified:
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
stack/native/branches/dlofthouse/JBPAPP-1687/version.properties
Log:
Merge revisions 8284,8285
Modified:
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java
===================================================================
---
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2009-02-09
12:28:08 UTC (rev 9264)
+++
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Writer.java 2009-02-09
12:28:52 UTC (rev 9265)
@@ -137,8 +137,14 @@
appendDefinitions(builder, namespace);
appendBody(builder, namespace);
- writeBuilder(builder, resolved.writer, resolved.charset);
- resolved.writer.close();
+ try
+ {
+ writeBuilder(builder, resolved.writer, resolved.charset);
+ }
+ finally
+ {
+ resolved.writer.close();
+ }
}
}
Modified:
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
---
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-02-09
12:28:08 UTC (rev 9264)
+++
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2009-02-09
12:28:52 UTC (rev 9265)
@@ -186,7 +186,7 @@
ClassLoader classLoader =
endpoint.getService().getDeployment().getRuntimeClassLoader();
if (classLoader == null)
throw new IllegalStateException("Deployment has no classloader
associated");
-
+
// Set the thread context class loader
ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(classLoader);
@@ -203,7 +203,7 @@
{
// Reset the thread context class loader
Thread.currentThread().setContextClassLoader(ctxClassLoader);
-
+
try
{
out.close();
@@ -231,7 +231,7 @@
throw new IllegalStateException("Cannot obtain endpoint meta data");
Type type = sepMetaData.getType();
-
+
// Build the message context
CommonMessageContext msgContext;
if (type == EndpointMetaData.Type.JAXRPC)
@@ -253,12 +253,12 @@
if (invContext instanceof ServletRequestContext)
{
ServletRequestContext reqContext = (ServletRequestContext)invContext;
-
+
ServletContext servletContext = reqContext.getServletContext();
HttpServletRequest httpRequest = reqContext.getHttpServletRequest();
httpResponse = reqContext.getHttpServletResponse();
headerSource = new ServletHeaderSource(httpRequest, httpResponse);
-
+
if (type == EndpointMetaData.Type.JAXRPC)
{
msgContext.put(MessageContextJAXRPC.SERVLET_CONTEXT, servletContext);
@@ -330,6 +330,17 @@
// clear thread local storage
ThreadLocalAssociation.clear();
+ try
+ {
+ if (outStream != null)
+ {
+ outStream.close();
+ }
+ }
+ catch (IOException ex)
+ {
+ WSException.rethrow(ex);
+ }
}
}
@@ -354,15 +365,21 @@
}
else
{
- resMessage.writeTo(outputStream);
+ try
+ {
+ resMessage.writeTo(outputStream);
+ }
+ finally
+ {
+ outputStream.close();
+ }
}
}
/**
* Handle a request to this web service endpoint
*/
- private MessageAbstraction processRequest(Endpoint ep, MimeHeaderSource headerSource,
InvocationContext reqContext, InputStream inputStream)
- throws BindingException
+ private MessageAbstraction processRequest(Endpoint ep, MimeHeaderSource headerSource,
InvocationContext reqContext, InputStream inputStream) throws BindingException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
@@ -480,11 +497,11 @@
private long initRequestMetrics(Endpoint endpoint)
{
long beginTime = 0;
-
+
EndpointMetrics metrics = endpoint.getEndpointMetrics();
if (metrics != null)
beginTime = metrics.processRequestMessage();
-
+
return beginTime;
}
@@ -548,7 +565,7 @@
if (ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()) ==
false)
wsdlHost = serverConfig.getWebServiceHost();
-
+
log.debug("WSDL request, using host: " + wsdlHost);
WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
Modified:
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
---
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2009-02-09
12:28:08 UTC (rev 9264)
+++
stack/native/branches/dlofthouse/JBPAPP-1687/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2009-02-09
12:28:52 UTC (rev 9265)
@@ -105,9 +105,10 @@
wsdlFile.getParentFile().mkdirs();
// Get the wsdl definition and write it to the wsdl publish location
+ Writer fWriter = null;
try
{
- Writer fWriter = IOUtils.getCharsetFileWriter(wsdlFile,
Constants.DEFAULT_XML_CHARSET);
+ fWriter = IOUtils.getCharsetFileWriter(wsdlFile,
Constants.DEFAULT_XML_CHARSET);
WSDLDefinitions wsdlDefinitions = serviceMetaData.getWsdlDefinitions();
new WSDLWriter(wsdlDefinitions).write(fWriter,
Constants.DEFAULT_XML_CHARSET);
@@ -141,6 +142,13 @@
{
throw new WSException("Cannot publish wsdl to: " + wsdlFile, e);
}
+ finally
+ {
+ if (fWriter != null)
+ {
+ fWriter.close();
+ }
+ }
}
}
@@ -245,17 +253,38 @@
if (is == null)
throw new IllegalArgumentException("Cannot find schema import
in deployment: " + resourcePath);
- FileOutputStream fos = new FileOutputStream(targetFile);
- IOUtils.copyStream(fos, is);
- fos.close();
- is.close();
+ FileOutputStream fos = null;
+ try
+ {
+ fos = new FileOutputStream(targetFile);
+ IOUtils.copyStream(fos, is);
+ }
+ finally
+ {
+ try
+ {
+ if (fos != null) fos.close();
+ }
+ finally
+ {
+ is.close();
+ }
+ }
if (log.isDebugEnabled())
log.debug("XMLSchema import published to: " + xsdURL);
- // recursivly publish imports
- Element subdoc = DOMUtils.parse(xsdURL.openStream());
- publishSchemaImports(xsdURL, subdoc, published);
+ // recursively publish imports
+ InputStream xsdStream = xsdURL.openStream();
+ try
+ {
+ Element subdoc = DOMUtils.parse(xsdStream);
+ publishSchemaImports(xsdURL, subdoc, published);
+ }
+ finally
+ {
+ xsdStream.close();
+ }
}
}
}
Modified: stack/native/branches/dlofthouse/JBPAPP-1687/version.properties
===================================================================
--- stack/native/branches/dlofthouse/JBPAPP-1687/version.properties 2009-02-09 12:28:08
UTC (rev 9264)
+++ stack/native/branches/dlofthouse/JBPAPP-1687/version.properties 2009-02-09 12:28:52
UTC (rev 9265)
@@ -25,7 +25,7 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA_CP01-brew
-jbossws-common=1.0.0.GA_CP03-brew
+jbossws-common=1.0.0.GA_CP-SNAPSHOT
jbossws-framework=2.0.1.GA_CP03-brew
jbossws-jboss40=2.0.1.GA
jbossws-jboss42=2.0.1.GA_CP01