|
XCC/J 3.2-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface defines a provider of Sockets
for a ContentSource.
Policies such as load
balancing or failover can be implemented by
supplying a custom ConnectionProvider.
| Method Summary | |
ServerConnection |
obtainConnection(Session session,
Logger logger)
Provide a ServerConnection) that is
open and ready to communicate with the server. |
void |
returnConnection(ServerConnection connection,
Logger logger)
Return a ServerConnection object (obtained from a previous
call to obtainConnection(com.marklogic.xcc.Session,java.util.logging.Logger))
to the provider, possibly to be pooled and re-used. |
ConnectionErrorAction |
returnErrorConnection(ServerConnection connection,
Throwable exception,
Logger logger)
Return a connection that experienced an error. |
void |
shutdown(Logger logger)
Tell the provider to shutdown and release any resources being used. |
| Method Detail |
public ServerConnection obtainConnection(Session session,
Logger logger)
throws IOException
ServerConnection) that is
open and ready to communicate with the server.
session - The Session requesting a connection.logger - A Logger instance to use.
ServerConnection object.
IOException - If an underlying connection cannot be created.
public void returnConnection(ServerConnection connection,
Logger logger)
ServerConnection object (obtained from a previous
call to obtainConnection(com.marklogic.xcc.Session,java.util.logging.Logger))
to the provider, possibly to be pooled and re-used.
If the connection has a non-zero timeout value set
(ServerConnection.setTimeoutMillis(long)),
that value will inform the provider to
discard the object after that amount of time has elapsed.
connection - A previously obtained ServerConnection instance.logger - A Logger instance to use.
public ConnectionErrorAction returnErrorConnection(ServerConnection connection,
Throwable exception,
Logger logger)
connection - A previously obtained ServerConnection instance.exception - The (possibly null) exception that occurred. The
provider may wish to decide which action to recommend depending
on the type of exception.logger - A Logger instance to use.
ConnectionErrorAction instance that
advises the client which action to take.public void shutdown(Logger logger)
logger - A Logger instance to use.
|
XCC/J 3.2-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com