Xj3D VRML/X3D Code API

Package org.web3d.net.protocol

Protocol handler implementation code to allow the Xj3D code to load inline javascript and ecmascript scripts.

See:
          Description

Class Summary
JarResourceFactory A factory for producing resources specfic to VRML97/X3D.
JavascriptResourceFactory A factory for producing resources specfic to VRML97/X3D.
VRML97ResourceFactory A factory for producing resources specfic to VRML97-only.
Web3DResourceFactory A factory for producing resources specfic to Web3D-only.
X3DResourceFactory A factory for producing resources specfic to X3D-only.
 

Package org.web3d.net.protocol Description

Protocol handler implementation code to allow the Xj3D code to load inline javascript and ecmascript scripts.

As our asynchronous load mechanism for Xj3D does not use the standard java.net packages for loading external content, we extend the classes used by our system. It can be used with the standard java.net system, but will not use it for it's own internal loading.

Registering VRML Protocol Handlers

Protocol handlers are not automatically registered with the system. This means that inlines will fail to load unless you register one of these handlers with the URI resolver system within your own code. To register one, you need to use the following code guide.
import org.ietf.uri.URI;
import org.ietf.uri.URIResourceFactory;

...

     URIResourceStreamFactory fac = URI.getURIResourceStreamFactory();
     if(!(fac instanceof Web3DResourceFactory)) {
         fac = new Web3DResourceFactory(fac);
         URI.setURIResourceStreamFactory(fac);
     }

There are a number of different protocol handler factories available. In general, we recommend you stick with one of the Do It All factories that handle all the types. The others are provided for completeness. Which you choose depends on what version of the spec(s) you need to support.

If you wish to get the source for the URI system, the handler makes use of Justin Couch's URIlib Java library for loading URNs and URLs. The standard java.net library is not used. Note that if you are using URNs, you will need to set a few system properties defined by that package.


Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium