Class NetworkEventQueue
java.lang.Object
org.web3d.vrml.scripting.external.buffer.NetworkEventQueue
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionprotected org.j3d.util.ErrorReporter
The ErrorReporter to send messages tofinal Object
External lock for the event list. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Start queuing updates.void
clear()
Clear out any held referencesvoid
End queuing of updates, and send the current set to be processed.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
Process all waiting events.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Change the ErrorReporter this instance is using
-
Field Details
-
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 org.j3d.util.ErrorReporter errorReporterThe ErrorReporter to send messages to
-
-
Constructor Details
-
NetworkEventQueue
public NetworkEventQueue(org.j3d.util.ErrorReporter reporter) Basic constructor.- Parameters:
reporter
- The ErrorReporter to use.
-
-
Method Details
-
beginUpdate
public void beginUpdate()Start queuing updates. It isn't an error to call this multiple times, but extra calls are ignored. -
endUpdate
public void endUpdate()End queuing 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
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.- Returns:
-
processEvent
Process an addition to the event queue. This will either add the event to the queue, or execute it immediately depending on the queuing state- Parameters:
event
-
-
processEvents
public void processEvents()Process all waiting events.- Specified by:
processEvents
in interfaceExternalView
- See Also:
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter reporter) Change the ErrorReporter this instance is using- Specified by:
setErrorReporter
in interfaceExternalView
- Parameters:
reporter
- The instance to use or null- See Also:
-
clear
-