Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.synchrona.jred.irlap
Class IrLAPState  view IrLAPState download IrLAPState.java

java.lang.Object
  extended bycom.synchrona.jred.irlap.IrLAPState
Direct Known Subclasses:
IrLAPStateConnect, IrLAPStateNDM, IrLAPStateQuery, IrLAPStateReceive, IrLAPStateReply, IrLAPStateSetup

class IrLAPState
extends java.lang.Object

IrLAPState is a base class for all of the IrLAP states. You shouldn't use this in production, but it provides stub implementations of the event handlers so you can see what's going on (or at least get some indication when something that you aren't expecting happens).

IrLAPState is part of the implementation of the ObjectsAsStates pattern, which can be found in the Gang of Four book. IrLAPContext provides access to variables that are shared by all states, as well as methods to change state and respond to events.

IrLAPState also implements the Singleton pattern. There is at most one instance of each subclass of IrLAPState.


Field Summary
protected  com.synchrona.util.Log m_log
           
private static IrLAPState s_instance
           
 
Constructor Summary
protected IrLAPState()
           
 
Method Summary
 void connectResponse(IrLAPContext context, int nDestination, byte yConnection, byte[] ayParameters)
           
 void debug(java.lang.String strCategory, java.lang.String strMessage)
           
 void discoveryRequest(IrLAPContext context)
           
static IrLAPState getInstance()
           
 void handleData(IrLAPContext context, byte yConnection, int nNr, boolean bCommand, boolean bPoll, byte[] ayData)
          Somebody has sent us data.
 void handleDataRequest(IrLAPContext context, byte ayData, int nOffset, int nLength)
          An IrLAP service user wants to send data to an IrLAP client.
 void handleDisconnect(IrLAPContext context, int nSource, byte yConnection)
           
 void handleFTimerExpired(IrLAPContext context)
           
 void handlePTimerExpired(IrLAPContext context)
           
 void handleQueryTimerExpired(IrLAPContext context)
           
 void handleRR(IrLAPContext context, byte yConnection, int nNr, boolean bCommand, boolean bPoll)
           
 void handleSNRM(IrLAPContext context, int nSource, int nDestination, byte yConnection, byte[] ayParameters)
           
 void handleUA(IrLAPContext context, byte[] ayParams, int nOffset, int nLength)
           
 void handleWatchdogTimerExpired(IrLAPContext context)
           
 void handleXID(IrLAPContext context, int nSource, int nDestination, byte ySlot, boolean bCommand, byte[] ayHints)
           
protected  void logIfEnabled(java.lang.String strMessage)
           
 void setLog(com.synchrona.util.Log log)
           
 void setLog(java.io.PrintWriter log)
           
 void setLogging(boolean bDoLogging)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_log

protected com.synchrona.util.Log m_log

s_instance

private static IrLAPState s_instance
Constructor Detail

IrLAPState

protected IrLAPState()
Method Detail

getInstance

public static IrLAPState getInstance()

connectResponse

public void connectResponse(IrLAPContext context,
                            int nDestination,
                            byte yConnection,
                            byte[] ayParameters)
                     throws java.lang.Exception

discoveryRequest

public void discoveryRequest(IrLAPContext context)
                      throws java.lang.Exception

handleData

public void handleData(IrLAPContext context,
                       byte yConnection,
                       int nNr,
                       boolean bCommand,
                       boolean bPoll,
                       byte[] ayData)
                throws java.lang.Exception
Somebody has sent us data.


handleDataRequest

public void handleDataRequest(IrLAPContext context,
                              byte ayData,
                              int nOffset,
                              int nLength)
                       throws java.lang.Exception
An IrLAP service user wants to send data to an IrLAP client.


handleDisconnect

public void handleDisconnect(IrLAPContext context,
                             int nSource,
                             byte yConnection)
                      throws java.lang.Exception

handleFTimerExpired

public void handleFTimerExpired(IrLAPContext context)
                         throws java.lang.Exception

handlePTimerExpired

public void handlePTimerExpired(IrLAPContext context)
                         throws java.lang.Exception

handleQueryTimerExpired

public void handleQueryTimerExpired(IrLAPContext context)
                             throws java.lang.Exception

handleRR

public void handleRR(IrLAPContext context,
                     byte yConnection,
                     int nNr,
                     boolean bCommand,
                     boolean bPoll)
              throws java.lang.Exception

handleSNRM

public void handleSNRM(IrLAPContext context,
                       int nSource,
                       int nDestination,
                       byte yConnection,
                       byte[] ayParameters)
                throws java.lang.Exception

handleUA

public void handleUA(IrLAPContext context,
                     byte[] ayParams,
                     int nOffset,
                     int nLength)
              throws java.lang.Exception

handleWatchdogTimerExpired

public void handleWatchdogTimerExpired(IrLAPContext context)
                                throws java.lang.Exception

handleXID

public void handleXID(IrLAPContext context,
                      int nSource,
                      int nDestination,
                      byte ySlot,
                      boolean bCommand,
                      byte[] ayHints)
               throws java.lang.Exception

debug

public void debug(java.lang.String strCategory,
                  java.lang.String strMessage)

setLog

public void setLog(com.synchrona.util.Log log)

setLog

public void setLog(java.io.PrintWriter log)

setLogging

public void setLogging(boolean bDoLogging)

logIfEnabled

protected void logIfEnabled(java.lang.String strMessage)
                     throws java.lang.Exception