com.sun.sgs.impl.service.channel
Class ChannelImpl.ChannelEvent

java.lang.Object
  extended by com.sun.sgs.impl.service.channel.ChannelImpl.ChannelEvent
All Implemented Interfaces:
ManagedObject, Serializable
Direct Known Subclasses:
ChannelImpl.SendEvent
Enclosing class:
ChannelImpl

abstract static class ChannelImpl.ChannelEvent
extends Object
implements ManagedObject, Serializable

Represents an event on a channel.


Field Summary
protected  long timestamp
          This event's timestamp.
 
Constructor Summary
ChannelImpl.ChannelEvent(long timestamp)
          Constructs an instance with the specified timestamp
 
Method Summary
(package private)  boolean completed()
          Marks this event as completed.
(package private)  int getCost()
          Returns the cost of this event, which the EventQueue may use to reject events when the total cost is too large.
(package private)  boolean isCompleted()
          Returns true if this event is completed and it is safe to service the next event in the queue, otherwise returns false.
(package private)  boolean isProcessing()
          Returns true if this event is being processed on this node, and false otherwise.
(package private)  void processing()
          Marks this event as being processed on the local node.
(package private) abstract  boolean serviceEvent(ChannelImpl channel)
          Services this event (taken from the head of the event queue) for the specified channel, and returns true if the event has completed processing and can be removed from the event queue.
protected  String toStringFieldsOnly()
          Returns a string representation of field:value pairs, separated by commas.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timestamp

protected final long timestamp
This event's timestamp.

Constructor Detail

ChannelImpl.ChannelEvent

ChannelImpl.ChannelEvent(long timestamp)
Constructs an instance with the specified timestamp

Method Detail

serviceEvent

abstract boolean serviceEvent(ChannelImpl channel)
Services this event (taken from the head of the event queue) for the specified channel, and returns true if the event has completed processing and can be removed from the event queue.


getCost

int getCost()
Returns the cost of this event, which the EventQueue may use to reject events when the total cost is too large. The default implementation returns a cost of zero.

Returns:
the cost of this event

processing

void processing()
Marks this event as being processed on the local node.


completed

boolean completed()
Marks this event as completed.


isProcessing

boolean isProcessing()
Returns true if this event is being processed on this node, and false otherwise. Events are marked as processing on a given node. Therefore, if this event is marked as processing on a given coordinator node, and the channel's coordinator is reassigned to another node and the coordinator subsequently invokes this method on this event, the method will return false. This indicates that the event has not yet started processing on the new coordinator's node, and the coordinator should (re)start this event's processing on the new node.


isCompleted

boolean isCompleted()
Returns true if this event is completed and it is safe to service the next event in the queue, otherwise returns false.


toStringFieldsOnly

protected String toStringFieldsOnly()
Returns a string representation of field:value pairs, separated by commas.


RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved