Package org.xj3d.impl.core.loading
Class WorldLoadHandler
java.lang.Object
org.xj3d.impl.core.loading.WorldLoadHandler
- All Implemented Interfaces:
LoadRequestHandler,ReadProgressListener
Independent thread used to load a world from a list of URLs and then
place it in the given node.
This implementation is designed to work as both a loadURL() and createVrmlFromUrl() call handler. The difference is defined by what data is supplied to the thread. If the target node is specified, then we assume that the caller wants us to put the results there. If it is null, then assume that we're doing a loadURL call and replace the entire world.
- Version:
- $Revision: 1.4 $
- Author:
- Justin Couch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidNotification to abort loading the current resource.voidprocessLoadRequest(org.j3d.util.ErrorReporter reporter, String[] urls, Vector<LoadDetails> loadList) Process this load request now.voidprogressUpdate(long value) Notification of where the stream is at.voidshutdown()Notification to shut down the load process entirely for this thread.voidThe stream has closed.
-
Constructor Details
-
WorldLoadHandler
Create a new empty world loader. It does not start the thread running. That is the job of the caller code.- Parameters:
cache- The file cache implementation to use for this handler
-
-
Method Details
-
progressUpdate
public void progressUpdate(long value) Description copied from interface:ReadProgressListenerNotification of where the stream is at. The value is dependent on the type, absolute or relative.- Specified by:
progressUpdatein interfaceReadProgressListener- Parameters:
value- The new value
-
streamClosed
public void streamClosed()Description copied from interface:ReadProgressListenerThe stream has closed.- Specified by:
streamClosedin interfaceReadProgressListener
-
processLoadRequest
public void processLoadRequest(org.j3d.util.ErrorReporter reporter, String[] urls, Vector<LoadDetails> loadList) Description copied from interface:LoadRequestHandlerProcess this load request now.- Specified by:
processLoadRequestin interfaceLoadRequestHandler- Parameters:
reporter- The errorReporter to send all messages tourls- The list of URLs to loadloadList- The list of LoadDetails objects to sent the fulfilled requests to
-
abortCurrentFile
public void abortCurrentFile()Description copied from interface:LoadRequestHandlerNotification to abort loading the current resource. If there is one loading, it will terminate the procedure immediately and start fetching the next available URI. This will only work if we are currently processing a file. If we are not processing a file then this is ignored.- Specified by:
abortCurrentFilein interfaceLoadRequestHandler
-
shutdown
public void shutdown()Description copied from interface:LoadRequestHandlerNotification to shut down the load process entirely for this thread. It probably means we are about to close down the whole system. If we are held in the queue, blocked waiting for input, the caller should callBlockingQueue.purge()on the queue after calling this method. That will force the block to exit and this thread to end.- Specified by:
shutdownin interfaceLoadRequestHandler
-