SWS-245, for real this time

This commit is contained in:
Arjen Poutsma
2007-12-06 19:54:56 +00:00
parent 330255fd1c
commit 0951eecb4a
12 changed files with 70 additions and 52 deletions

View File

@@ -40,7 +40,7 @@ import org.springframework.ws.transport.support.EnumerationIterator;
* @author Arjen Poutsma
* @since 1.5.0
*/
public class JmsReceiverConnection extends AbstractReceiverConnection implements WebServiceConnection {
public class JmsReceiverConnection extends AbstractReceiverConnection {
private final BytesMessage requestMessage;
@@ -48,9 +48,7 @@ public class JmsReceiverConnection extends AbstractReceiverConnection implements
private BytesMessage responseMessage;
/**
* Constructs a new JMS connection with the given parameters.
*/
/** Constructs a new JMS connection with the given parameters. */
protected JmsReceiverConnection(BytesMessage requestMessage, Session session) {
Assert.notNull(requestMessage, "requestMessage must not be null");
Assert.notNull(session, "session must not be null");
@@ -58,16 +56,12 @@ public class JmsReceiverConnection extends AbstractReceiverConnection implements
this.session = session;
}
/**
* Returns the request message for this connection.
*/
/** Returns the request message for this connection. */
public BytesMessage getRequestMessage() {
return requestMessage;
}
/**
* Returns the response message, if any, for this connection.
*/
/** Returns the response message, if any, for this connection. */
public BytesMessage getResponseMessage() {
return responseMessage;
}
@@ -152,7 +146,4 @@ public class JmsReceiverConnection extends AbstractReceiverConnection implements
}
}
public void close() throws IOException {
}
}

View File

@@ -242,7 +242,7 @@ public class JmsSenderConnection extends AbstractSenderConnection implements Web
return new BytesMessageInputStream(responseMessage);
}
public void close() throws IOException {
protected void onClose() throws IOException {
JmsUtils.closeSession(session);
ConnectionFactoryUtils.releaseConnection(connection, connectionFactory, true);
}

View File

@@ -66,9 +66,7 @@ public class MailReceiverConnection extends AbstractReceiverConnection {
private InternetAddress from;
/**
* Constructs a new Mail connection with the given parameters.
*/
/** Constructs a new Mail connection with the given parameters. */
protected MailReceiverConnection(Message requestMessage, Session session) {
Assert.notNull(requestMessage, "'requestMessage' must not be null");
Assert.notNull(session, "'session' must not be null");
@@ -76,16 +74,12 @@ public class MailReceiverConnection extends AbstractReceiverConnection {
this.session = session;
}
/**
* Returns the request message for this connection.
*/
/** Returns the request message for this connection. */
public Message getRequestMessage() {
return requestMessage;
}
/**
* Returns the response message, if any, for this connection.
*/
/** Returns the response message, if any, for this connection. */
public Message getResponseMessage() {
return responseMessage;
}
@@ -113,12 +107,9 @@ public class MailReceiverConnection extends AbstractReceiverConnection {
return false;
}
public void close() throws IOException {
}
/*
* Receiving
*/
* Receiving
*/
protected Iterator getRequestHeaderNames() throws IOException {
try {

View File

@@ -45,6 +45,7 @@ import javax.mail.search.SearchTerm;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.Assert;
import org.springframework.ws.WebServiceMessage;
import org.springframework.ws.transport.AbstractSenderConnection;
@@ -92,9 +93,7 @@ public class MailSenderConnection extends AbstractSenderConnection {
private Folder folder;
/**
* Constructs a new Mail connection with the given parameters.
*/
/** Constructs a new Mail connection with the given parameters. */
protected MailSenderConnection(Session session,
URLName transportUri,
URLName storeUri,
@@ -111,16 +110,12 @@ public class MailSenderConnection extends AbstractSenderConnection {
this.receiveTimeout = receiveTimeout;
}
/**
* Returns the request message for this connection.
*/
/** Returns the request message for this connection. */
public Message getRequestMessage() {
return requestMessage;
}
/**
* Returns the response message, if any, for this connection.
*/
/** Returns the response message, if any, for this connection. */
public Message getResponseMessage() {
return responseMessage;
}
@@ -287,7 +282,7 @@ public class MailSenderConnection extends AbstractSenderConnection {
return null;
}
public void close() throws IOException {
public void onClose() throws IOException {
MailTransportUtils.closeFolder(folder, deleteAfterReceive);
MailTransportUtils.closeService(store);
}