Package net.timewalker.ffmq4.listeners
Class ClientProcessor
- java.lang.Object
-
- net.timewalker.ffmq4.listeners.ClientProcessor
-
- All Implemented Interfaces:
ClientProcessorMBean,net.timewalker.ffmq4.transport.PacketTransportListener,net.timewalker.ffmq4.utils.watchdog.ActiveObject
public final class ClientProcessor extends Object implements net.timewalker.ffmq4.transport.PacketTransportListener, net.timewalker.ffmq4.utils.watchdog.ActiveObject, ClientProcessorMBean
ClientProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected net.timewalker.ffmq4.transport.PacketTransporttransport
-
Constructor Summary
Constructors Constructor Description ClientProcessor(String id, AbstractClientListener parentListener, net.timewalker.ffmq4.local.FFMQEngine engine, net.timewalker.ffmq4.transport.PacketTransport transport)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetClientID()Get the client IDDategetConnectionDate()Get the client last activity timestampintgetConsumersCount()Get the number of consumers in use for this clientStringgetEntitiesDescription()Get a description of entities held by this clientlonggetLastActivity()StringgetPeerDescription()Get the client peer descriptionintgetProducersCount()Get the number of producers in use for this clientintgetSessionsCount()Get the number of sessions in use for this clientlonggetTimeoutDelay()booleanisAuthenticated()Test if the client is authenticatedbooleanonActivityTimeout()booleanpacketReceived(net.timewalker.ffmq4.transport.packet.AbstractPacket packet)voidpacketSent(net.timewalker.ffmq4.transport.packet.AbstractPacket packet)protected net.timewalker.ffmq4.transport.packet.AbstractResponsePacketprocess(net.timewalker.ffmq4.transport.packet.AbstractQueryPacket query)Process an incoming packetvoidstart()Start the processorvoidstop()Stop the processorvoidtransportClosed(boolean closedByRemotePeer, boolean mayBlock)
-
-
-
Constructor Detail
-
ClientProcessor
public ClientProcessor(String id, AbstractClientListener parentListener, net.timewalker.ffmq4.local.FFMQEngine engine, net.timewalker.ffmq4.transport.PacketTransport transport)
Constructor
-
-
Method Detail
-
getClientID
public String getClientID()
Description copied from interface:ClientProcessorMBeanGet the client ID- Specified by:
getClientIDin interfaceClientProcessorMBean- Returns:
- the client ID
-
getPeerDescription
public String getPeerDescription()
Description copied from interface:ClientProcessorMBeanGet the client peer description- Specified by:
getPeerDescriptionin interfaceClientProcessorMBean- Returns:
- the client peer description
-
isAuthenticated
public boolean isAuthenticated()
Description copied from interface:ClientProcessorMBeanTest if the client is authenticated- Specified by:
isAuthenticatedin interfaceClientProcessorMBean- Returns:
- true if the client is authenticated
-
getSessionsCount
public int getSessionsCount()
Description copied from interface:ClientProcessorMBeanGet the number of sessions in use for this client- Specified by:
getSessionsCountin interfaceClientProcessorMBean- Returns:
- the number of sessions in use for this client
-
getProducersCount
public int getProducersCount()
Description copied from interface:ClientProcessorMBeanGet the number of producers in use for this client- Specified by:
getProducersCountin interfaceClientProcessorMBean- Returns:
- the number of producers in use for this client
-
getConsumersCount
public int getConsumersCount()
Description copied from interface:ClientProcessorMBeanGet the number of consumers in use for this client- Specified by:
getConsumersCountin interfaceClientProcessorMBean- Returns:
- the number of consumers in use for this client
-
getEntitiesDescription
public String getEntitiesDescription()
Description copied from interface:ClientProcessorMBeanGet a description of entities held by this client- Specified by:
getEntitiesDescriptionin interfaceClientProcessorMBean- Returns:
- a description of entities held by this client
-
start
public void start() throws net.timewalker.ffmq4.transport.PacketTransportExceptionStart the processor- Throws:
net.timewalker.ffmq4.transport.PacketTransportException
-
stop
public void stop()
Stop the processor
-
getLastActivity
public long getLastActivity()
- Specified by:
getLastActivityin interfacenet.timewalker.ffmq4.utils.watchdog.ActiveObject
-
getConnectionDate
public Date getConnectionDate()
Description copied from interface:ClientProcessorMBeanGet the client last activity timestamp- Specified by:
getConnectionDatein interfaceClientProcessorMBean- Returns:
- the client last activity timestamp
-
getTimeoutDelay
public long getTimeoutDelay()
- Specified by:
getTimeoutDelayin interfacenet.timewalker.ffmq4.utils.watchdog.ActiveObject
-
onActivityTimeout
public boolean onActivityTimeout() throws Exception- Specified by:
onActivityTimeoutin interfacenet.timewalker.ffmq4.utils.watchdog.ActiveObject- Throws:
Exception
-
packetReceived
public boolean packetReceived(net.timewalker.ffmq4.transport.packet.AbstractPacket packet)
- Specified by:
packetReceivedin interfacenet.timewalker.ffmq4.transport.PacketTransportListener
-
packetSent
public void packetSent(net.timewalker.ffmq4.transport.packet.AbstractPacket packet)
- Specified by:
packetSentin interfacenet.timewalker.ffmq4.transport.PacketTransportListener
-
transportClosed
public void transportClosed(boolean closedByRemotePeer, boolean mayBlock)- Specified by:
transportClosedin interfacenet.timewalker.ffmq4.transport.PacketTransportListener
-
process
protected net.timewalker.ffmq4.transport.packet.AbstractResponsePacket process(net.timewalker.ffmq4.transport.packet.AbstractQueryPacket query) throws javax.jms.JMSExceptionProcess an incoming packet- Throws:
javax.jms.JMSException
-
-