|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jini.rio.core.ClassBundle
public class ClassBundle
ClassBundle provides a mechanism to define the resources needed to load and instantiate a class.
Constructor Summary | |
---|---|
ClassBundle(String className)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames,
Map shComponents)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames,
Map shComponents,
String codebase)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames,
Map shComponents,
String algorithm,
Map httpmdLocations,
String codebase)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames,
String codebase)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames,
String[] methodNames,
Object[] methodArgs)
Create a new ClassBundle |
|
ClassBundle(String className,
String[] jarNames,
String[] methodNames,
Object[] methodArgs,
String codebase)
Create a new ClassBundle |
Method Summary | |
---|---|
void |
addJAR(String jar)
Add a JAR to the Collection of JAR resources. |
void |
addJARHttpmdLocation(String resource,
String location)
Add a location for a JAR to compute a message digest. |
void |
addJARHttpmdLocations(Map m)
Add a Map of JAR to location entries |
void |
addJARs(String[] jars)
Add JARs to the ClassBundle. |
void |
addMethod(String methodName,
Object[] parameters)
Add a method name and the parameters to use for when reflecting on specified public member method of the class or interface represented by this ClassBundle object. |
void |
addSharedComponent(String name,
String[] jarNames)
Add a shared component |
void |
addSharedComponents(Map m)
Add a Map of shared components |
boolean |
equals(Object obj)
Override equals |
String |
getAlgorithm()
Get the algorithm set for computing message digests |
String |
getClassName()
Get the className |
String |
getCodebase()
Get the codebase used to load the class. |
boolean |
getComputeHttpMD()
Get whether this ClassBundle has been configured toc compute HTTP Message Digests |
String[] |
getJARNames()
Get the JAR names |
URL[] |
getJARs()
Get the JAR resources |
Class[] |
getMethodClasses(String methodName)
Get the corresponding Class[] parameters to reflect on a method |
String[] |
getMethodNames()
Get all method names to reflect on |
Object[] |
getMethodObjects(String methodName)
Get the corresponding Class[] parameters to reflect on a method |
Map |
getSharedComponents()
Get shared component information |
int |
hashCode()
Override hashCode |
Class |
loadClass()
Load the class using the provided JAR resources. |
Class |
loadClass(ClassLoader parent)
Load the class using the provided JAR resources. |
static void |
main(String[] args)
|
void |
runKnownMethods(Object object)
Utility method to reflect on all added methods using an object instantiated from the Class loaded by the ClassBundle |
void |
setAlgorithm(String algorithm)
Set the algorithm to use for computing message digests |
void |
setCodebase(String codebase)
Set the codebase used to load the class. |
void |
setComputeHttpMD(boolean computeHttpmd)
Set whether to compute HTTP Message Digests for this ClassBundle |
String |
toString()
Override toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ClassBundle(String className)
className
- The classNamepublic ClassBundle(String className, String[] jarNames)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNamepublic ClassBundle(String className, String[] jarNames, String codebase)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNamecodebase
- The URL path used to load the class. The path will be
applied to all JARs in this ClassBundlepublic ClassBundle(String className, String[] jarNames, String[] methodNames, Object[] methodArgs)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNamemethodNames
- Array of methodNamesmethodArgs
- Array of method arguments to be used to invoke the
method names above. The contents of the array must be suitable for use
when using reflection to invoke the method. The methodNames array and the
methodArgs array must be the same lengthpublic ClassBundle(String className, String[] jarNames, String[] methodNames, Object[] methodArgs, String codebase)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNamemethodNames
- Array of methodNamesmethodArgs
- Array of method arguments to be used to invoke the
method names above. The contents of the array must be suitable for use
when using reflection to invoke the method. The methodNames array and
the methodArgs array must be the same lengthcodebase
- The URL path used to load the class. The path will be
applied to all JARs in this ClassBundlepublic ClassBundle(String className, String[] jarNames, Map shComponents)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNameshComponents
- Map of class names and jar names to load the class
from. A shared component will be loaded by the common loader for all
services making it (and the resources it uses) available to all servicespublic ClassBundle(String className, String[] jarNames, Map shComponents, String codebase)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNameshComponents
- Map of class names and jar names to load the class
from. A shared component will be loaded by the common loader for all
services making it (and the resources it uses) available to all servicescodebase
- The URL path used to load the class. The path will be
applied to all JARs in this ClassBundlepublic ClassBundle(String className, String[] jarNames, Map shComponents, String algorithm, Map httpmdLocations, String codebase)
className
- The classNamejarNames
- Array of Strings identifyng resource names used to load
the classNameshComponents
- Map of class names and jar names to load the class
from. A shared component will be loaded by the common loader for all
services making it (and the resources it uses) available to all serviceshttpmdLocations
- A Map of jar names to locations for use when
creating message digestscodebase
- The URL path used to load the class. The path will be
applied to all JARs in this ClassBundleMethod Detail |
---|
public void setCodebase(String codebase)
public String getCodebase()
public void setAlgorithm(String algorithm)
algorithm
- Alogorithm used for computing HTTPMDpublic String getAlgorithm()
public boolean getComputeHttpMD()
public void setComputeHttpMD(boolean computeHttpmd)
public String getClassName()
public void addJARHttpmdLocation(String resource, String location)
resource
- The resource (jar) namelocation
- The location to use to compute the message digest for the
resource. The location may point to a file system where the resource
can be loaded from, or an http:// URL. If a file system location is used,
it will most likely not be portable across platforms.public void addJARHttpmdLocations(Map m)
m
- Map of JAR locations to compute httpmdpublic void addJARs(String[] jars)
jars
- Array of URLs to addpublic void addJAR(String jar)
jar
- Name of the JAR to addpublic void addSharedComponents(Map m)
m
- Map of shared components to addpublic void addSharedComponent(String name, String[] jarNames)
name
- Class name of the shared component to loadjarNames
- String[] of jar names used to load the shared componentpublic Class loadClass() throws ClassNotFoundException, MalformedURLException
ClassNotFoundException
MalformedURLException
public Class loadClass(ClassLoader parent) throws ClassNotFoundException, MalformedURLException
parent
- Parent Classloader to use for delegation.
ClassNotFoundException
MalformedURLException
public String[] getJARNames()
public URL[] getJARs() throws MalformedURLException
MalformedURLException
- if the codebase has not been set, or if
the provided codebase contains an invalid protocolpublic Map getSharedComponents() throws MalformedURLException
MalformedURLException
public void addMethod(String methodName, Object[] parameters)
methodName
- The public member method of the Class or interface
represented by this ClassBundleparameters
- Array of Object parameters for use when reflecting on
the methodpublic String[] getMethodNames()
public Class[] getMethodClasses(String methodName)
methodName
- The name of the public method to reflect on
public Object[] getMethodObjects(String methodName)
methodName
- The name of the public method to reflect on
public void runKnownMethods(Object object) throws Exception
object
- An instantiated Object from the Class loaded by the
ClassBundle
Exception
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |