|
jremote jbase5.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.jbase.jremote.io.inflow.RequestListenerService
public class RequestListenerService
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
RequestListenerService()
Provided to allow tests to mock out methods of this class |
|
RequestListenerService(RequestProcessingAbstractFactory requestProcessingFactory,
javax.resource.spi.XATerminator xaTerminator,
java.lang.String host,
int port)
Construct service that will not create new threads for client connections. |
|
RequestListenerService(RequestProcessingAbstractFactory requestProcessingFactory,
javax.resource.spi.XATerminator xaTerminator,
javax.resource.spi.work.WorkManager workManager,
java.lang.String host,
int port,
boolean threadPerConnection)
Supply a work manager and optionally create a new thread to handle each client connection. |
Method Summary | |
---|---|
void |
decrementActiveConnections()
|
protected boolean |
doAccept(java.nio.channels.SelectionKey key)
|
protected void |
doClose(java.nio.channels.SelectionKey key)
|
protected boolean |
doRead(java.nio.channels.SelectionKey key)
|
protected boolean |
doWrite(java.nio.channels.SelectionKey key)
|
int |
getActivationsPerMinute()
Returns the number of activation processed per minute from the time statistics were activated. |
int |
getActivationsProcessedInLastMinute(StatisticsCounter statisticType)
|
int |
getActiveConnections()
Return the number clients that are currently connected. |
int |
getActiveTransactions()
Return the number of transactions that are currently being processed. |
int |
getDefaultReceiveBufferSize()
|
int |
getDefaultSendBufferSize()
|
protected double |
getElapsedMinutes(long startedTime)
|
javax.resource.spi.work.ExecutionContext |
getExecutionContext(java.lang.String sessionId)
|
protected long |
getNowTime()
|
protected RequestHandler |
getRequestHandler()
|
long |
getTotalActivations()
Return the total number of activation requests processed. |
javax.resource.spi.work.WorkManager |
getWorkManager()
|
javax.resource.spi.XATerminator |
getXATerminator()
|
void |
incrementActivationCount(StatisticsCounter statisticType)
A RequestHandler is able to call back to this RequestListenerService to track what it considers an activation. |
void |
incrementActiveConnections()
|
boolean |
isListening()
|
boolean |
isRunning()
|
void |
release()
|
javax.resource.spi.work.ExecutionContext |
removeExecutionContext(java.lang.String sessionId)
|
void |
run()
|
void |
send(java.nio.channels.SocketChannel channel,
byte[] response)
|
void |
setDefaultReceiveBufferSize(int bytes)
Modify the TCP buffer settings to maximize the performance for the client network. |
void |
setDefaultSendBufferSize(int bytes)
|
void |
setExecutionContext(java.lang.String sessionId,
javax.resource.spi.work.ExecutionContext ec)
|
void |
setRunning(java.lang.Boolean running)
|
protected void |
startIOListener()
|
protected void |
startListener()
|
protected void |
startNIOListener()
|
void |
startStatistics()
Start recording statistics and reset any existing statistical data. |
void |
stopStatistics()
Stop recording statistics and reset any existing statistical data. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected RequestListenerService()
public RequestListenerService(RequestProcessingAbstractFactory requestProcessingFactory, javax.resource.spi.XATerminator xaTerminator, java.lang.String host, int port)
Construct service that will not create new threads for client connections.
requestProcessingFactory
- xaTerminator
- host
- port
- public RequestListenerService(RequestProcessingAbstractFactory requestProcessingFactory, javax.resource.spi.XATerminator xaTerminator, javax.resource.spi.work.WorkManager workManager, java.lang.String host, int port, boolean threadPerConnection)
Supply a work manager and optionally create a new thread to handle each client connection.
requestProcessingFactory
- xaTerminator
- workManager
- host
- port
- threadPerConnection
- Method Detail |
---|
public boolean isRunning()
public boolean isListening()
public void setRunning(java.lang.Boolean running)
protected RequestHandler getRequestHandler()
public javax.resource.spi.XATerminator getXATerminator()
public javax.resource.spi.work.WorkManager getWorkManager()
public javax.resource.spi.work.ExecutionContext getExecutionContext(java.lang.String sessionId)
public javax.resource.spi.work.ExecutionContext removeExecutionContext(java.lang.String sessionId)
public void setExecutionContext(java.lang.String sessionId, javax.resource.spi.work.ExecutionContext ec)
protected void startListener()
protected void startIOListener() throws java.io.IOException
java.io.IOException
protected void startNIOListener() throws java.io.IOException
java.io.IOException
public void release()
release
in interface javax.resource.spi.work.Work
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
protected boolean doAccept(java.nio.channels.SelectionKey key)
protected boolean doRead(java.nio.channels.SelectionKey key)
protected boolean doWrite(java.nio.channels.SelectionKey key)
protected void doClose(java.nio.channels.SelectionKey key)
public void send(java.nio.channels.SocketChannel channel, byte[] response)
public void incrementActiveConnections()
public void decrementActiveConnections()
public int getActiveConnections()
RequestListenerServiceMBean
Return the number clients that are currently connected.
getActiveConnections
in interface RequestListenerServiceMBean
public void setDefaultReceiveBufferSize(int bytes)
RequestListenerServiceMBean
Modify the TCP buffer settings to maximize the performance for the client network.
setDefaultReceiveBufferSize
in interface RequestListenerServiceMBean
public int getDefaultReceiveBufferSize()
getDefaultReceiveBufferSize
in interface RequestListenerServiceMBean
public void setDefaultSendBufferSize(int bytes)
setDefaultSendBufferSize
in interface RequestListenerServiceMBean
public int getDefaultSendBufferSize()
getDefaultSendBufferSize
in interface RequestListenerServiceMBean
public int getActiveTransactions()
RequestListenerServiceMBean
Return the number of transactions that are currently being processed.
getActiveTransactions
in interface RequestListenerServiceMBean
public long getTotalActivations()
RequestListenerServiceMBean
Return the total number of activation requests processed.
getTotalActivations
in interface RequestListenerServiceMBean
public int getActivationsPerMinute()
RequestListenerServiceMBean
Returns the number of activation processed per minute from the time statistics were activated.
getActivationsPerMinute
in interface RequestListenerServiceMBean
protected double getElapsedMinutes(long startedTime)
protected long getNowTime()
public int getActivationsProcessedInLastMinute(StatisticsCounter statisticType)
public void incrementActivationCount(StatisticsCounter statisticType)
A RequestHandler is able to call back to this RequestListenerService to track what it considers an activation. In general the RequestListenerService knows nothing more than the fact that input is ready for processing. This may be one or more activations, therefore we delegate the responsibility to the RequestHandler.
statistic
- public void startStatistics()
RequestListenerServiceMBean
Start recording statistics and reset any existing statistical data.
startStatistics
in interface RequestListenerServiceMBean
public void stopStatistics()
RequestListenerServiceMBean
Stop recording statistics and reset any existing statistical data.
stopStatistics
in interface RequestListenerServiceMBean
|
jremote jbase5.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |