Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.scripting.external.buffer
Class NetworkEventQueue

java.lang.Object
  extended by org.web3d.vrml.scripting.external.buffer.NetworkEventQueue
All Implemented Interfaces:
ExternalView

public class NetworkEventQueue
extends java.lang.Object
implements ExternalView

NetworkEventQueue is a modified version of ExternalEventQueue from eai.buffer which which differs mainly in that it does not have an external view to synchronize with.


Field Summary
protected  ErrorReporter errorReporter
          The ErrorReporter to send messages to
 java.lang.Object eventLock
          External lock for the event list.
 
Constructor Summary
NetworkEventQueue(ErrorReporter reporter)
          Basic constructor.
 
Method Summary
 void beginUpdate()
          Start queueing updates.
 void endUpdate()
          End queueing of updates, and send the current set to be processed.
 ExternalEvent getLast(ExternalEvent type)
          Return the ExternalEvent which is equal to the sent type.
 void processEvent(ExternalEvent event)
          Process an addition to the event queue.
 void processEvents()
          Process all waiting events.
 void setErrorReporter(ErrorReporter reporter)
          Change the ErrorReporter this instance is using
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventLock

public java.lang.Object eventLock
External lock for the event list. This has to be public because the logic for merging set1Value calls isn't thread safe otherwise.


errorReporter

protected ErrorReporter errorReporter
The ErrorReporter to send messages to

Constructor Detail

NetworkEventQueue

public NetworkEventQueue(ErrorReporter reporter)
Basic constructor.

Parameters:
reporter - The ErrorReporter to use.
Method Detail

beginUpdate

public void beginUpdate()
Start queueing updates. It isn't an error to call this multiple times, but extra calls are ignored.


endUpdate

public void endUpdate()
End queueing of updates, and send the current set to be processed. It isn't an error to call this multiple times, but extra calls are ignored.


getLast

public ExternalEvent getLast(ExternalEvent type)
Return the ExternalEvent which is equal to the sent type. This relies on the trick that EventIn instances are equal based on node and field ID properties.


processEvent

public void processEvent(ExternalEvent event)
Process an addition to the event queue. This will either add the event to the queue, or execute it immediately depending on the queueing state


processEvents

public void processEvents()
Process all waiting events.

Specified by:
processEvents in interface ExternalView
See Also:
ExternalView.processEvents()

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Change the ErrorReporter this instance is using

Specified by:
setErrorReporter in interface ExternalView
Parameters:
reporter - The instance to use or null
See Also:
ExternalView.setErrorReporter(org.web3d.util.ErrorReporter)

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium