serge 01/10/24 20:08:41
Modified: src/java/org/apache/james James.java
Log:
Removed synchronization at sendMail method level. The spool should be thread safe
(and need to test that), but James should not lock entire server while message is
being delivered.
Revision Changes Path
1.12 +5 -8 jakarta-james/src/java/org/apache/james/James.java
Index: James.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/James.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- James.java 2001/09/25 16:27:07 1.11
+++ James.java 2001/10/25 03:08:41 1.12
@@ -53,8 +53,8 @@
* @author Serge
* @author <a href="mailto:[EMAIL PROTECTED]">Charles Benett</a>
*
- * This is $Revision: 1.11 $
- * Committed on $Date: 2001/09/25 16:27:07 $ by: $Author: charlesb $
+ * This is $Revision: 1.12 $
+ * Committed on $Date: 2001/10/25 03:08:41 $ by: $Author: serge $
*/
public class James
extends AbstractLoggable
@@ -284,20 +284,18 @@
public void sendMail(MailAddress sender, Collection recipients, MimeMessage
message)
throws MessagingException {
- //FIX ME!!! we should validate here MimeMessage. - why? (SK)
sendMail(sender, recipients, message, Mail.DEFAULT);
}
public void sendMail(MailAddress sender, Collection recipients, MimeMessage
message, String state)
throws MessagingException {
- //FIX ME!!! we should validate here MimeMessage. - why? (SK)
MailImpl mail = new MailImpl(getId(), sender, recipients, message);
mail.setState(state);
sendMail(mail);
}
- public synchronized void sendMail(MailAddress sender, Collection recipients,
InputStream msg)
- throws MessagingException {
+ public void sendMail(MailAddress sender, Collection recipients, InputStream msg)
+ throws MessagingException {
// parse headers
MailHeaders headers = new MailHeaders(msg);
@@ -305,12 +303,11 @@
if (!headers.isValid()) {
throw new MessagingException("Some REQURED header field is missing.
Invalid Message");
}
- // headers.setReceivedStamp("Unknown", (String) serverNames.elementAt(0));
ByteArrayInputStream headersIn = new
ByteArrayInputStream(headers.toByteArray());
sendMail(new MailImpl(getId(), sender, recipients, new
SequenceInputStream(headersIn, msg)));
}
- public synchronized void sendMail(Mail mail) throws MessagingException {
+ public void sendMail(Mail mail) throws MessagingException {
MailImpl mailimpl = (MailImpl)mail;
try {
spool.store(mailimpl);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]