|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.james.test.mock.james.InMemorySpoolRepository
public class InMemorySpoolRepository
Implementation of a MailRepository on a FileSystem. Requires a configuration element in the .conf.xml file of the form: <repository destinationURL="file://path-to-root-dir-for-repository" type="MAIL" model="SYNCHRONOUS"/> Requires a logger called MailRepository.
Field Summary | |
---|---|
protected static boolean |
DEEP_DEBUG
Whether 'deep debugging' is turned on. |
Constructor Summary | |
---|---|
InMemorySpoolRepository()
|
Method Summary | |
---|---|
Mail |
accept()
Returns an arbitrarily selected mail deposited in this Repository. |
Mail |
accept(long delay)
Returns an arbitrarily selected mail deposited in this Repository that is either ready immediately for delivery, or is younger than it's last_updated plus the number of failed attempts times the delay time. |
void |
clear()
|
void |
dispose()
|
java.util.Iterator |
list()
List string keys of messages in repository. |
boolean |
lock(java.lang.String key)
Obtains a lock on a message identified by a key |
void |
remove(Mail mail)
Removes a specified message |
Mail |
retrieve(java.lang.String key)
Retrieves a message given a key. |
int |
size()
|
void |
store(Mail mc)
Stores a message in this repository. |
java.lang.String |
toString()
|
boolean |
unlock(java.lang.String key)
Releases a lock on a message identified by a key |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final boolean DEEP_DEBUG
Constructor Detail |
---|
public InMemorySpoolRepository()
Method Detail |
---|
public boolean unlock(java.lang.String key)
key
- the key of the message to be unlocked
public boolean lock(java.lang.String key)
key
- the key of the message to be locked
public void store(Mail mc) throws javax.mail.MessagingException
mc
- the mail message to store
javax.mail.MessagingException
public Mail retrieve(java.lang.String key) throws javax.mail.MessagingException
key
- the key of the message to retrieve
javax.mail.MessagingException
public void remove(Mail mail) throws javax.mail.MessagingException
mail
- the message to be removed from the repository
javax.mail.MessagingException
public java.util.Iterator list()
Iterator
over the list of keys in the repositorypublic Mail accept() throws java.lang.InterruptedException
Returns an arbitrarily selected mail deposited in this Repository. Usage: SpoolManager calls accept() to see if there are any unprocessed mails in the spool repository.
Synchronized to ensure thread safe access to the underlying spool.
java.lang.InterruptedException
public Mail accept(long delay) throws java.lang.InterruptedException
Returns an arbitrarily selected mail deposited in this Repository that is either ready immediately for delivery, or is younger than it's last_updated plus the number of failed attempts times the delay time. Usage: RemoteDeliverySpool calls accept() with some delay and should block until an unprocessed mail is available.
Synchronized to ensure thread safe access to the underlying spool.
java.lang.InterruptedException
public int size()
public void clear()
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |