|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.jxta.util.ClassFactory
|
+--net.jxta.id.IDFactory
A factory class for constructing ID instances from external representations such as strings or URIs and for constructing new ID instances.
ClassFactory,
ID| Inner Class Summary | |
static interface |
IDFactory.Instantiator
Interface for instantiators of IDs |
| Method Summary | |
static ID |
fromURL(java.net.URL source)
Construct a new ID instance from a JXTA ID contained in a URI. |
protected java.util.Hashtable |
getAssocTable()
Used by ClassFactory methods to get the mapping of ID types to constructors. |
protected java.lang.Class |
getClassForKey()
Used by ClassFactory methods to ensure that all keys used with the mapping are of the correct type. |
protected java.lang.Class |
getClassOfInstantiators()
Used by ClassFactory methods to ensure that all of the instance classes which register with this factory have the correct base class |
static java.net.URL |
jxtaURL(java.lang.String uri)
This method should be used instead of "new java.net.URL( )" when constructing JXTA URI, this avoid the system classLoader from failing to load the JXTA urn Handler, in env. |
static java.net.URL |
jxtaURL(java.lang.String protocol,
java.lang.String host,
java.lang.String file)
This method should be used instead of "new java.net.URL( )" when constructing JXTA URI, this avoid the system classLoader from failing to load the JXTA urn Handler, in env. |
static CodatID |
newCodatID(PeerGroupID groupID)
Creates a new CodatID Instance. |
static CodatID |
newCodatID(PeerGroupID groupID,
java.io.InputStream in)
Creates a new CodatID Instance. |
static ModuleClassID |
newModuleClassID()
Creates a new ModuleClassID Instance. |
static ModuleClassID |
newModuleClassID(ModuleClassID baseClass)
Creates a new ModuleClassID Instance. |
static ModuleSpecID |
newModuleSpecID(ModuleClassID baseClass)
Creates a new ModuleClassID Instance. |
static PeerGroupID |
newPeerGroupID()
Creates a new PeerGroupID Instance. |
static PeerID |
newPeerID(PeerGroupID groupID)
Creates a new PeerID Instance. |
static PipeID |
newPipeID(PeerGroupID groupID)
Creates a new PipeID Instance. |
static PipeID |
newPipeID(PeerGroupID groupID,
byte[] seed)
Creates a new PipeID Instance. |
protected boolean |
registerAssoc(java.lang.String className)
Register a class with the factory from its class name. |
static boolean |
registerIDType(int type,
java.lang.Class instanceClass)
Register a constructor for an ID type to enable IDs of that type to be constructed. |
| Methods inherited from class net.jxta.util.ClassFactory |
getAvailableKeys, getInstantiator, registerAssoc, registerFromResources, registerFromString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
protected java.util.Hashtable getAssocTable()
getAssocTable in class ClassFactoryprotected java.lang.Class getClassForKey()
getClassForKey in class ClassFactoryprotected java.lang.Class getClassOfInstantiators()
getClassOfInstantiators in class ClassFactoryprotected boolean registerAssoc(java.lang.String className)
registerAssoc in class ClassFactoryclassName - The class name which will be regiestered.
public static boolean registerIDType(int type,
java.lang.Class instanceClass)
type - the identifying value for this id formatinstanceClass - the Instantiator to use in constructing objects
of this ID format.
public static ID fromURL(java.net.URL source)
throws java.net.MalformedURLException,
java.net.UnknownServiceException
source - URI which will be decoded to create a new ID instance.java.net.UnknownServiceException - Is thrown if the URI provided is of a
format unrecognized by this JXTA implementation.java.net.MalformedURLException - Is thrown if the URI provided is not
a valid, recognized JXTA URI.ID,
URLpublic static CodatID newCodatID(PeerGroupID groupID)
groupID - the group to which this content will belong.CodatID
public static CodatID newCodatID(PeerGroupID groupID,
java.io.InputStream in)
throws java.io.IOException
groupID - The group to which this ID will belong.in - The InputStream from which the content hash is calculated.
The stream is read until EOF and then closed.java.io.IOException - I/O Error reading documentCodatIDpublic static PeerID newPeerID(PeerGroupID groupID)
groupID - the group to which this PeerID will belong.PeerIDpublic static PeerGroupID newPeerGroupID()
PeerGroupIDpublic static PipeID newPipeID(PeerGroupID groupID)
groupID - the group to which this Pipe ID will belong.PipeID
public static PipeID newPipeID(PeerGroupID groupID,
byte[] seed)
groupID - the group to which this Pipe ID will belong.seed - The seed information which will be used in creating the
pipeID.PipeIDpublic static ModuleClassID newModuleClassID()
ModuleClassIDpublic static ModuleClassID newModuleClassID(ModuleClassID baseClass)
baseClass - The module class ID which will be used as a base
class for this new role value instance.ModuleClassIDpublic static ModuleSpecID newModuleSpecID(ModuleClassID baseClass)
baseClass - The module class ID which will be used as a base
class for this new Spec ID.ModuleSpecID
public static java.net.URL jxtaURL(java.lang.String protocol,
java.lang.String host,
java.lang.String file)
throws java.net.MalformedURLException
protocol - the name of the protocol to use.host - the name of the host.port - the port number on the host.file - the file on the hostjava.net.MalformedURLException - if an unknown protocol is specified.
public static java.net.URL jxtaURL(java.lang.String uri)
throws java.net.MalformedURLException
spec - the String to parse as a URL.java.net.MalformedURLException - if an unknown protocol is specified.
|
Project JXTA | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||