sg.edu.nus.peer.event
Class ActionAdapter

java.lang.Object
  extended by sg.edu.nus.peer.event.ActionAdapter
All Implemented Interfaces:
java.util.EventListener, ActionListener
Direct Known Subclasses:
AttachListener, ForceOutListener, JoinListener, LeaveListener, LoginListener, PongListener, RegisterListener, SPDeleteListener, SPInsertBundleListener, SPInsertListener, SPJoinAcceptListener, SPJoinForceForwardListener, SPJoinForceListener, SPJoinListener, SPJoinSplitDataListener, SPLBFindLightlyNodeListener, SPLBGetLoadInfoListener, SPLBGetLoadInfoReplyListener, SPLBGetLoadInfoResendListener, SPLBNoRotationNodeListener, SPLBRotateUpdateAdjacentListener, SPLBRotateUpdateAdjacentReplyListener, SPLBRotateUpdateChildListener, SPLBRotateUpdateChildReplyListener, SPLBRotateUpdateParentListener, SPLBRotateUpdateParentReplyListener, SPLBRotateUpdateRTListener, SPLBRotateUpdateRTReplyListener, SPLBRotationPullListener, SPLBSplitDataListener, SPLBSplitDataResendListener, SPLBStablePositionListener, SPLeaveFindReplaceListener, SPLeaveFindReplaceReplyListener, SPLeaveListener, SPLeaveNotifyListener, SPLeaveReplacementListener, SPLeaveUrgentListener, SPLIAdjacentListener, SPLIAdjacentReplyListener, SPLIAdjacentRootListener, SPLIAdjacentRootReplyListener, SPLIChildReplyListener, SPLIRoutingTableListener, SPLIRoutingTableReplyListener, SPLIUpdateParentListener, SPNotifyFailureListener, SPNotifyImbalanceListener, SPPassClientListener, SPSearchExactBundleListener, SPSearchExactListener, SPSearchExactResultListener, SPSearchPairListener, SPSearchRangeListener, SPSearchRangeResultListener, SPUpdateAdjacentLinkListener, SPUpdateMinMaxValueListener, SPUpdateRouteTableDirectlyListener, SPUpdateRouteTableIndirectlyListener, SPUpdateRouteTableListener, SPUpdateRouteTableReplyListener

public class ActionAdapter
extends java.lang.Object
implements ActionListener

An abstract adapter class for receiving network events. The methods in this class are empty. This class exists as convenience for creating listener objects.

Version:
1.0 2006-1-25
Author:
Xu Linhao

Constructor Summary
ActionAdapter(AbstractMainFrame gui)
           
 
Method Summary
 void actionPerformed(java.io.ObjectOutputStream oos, Message msg)
          Invoked when a networking event occurs.
 boolean isConsumed(Message msg)
          Determine if the listener can consume the network event.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionAdapter

public ActionAdapter(AbstractMainFrame gui)
Method Detail

actionPerformed

public void actionPerformed(java.io.ObjectOutputStream oos,
                            Message msg)
                     throws EventHandleException
Description copied from interface: ActionListener
Invoked when a networking event occurs.

Note: the consumed state should be reset before return a response message.

Specified by:
actionPerformed in interface ActionListener
Parameters:
oos - the output stream used for replying a message to the request peer.
msg - the message to be processed
Throws:
EventHandleException

isConsumed

public boolean isConsumed(Message msg)
                   throws EventHandleException
Description copied from interface: ActionListener
Determine if the listener can consume the network event.

Specified by:
isConsumed in interface ActionListener
Parameters:
msg - the network event
Returns:
if the listener can consume the event, return true; otherwise, return false
Throws:
EventHandleException