|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FolderGateKeeper
offers access to an underlaying Folder and manages open/close operations.
The FolderGateKeeper can be handed over to different threads.
Clients have to call use() one time before and free() one time after they are
operating on the folder. When use() has been called free() has to be called
afterwards in any circumstance usally in a finally block.
try { use(); getFolder().doSomething(); getFolder().doSomething(); } finally { free(); }It is not allowed to open/close Folder from outside.
Method Summary | |
---|---|
void |
create(int holds_folders)
|
boolean |
exists()
|
void |
free()
decrements count of users and closes folder if 0 and folder is open. |
FolderInterface |
getFolder()
Gets the Folder and don't care whether it is open or closed. |
java.lang.String |
getFullName()
|
FolderInterface |
getOpenFolder()
Gets the Folder and opens it, if necessary |
int |
getUseCount()
used to test whether everyone has freed it |
void |
renameTo(javax.mail.Folder folder)
|
void |
renameTo(java.lang.String newName)
|
void |
use()
increments count of users |
Method Detail |
---|
void use()
void free() throws javax.mail.MessagingException
javax.mail.MessagingException
- if something went wrong closing the Folder
java.lang.IllegalStateException
- if there are already 0 users
java.lang.IllegalStateException
- if the state of the folder differs from the last knownFolderInterface getOpenFolder() throws javax.mail.MessagingException
javax.mail.MessagingException
- if something went wron opening the Folder
java.lang.IllegalStateException
- if the state of the folder differs from the last known
java.lang.IllegalStateException
- if there are only 0 usersint getUseCount()
FolderInterface getFolder()
java.lang.IllegalStateException
- if the state of the folder differs from the last known
java.lang.IllegalStateException
- if there are only 0 usersjava.lang.String getFullName() throws javax.mail.MessagingException
javax.mail.MessagingException
Folder.getFullName()
void create(int holds_folders) throws javax.mail.MessagingException
javax.mail.MessagingException
Folder
boolean exists() throws javax.mail.MessagingException
javax.mail.MessagingException
Folder.exists()
void renameTo(javax.mail.Folder folder) throws javax.mail.MessagingException
javax.mail.MessagingException
Folder.renameTo(Folder)
void renameTo(java.lang.String newName) throws javax.mail.MessagingException
javax.mail.MessagingException
Folder.renameTo(Folder)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |