Appia Documentation

net.sf.appia.core.events
Class SendableEvent

java.lang.Object
  extended by net.sf.appia.core.Event
      extended by net.sf.appia.core.events.SendableEvent
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AckEvent, ConfirmEvent, ExitEvent, FragEvent, GossipOutEvent, GroupSendableEvent, HelloEvent, IgnoreEvent, JGCSSendableEvent, MergeEvent, MyEccoEvent, NackEvent, PingEvent, UpdateEvent

public class SendableEvent
extends Event
implements java.lang.Cloneable

This class defines a SendableEvent

Version:
1.0
Author:
Alexandre Pinto

Field Summary
 java.lang.Object dest
           
protected  Message message
           
 java.lang.Object source
           
 
Fields inherited from class net.sf.appia.core.Event
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY
 
Constructor Summary
SendableEvent()
           
SendableEvent(Channel channel, int dir, Session source)
           
SendableEvent(Channel channel, int dir, Session source, Message msg)
           
SendableEvent(Message msg)
           
 
Method Summary
 Event cloneEvent()
          Clones the sendable event.
 void detachFromMemory()
          Detaches the amount of memory occupied by the Message of This SendableEvent from the MemoryManager.
protected  void finalize()
          Called when the garbage Collector runs and this object is going to be destroyed.
 Message getMessage()
           
 void setChannel(Channel channel)
          Sets the channel of the event.
 void setMessage(Message message)
           
 
Methods inherited from class net.sf.appia.core.Event
asyncGo, currentSession, debug, getChannel, getDir, getPriority, getSchedulerData, getSource, getSourceSession, go, init, isAccepted, popSession, setDir, setPriority, setSchedulerData, setSource, setSourceSession
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dest

public java.lang.Object dest

source

public java.lang.Object source

message

protected Message message
Constructor Detail

SendableEvent

public SendableEvent()

SendableEvent

public SendableEvent(Channel channel,
                     int dir,
                     Session source)
              throws AppiaEventException
Throws:
AppiaEventException

SendableEvent

public SendableEvent(Message msg)

SendableEvent

public SendableEvent(Channel channel,
                     int dir,
                     Session source,
                     Message msg)
              throws AppiaEventException
Throws:
AppiaEventException
Method Detail

getMessage

public Message getMessage()

setMessage

public void setMessage(Message message)

setChannel

public void setChannel(Channel channel)
Description copied from class: Event
Sets the channel of the event.

Overrides:
setChannel in class Event

detachFromMemory

public void detachFromMemory()
Detaches the amount of memory occupied by the Message of This SendableEvent from the MemoryManager. This is used when we need to use flow control in the channel with good performance.
This method is called by the Appia kernel when the event route ends. This method should be called if we want to destroy the event before he reaches the end of his route or if we dont call the go() method in the last session. If this is not done by the protocol programmer, it is done in the finalizer of the message, but the performance is not so good.

See Also:
Message, MemoryManager

cloneEvent

public Event cloneEvent()
                 throws java.lang.CloneNotSupportedException
Clones the sendable event.

Overrides:
cloneEvent in class Event
Returns:
Event
Throws:
java.lang.CloneNotSupportedException
See Also:
Event.cloneEvent()

finalize

protected void finalize()
                 throws java.lang.Throwable
Called when the garbage Collector runs and this object is going to be destroyed.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable
See Also:
Object.finalize()

Appia Documentation

COPYRIGHT 2006-2009, University of Lisbon and INESC-ID
For updates and related information please see Appia Home Page
Send questions, sugestions or remarks to the appia-users mailing list