com.sun.jini.outrigger
Class WrittenEntry

java.lang.Object
  extended by com.sun.jini.outrigger.WrittenEntry

 class WrittenEntry
extends Object

This class is used to create a singly-linked list of written nodes for notification and searches. When an entry is written, it is added to this list. As each thread interested in recently-written entries works, it has a reference to the WrittenEntry object that mark the last entry the thread examined. When it is done with that entry, it proceeds to the next. As each of these references progresses, the WrittenEntry nodes in the list get left behind to be collected as garbage.

The list initially starts with the return value of startNode, and nodes are added using add. The constructor is private to enforce this usage.

Author:
Sun Microsystems, Inc.
See Also:
OutriggerServerImpl.write(com.sun.jini.outrigger.EntryRep, net.jini.core.transaction.Transaction, long), Notifier

Field Summary
private  WrittenEntry next
          The next node in the list.
private  EntryRep rep
          The EntryRep this node refers to.
private  long timestamp
          The time at which this entry was written.
 
Constructor Summary
private WrittenEntry(EntryRep rep)
          Create a new time-stamped entry for the given EntryRep.
 
Method Summary
(package private)  WrittenEntry add(EntryRep rep)
          Add a new entry after this one.
(package private)  WrittenEntry next()
          Return the next object in the list.
(package private)  EntryRep rep()
          Return the EntryRep of this entry.
(package private) static WrittenEntry startNode()
          Return the node which is the head of the list.
(package private)  long timestamp()
          Return the time stamp when this entry was written.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timestamp

private long timestamp
The time at which this entry was written.


next

private WrittenEntry next
The next node in the list.


rep

private EntryRep rep
The EntryRep this node refers to.

Constructor Detail

WrittenEntry

private WrittenEntry(EntryRep rep)
Create a new time-stamped entry for the given EntryRep. The comment for the class explains why this is private.

Method Detail

startNode

static WrittenEntry startNode()
Return the node which is the head of the list. It is time-stamped, and has an EntryRep of null.


add

WrittenEntry add(EntryRep rep)
Add a new entry after this one. If this entry has already had a node added (possibly by another thread), add will skip ahead to the end of the list.


timestamp

long timestamp()
Return the time stamp when this entry was written.


rep

EntryRep rep()
Return the EntryRep of this entry. If this is the first node (the one returned by startNode), the EntryRep is null.

See Also:
startNode()

next

WrittenEntry next()
Return the next object in the list.


toString

public String toString()
Overrides:
toString in class Object


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.