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)
SessionPool
setMaxSize
in interface SessionPool
public Greeting getLastGreeting() throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
getLastGreeting
in interface SessionPool
SessionConfigurationException
SessionOpenException
java.lang.InterruptedException
public long keepAlive() throws java.io.IOException
SessionPool
keepAlive
in interface SessionPool
java.io.IOException
- See Session.keepAlive.public void empty()
SessionPool
empty
in interface SessionPool
public void clean() throws SessionConfigurationException, SessionOpenException
SessionPool
clean
in interface SessionPool
SessionConfigurationException
SessionOpenException
public Session getSession() throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionPool
getSession
in interface SessionPool
SessionConfigurationException
- 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.InterruptedException
public Session getSession(CommandType commandType) throws SessionConfigurationException, SessionOpenException, java.lang.InterruptedException
SessionPool
getSession
in interface SessionPool
SessionConfigurationException
SessionOpenException
java.lang.InterruptedException
public void releaseSession(Session session)
SessionPool
releaseSession
in interface SessionPool
public StatsViewer getStatsViewer()
SessionPool
getStatsViewer
in interface SessionPool
public int getRecentCommandCount()
StatsViewer
getRecentCommandCount
in interface StatsViewer
public long getCommandCount()
StatsViewer
getCommandCount
in interface StatsViewer
public int getRecentCommandCount(CommandType type)
StatsViewer
getRecentCommandCount
in interface StatsViewer
public long getCommandCount(CommandType type)
StatsViewer
getCommandCount
in interface StatsViewer
public long getAverageResponseTime(CommandType type)
StatsViewer
getAverageResponseTime
in interface StatsViewer
public long getAverageResponseTime()
StatsViewer
getAverageResponseTime
in interface StatsViewer
public long getMruInterval()
StatsViewer
getMruInterval
in interface StatsViewer
public long getResultCodeCount(int resultCode)
StatsViewer
getResultCodeCount
in interface StatsViewer