com.caucho.bam
Class AbstractBamService

java.lang.Object
  extended by com.caucho.bam.AbstractBamService
All Implemented Interfaces:
BamService
Direct Known Subclasses:
SimpleBamService

public abstract class AbstractBamService
extends java.lang.Object
implements BamService

Configuration for a service


Constructor Summary
AbstractBamService()
           
 
Method Summary
 BamStream getAgentFilter(BamStream stream)
          Creates an outbound filter
abstract  BamStream getAgentStream()
          Returns the stream to the service's agent
 BamStream getBrokerFilter(BamStream stream)
          Creates an inbound filter
 java.lang.String getJid()
          Returns the jid
protected  java.lang.String logData(java.io.Serializable[] data)
           
protected  java.lang.String logValue(java.io.Serializable value)
           
 void onAgentStart(java.lang.String jid)
          Called when an agent logs in
 void onAgentStop(java.lang.String jid)
          Called when an agent logs out
 void setJid(java.lang.String jid)
          Sets the service's jid.
 boolean startAgent(java.lang.String jid)
          Requests that an agent with the given jid be started.
 boolean stopAgent(java.lang.String jid)
          Requests that an agent with the given jid be stopped.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractBamService

public AbstractBamService()
Method Detail

setJid

public void setJid(java.lang.String jid)
Description copied from interface: BamService
Sets the service's jid.

Specified by:
setJid in interface BamService

getJid

public java.lang.String getJid()
Returns the jid

Specified by:
getJid in interface BamService

startAgent

public boolean startAgent(java.lang.String jid)
Requests that an agent with the given jid be started.

Specified by:
startAgent in interface BamService

stopAgent

public boolean stopAgent(java.lang.String jid)
Requests that an agent with the given jid be stopped.

Specified by:
stopAgent in interface BamService

getAgentStream

public abstract BamStream getAgentStream()
Returns the stream to the service's agent

Specified by:
getAgentStream in interface BamService

getAgentFilter

public BamStream getAgentFilter(BamStream stream)
Creates an outbound filter

Specified by:
getAgentFilter in interface BamService

getBrokerFilter

public BamStream getBrokerFilter(BamStream stream)
Creates an inbound filter

Specified by:
getBrokerFilter in interface BamService

onAgentStart

public void onAgentStart(java.lang.String jid)
Called when an agent logs in

Specified by:
onAgentStart in interface BamService

onAgentStop

public void onAgentStop(java.lang.String jid)
Called when an agent logs out

Specified by:
onAgentStop in interface BamService

logValue

protected java.lang.String logValue(java.io.Serializable value)

logData

protected java.lang.String logData(java.io.Serializable[] data)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object