public class SessionPoolImpl extends java.lang.Object implements SessionPool, StatsViewer
| Modifier and Type | Method and Description |
|---|---|
void |
clean()
Close all open sessions, then open the same number of sessions that
were closed.
|
void |
empty()
Close all sessions in the pool, then remove references to those
sessions.
|
long |
getAverageResponseTime()
Get the average response time (in milliseconds) of all transactions.
|
long |
getAverageResponseTime(CommandType type)
Get the average response time (in milliseconds) of transactions of the
given command type.
|
long |
getCommandCount()
Get the number of commands of the given type that the Session(s)
associated with this viewer has/have processed since creation.
|
long |
getCommandCount(CommandType type)
Get the total number of commands processed by Sessions associated with
this StatsViewer.
|
Greeting |
getLastGreeting()
Pull a greeting from the pool, forcing initialisation of the pool if a greeting has not yet been received.
|
long |
getMruInterval()
Get the time interval since the most recent use of a Session associated
with this StatsViewer.
|
int |
getRecentCommandCount()
Get the number of commands of the given type that the Session(s)
associated with this viewer has/have processed recently (default: 1
second).
|
int |
getRecentCommandCount(CommandType type)
Get the total number of commands recently processed by Sessions
associated with this StatsViewer.
|
long |
getResultCodeCount(int resultCode)
Get the number of responses received having the given result code.
|
Session |
getSession()
Get the most suitable session from the pool.
|
Session |
getSession(CommandType commandType)
Get the most suitable session from the pool based on the type of the
command to be sent over that session.
|
StatsViewer |
getStatsViewer()
Get the StatsViewer responsible for reporting operating statistics
about the sessions in the pool.
|
long |
keepAlive()
Keep a single session in the pool open by polling the EPP server at
regular intervals.
|
void |
releaseSession(Session session)
Release back to the pool a session acquired using getSession.
|
void |
setMaxSize(int size)
Set the maximum number of sessions allowed in the pool to the
specified value.
|
public void setMaxSize(int size)
SessionPoolsetMaxSize in interface SessionPoolpublic Greeting getLastGreeting() throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
getLastGreeting in interface SessionPoolSessionConfigurationExceptionSessionOpenExceptionjava.lang.InterruptedExceptionpublic long keepAlive()
throws java.io.IOException
SessionPoolkeepAlive in interface SessionPooljava.io.IOException - See Session.keepAlive.public void empty()
SessionPoolempty in interface SessionPoolpublic void clean()
throws SessionConfigurationException,
SessionOpenException
SessionPoolclean in interface SessionPoolSessionConfigurationExceptionSessionOpenExceptionpublic Session getSession() throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionPoolgetSession in interface SessionPoolSessionConfigurationException - The pool had no available
sessions, so a new session was created but configuration of that
session failed due to invalid session properties.SessionOpenException - The pool had no available sessions, and so
tried to open a new session which was successfully configured, but
failed to open. It should be expected that further requests to get a
session will fail.java.lang.InterruptedExceptionpublic Session getSession(CommandType commandType) throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionPoolgetSession in interface SessionPoolSessionConfigurationExceptionSessionOpenExceptionjava.lang.InterruptedExceptionpublic void releaseSession(Session session)
SessionPoolreleaseSession in interface SessionPoolpublic StatsViewer getStatsViewer()
SessionPoolgetStatsViewer in interface SessionPoolpublic int getRecentCommandCount()
StatsViewergetRecentCommandCount in interface StatsViewerpublic long getCommandCount()
StatsViewergetCommandCount in interface StatsViewerpublic int getRecentCommandCount(CommandType type)
StatsViewergetRecentCommandCount in interface StatsViewerpublic long getCommandCount(CommandType type)
StatsViewergetCommandCount in interface StatsViewerpublic long getAverageResponseTime(CommandType type)
StatsViewergetAverageResponseTime in interface StatsViewerpublic long getAverageResponseTime()
StatsViewergetAverageResponseTime in interface StatsViewerpublic long getMruInterval()
StatsViewergetMruInterval in interface StatsViewerpublic long getResultCodeCount(int resultCode)
StatsViewergetResultCodeCount in interface StatsViewer