danny 2003/01/07 03:57:25
Modified: src/java/org/apache/james/mailrepository
AvalonMailRepository.java
AvalonSpoolRepository.java JDBCMailRepository.java
src/java/org/apache/james James.java
src/java/org/apache/james/transport JamesSpoolManager.java
LinearProcessor.java
src/java/org/apache/mailet MailRepository.java
src/java/org/apache/james/util/mordred PoolConnEntry.java
Log:
MailetAPI refactorings
removed refrences to MailImpl from MailRepository and fixed references broken by the
change
Revision Changes Path
1.24 +4 -4
jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java
Index: AvalonMailRepository.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- AvalonMailRepository.java 7 Jan 2003 11:25:26 -0000 1.23
+++ AvalonMailRepository.java 7 Jan 2003 11:57:25 -0000 1.24
@@ -318,14 +318,14 @@
* @param key the key of the message to retrieve
* @return the mail corresponding to this key, null if none exists
*/
- public MailImpl retrieve(String key) {
+ public Mail retrieve(String key) {
if ((DEEP_DEBUG) && (getLogger().isDebugEnabled())) {
getLogger().debug("Retrieving mail: " + key);
}
try {
- MailImpl mc = null;
+ Mail mc = null;
try {
- mc = (MailImpl) or.get(key);
+ mc = (Mail) or.get(key);
} catch (RuntimeException re) {
StringBuffer exceptionBuffer =
new StringBuffer(128)
@@ -351,7 +351,7 @@
*
* @param mail the message to be removed from the repository
*/
- public void remove(MailImpl mail) {
+ public void remove(Mail mail) {
remove(mail.getName());
}
1.9 +1 -1
jakarta-james/src/java/org/apache/james/mailrepository/AvalonSpoolRepository.java
Index: AvalonSpoolRepository.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/AvalonSpoolRepository.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AvalonSpoolRepository.java 6 Jan 2003 12:38:04 -0000 1.8
+++ AvalonSpoolRepository.java 7 Jan 2003 11:57:25 -0000 1.9
@@ -109,7 +109,7 @@
// Retrieve can return null if the mail is no longer in the
store.
// In this case we simply continue to the next key
- MailImpl mail = retrieve(s);
+ Mail mail = retrieve(s);
if (mail == null) {
continue;
}
1.34 +2 -2
jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java
Index: JDBCMailRepository.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- JDBCMailRepository.java 7 Jan 2003 11:25:27 -0000 1.33
+++ JDBCMailRepository.java 7 Jan 2003 11:57:25 -0000 1.34
@@ -622,7 +622,7 @@
* @param key the key of the message to retrieve
* @return the mail corresponding to this key, null if none exists
*/
- public MailImpl retrieve(String key) {
+ public Mail retrieve(String key) {
if (DEEP_DEBUG) {
System.err.println("retrieving " + key);
}
@@ -704,7 +704,7 @@
*
* @param mail the message to be removed from the repository
*/
- public void remove(MailImpl mail) {
+ public void remove(Mail mail) {
remove(mail.getName());
}
1.40 +5 -5 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.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- James.java 7 Jan 2003 11:06:35 -0000 1.39
+++ James.java 7 Jan 2003 11:57:25 -0000 1.40
@@ -462,12 +462,12 @@
* on the spool
*/
public void sendMail(Mail mail) throws MessagingException {
- MailImpl mailimpl = (MailImpl)mail;
+
try {
- spool.store(mailimpl);
+ spool.store(mail);
} catch (Exception e) {
try {
- spool.remove(mailimpl);
+ spool.remove(mail);
} catch (Exception ignored) {
}
throw new MessagingException("Exception spooling message: " +
e.getMessage(), e);
@@ -476,7 +476,7 @@
StringBuffer logBuffer =
new StringBuffer(64)
.append("Mail ")
- .append(mailimpl.getName())
+ .append(mail.getName())
.append(" pushed in spool");
getLogger().debug(logBuffer.toString());
}
1.23 +3 -3
jakarta-james/src/java/org/apache/james/transport/JamesSpoolManager.java
Index: JamesSpoolManager.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/transport/JamesSpoolManager.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- JamesSpoolManager.java 6 Jan 2003 17:08:47 -0000 1.22
+++ JamesSpoolManager.java 7 Jan 2003 11:57:25 -0000 1.23
@@ -302,7 +302,7 @@
while(true) {
try {
String key = spool.accept();
- MailImpl mail = spool.retrieve(key);
+ Mail mail = spool.retrieve(key);
// Retrieve can return null if the mail is no longer on the spool
// (i.e. another thread has gotten to it first).
// In this case we simply continue to the next key
@@ -356,7 +356,7 @@
*
* @param mail the mail message to be processed
*/
- protected void process(MailImpl mail) {
+ protected void process(Mail mail) {
while (true) {
String processorName = mail.getState();
if (processorName.equals(Mail.GHOST)) {
1.13 +3 -3
jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java
Index: LinearProcessor.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- LinearProcessor.java 6 Jan 2003 17:08:47 -0000 1.12
+++ LinearProcessor.java 7 Jan 2003 11:57:25 -0000 1.13
@@ -231,7 +231,7 @@
* @throws IllegalStateException when this method is called before the
processor lists have been closed
* or the spool has been initialized
*/
- public void service(MailImpl mail) throws MessagingException {
+ public void service(Mail mail) throws MessagingException {
if (spool == null) {
throw new IllegalStateException("Attempt to service mail before the
spool has been set to a non-null value");
}
@@ -347,7 +347,7 @@
// There are a mix of recipients and not recipients.
// We need to clone this message, put the notRecipients on the clone
// and store it in the next spot
- MailImpl notMail = (MailImpl)mail.duplicate(newName(mail));
+ Mail notMail = ((MailImpl)mail).duplicate(newName(mail));
notMail.setRecipients(notRecipients);
unprocessed[i + 1].add(notMail);
//We have to set the reduce possible recipients on the old message
@@ -402,7 +402,7 @@
*
* @return a new name
*/
- private String newName(MailImpl mail) {
+ private String newName(Mail mail) {
StringBuffer nameBuffer =
new StringBuffer(64)
.append(mail.getName())
1.3 +2 -4 jakarta-james/src/java/org/apache/mailet/MailRepository.java
Index: MailRepository.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/mailet/MailRepository.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MailRepository.java 7 Jan 2003 11:25:28 -0000 1.2
+++ MailRepository.java 7 Jan 2003 11:57:25 -0000 1.3
@@ -7,8 +7,6 @@
*/
package org.apache.mailet;
-import org.apache.james.core.MailImpl;
-
import java.util.Iterator;
/**
@@ -49,14 +47,14 @@
* @param key the key of the message to retrieve
* @return the mail corresponding to this key, null if none exists
*/
- MailImpl retrieve(String key);
+ Mail retrieve(String key);
/**
* Removes a specified message
*
* @param mail the message to be removed from the repository
*/
- void remove(MailImpl mail);
+ void remove(Mail mail);
/**
* Removes a message identified by key.
1.8 +1 -1
jakarta-james/src/java/org/apache/james/util/mordred/PoolConnEntry.java
Index: PoolConnEntry.java
===================================================================
RCS file:
/home/cvs/jakarta-james/src/java/org/apache/james/util/mordred/PoolConnEntry.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PoolConnEntry.java 6 Jan 2003 17:08:50 -0000 1.7
+++ PoolConnEntry.java 7 Jan 2003 11:57:25 -0000 1.8
@@ -415,6 +415,6 @@
{
throw new SQLException("This is not a Jdbc 3.0 Compliant Connection");
}
- JDBC_3_ANT_KEY */
+ JDBC_3_ANT_KEY */
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>