|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.geronimo.javamail.store.imap.connection.IMAPConnectionPool
public class IMAPConnectionPool
Field Summary | |
---|---|
protected String |
authid
|
protected List |
availableConnections
|
protected Map |
capabilities
|
protected boolean |
closed
|
protected boolean |
debug
|
protected boolean |
dedicatedStoreConnection
|
protected static String |
DEFAULT_MAIL_HOST
|
protected static int |
DEFAULT_POOL_TIMEOUT
|
protected String |
host
|
protected static String |
MAIL_AUTHORIZATIONID
|
protected static String |
MAIL_POOL_SIZE
|
protected static String |
MAIL_POOL_TIMEOUT
|
protected static String |
MAIL_PORT
|
protected static String |
MAIL_SASL_REALM
|
protected static String |
MAIL_SEPARATE_STORE_CONNECTION
|
protected static int |
MAX_CONNECTION_RETRIES
|
protected static int |
MAX_POOL_WAIT
|
protected String |
password
|
protected List |
poolConnections
|
protected int |
poolSize
|
protected long |
poolTimeout
|
protected int |
port
|
protected ProtocolProperties |
props
|
protected String |
realm
|
protected IMAPStore |
store
|
protected IMAPConnection |
storeConnection
|
protected String |
username
|
Constructor Summary | |
---|---|
IMAPConnectionPool(IMAPStore store,
ProtocolProperties props)
Create a connection pool associated with a give IMAPStore instance. |
Method Summary | |
---|---|
void |
close()
Close the entire connection pool. |
protected void |
closeStaleConnections()
Flush any connections from the pool that have not been used for at least the connection pool timeout interval. |
protected IMAPConnection |
createPoolConnection()
Creates an authenticated pool connection and adds it to the connection pool. |
protected void |
freeAllConnections()
Cleanup time. |
protected IMAPConnection |
getConnection()
Get a connection from the pool. |
IMAPConnection |
getFolderConnection()
Get a connection for Folder. |
protected IMAPConnection |
getPoolConnection()
Obtain a connection from the existing connection pool. |
IMAPConnection |
getStoreConnection()
Get a connection for the Store. |
boolean |
hasCapability(String capability)
Test if this connection has a given capability. |
boolean |
protocolConnect(String host,
int port,
String username,
String password)
Manage the initial connection to the IMAP server. |
protected void |
releaseConnection(IMAPConnection connection)
Return a connection back to the connection pool. |
void |
releaseFolderConnection(IMAPConnection connection)
Return a Folder connection to the connection pool. |
protected void |
releasePoolConnection(IMAPConnection connection)
Release a closed connection. |
void |
releaseStoreConnection(IMAPConnection connection)
Return the Store connection to the connection pool. |
protected void |
returnPoolConnection(IMAPConnection connection)
Return a connection to the connection pool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String MAIL_PORT
protected static final String MAIL_POOL_SIZE
protected static final String MAIL_POOL_TIMEOUT
protected static final String MAIL_SEPARATE_STORE_CONNECTION
protected static final String MAIL_SASL_REALM
protected static final String MAIL_AUTHORIZATIONID
protected static final int DEFAULT_POOL_TIMEOUT
protected static final String DEFAULT_MAIL_HOST
protected static final int MAX_CONNECTION_RETRIES
protected static final int MAX_POOL_WAIT
protected IMAPStore store
protected ProtocolProperties props
protected List poolConnections
protected List availableConnections
protected IMAPConnection storeConnection
protected boolean dedicatedStoreConnection
protected int poolSize
protected long poolTimeout
protected boolean debug
protected String host
protected int port
protected String username
protected String password
protected String realm
protected String authid
protected boolean closed
protected Map capabilities
Constructor Detail |
---|
public IMAPConnectionPool(IMAPStore store, ProtocolProperties props)
store
- The Store we're creating the pool for.props
- The property bundle that defines protocol properties
that alter the connection behavior.Method Detail |
---|
public boolean protocolConnect(String host, int port, String username, String password) throws MessagingException
host
- The host of the IMAP server.port
- The IMAP server connection port.user
- The connection user name.password
- The connection password.
MessagingException
protected IMAPConnection createPoolConnection() throws MessagingException
MessagingException
protected IMAPConnection getConnection() throws MessagingException
MessagingException
protected IMAPConnection getPoolConnection() throws MessagingException
MessagingException
protected void returnPoolConnection(IMAPConnection connection) throws MessagingException
connection
- The connection getting returned.
MessagingException
protected void releasePoolConnection(IMAPConnection connection) throws MessagingException
connection
- The connection getting released.
MessagingException
public IMAPConnection getStoreConnection() throws MessagingException
MessagingException
public void releaseStoreConnection(IMAPConnection connection) throws MessagingException
connection
- The connection getting returned.
MessagingException
public IMAPConnection getFolderConnection() throws MessagingException
MessagingException
public void releaseFolderConnection(IMAPConnection connection) throws MessagingException
connection
- The connection getting returned.
MessagingException
public void close() throws MessagingException
MessagingException
protected void closeStaleConnections()
protected void releaseConnection(IMAPConnection connection)
connection
- The returned connection.protected void freeAllConnections()
public boolean hasCapability(String capability)
capability
- The capability name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |