|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SharedClassHelperFactory
SharedClassHelperFactory provides an interface used to create various types of SharedClassHelper for ClassLoaders.
ClassLoaders and SharedClassHelpers have a one-to-one relationship. Any attempts to get a helper for a ClassLoader that already has a different type of helper will result in a HelperAlreadyDefinedException.
There are 3 diferent types of SharedClassHelper:
1) SharedClassTokenHelper
Store and find classes using a String token generated by the ClassLoader. For use by ClassLoaders which require complete control over cache contents.
2) SharedClassURLHelper
Store and find classes using a URL location. Any URL may be used to store or find classes.
For use by ClassLoaders which do not have the concept of a classpath, which load classes from multiple locations.
Classes may only be stored using jar/zip or file URLs. Classes are automatically kept up-to-date by the cache.
Classes stored using SharedClassURLClasspathHelper may be found using this helper and vice-versa.
3) SharedClassURLClasspathHelper
Store and find classes using a URL classpath. URLs may be appended to the classpath at any time.
The classpath may also be modified under certain cirumstances (see SharedClassURLClasspathHelper javadoc).
For use by ClassLoaders which load classes using a URL classpath.
Classes may only be stored using jar/zip or file URLs. Classes are automatically kept up-to-date by the cache.
Classes stored using SharedClassURLHelper may be found using this helper and vice-versa.
SharedClassTokenHelper
,
SharedClassURLHelper
,
SharedClassURLClasspathHelper
Method Summary | |
---|---|
SharedClassHelper |
findHelperForClassLoader(java.lang.ClassLoader loader)
Utility function which returns a SharedClassHelper for a given ClassLoader. |
SharedClassTokenHelper |
getTokenHelper(java.lang.ClassLoader loader)
Return a SharedClassTokenHelper for a given ClassLoader. |
SharedClassTokenHelper |
getTokenHelper(java.lang.ClassLoader loader,
SharedClassFilter filter)
Return a SharedClassTokenHelper for a given ClassLoader. |
SharedClassURLClasspathHelper |
getURLClasspathHelper(java.lang.ClassLoader loader,
java.net.URL[] classpath)
Return a SharedClassURLClasspathHelper for a given ClassLoader. |
SharedClassURLClasspathHelper |
getURLClasspathHelper(java.lang.ClassLoader loader,
java.net.URL[] classpath,
SharedClassFilter filter)
Return a SharedClassURLClasspathHelper for a given ClassLoader. |
SharedClassURLHelper |
getURLHelper(java.lang.ClassLoader loader)
Return a SharedClassURLHelper for a given ClassLoader. |
SharedClassURLHelper |
getURLHelper(java.lang.ClassLoader loader,
SharedClassFilter filter)
Return a SharedClassURLHelper for a given ClassLoader. |
Method Detail |
---|
SharedClassTokenHelper getTokenHelper(java.lang.ClassLoader loader) throws HelperAlreadyDefinedException
Creates a new SharedClassTokenHelper if one cannot be found, otherwise returns existing SharedClassTokenHelper.
Throws a HelperAlreadyDefinedException if the ClassLoader already has a different type of helper.
Returns null if a SecurityManager is installed and there is no
SharedClassPermission for the ClassLoader specified.
loader
- ClassLoader.
ClassLoader to which this SharedClassTokenHelper will belong
HelperAlreadyDefinedException
SharedClassTokenHelper
SharedClassTokenHelper getTokenHelper(java.lang.ClassLoader loader, SharedClassFilter filter) throws HelperAlreadyDefinedException
Creates a new SharedClassTokenHelper if one cannot be found, otherwise returns existing SharedClassTokenHelper.
Throws a HelperAlreadyDefinedException if the ClassLoader already has a different type of helper.
Returns null if a SecurityManager is installed and there is no
SharedClassPermission for the ClassLoader specified.
loader
- ClassLoader.
ClassLoader to which this SharedClassTokenHelper will belongfilter
- SharedClassURLFilter.
Specify a filter which limits the classes that are found or stored in the cache
HelperAlreadyDefinedException
SharedClassTokenHelper
SharedClassURLHelper getURLHelper(java.lang.ClassLoader loader) throws HelperAlreadyDefinedException
Creates a new SharedClassURLHelper if one cannot be found, otherwise returns existing SharedClassURLHelper.
Throws a HelperAlreadyDefinedException if the ClassLoader already has a different type of helper.
Returns null if a SecurityManager is installed and there is no
SharedClassPermission for the ClassLoader specified.
loader
- ClassLoader.
ClassLoader to which this SharedClassURLHelper will belong
HelperAlreadyDefinedException
SharedClassURLHelper
SharedClassURLClasspathHelper getURLClasspathHelper(java.lang.ClassLoader loader, java.net.URL[] classpath) throws HelperAlreadyDefinedException
Creates a new SharedClassURLClasspathHelper if one cannot be found,
otherwise if the classpath specified matches the classpath of an existing helper, returns existing SharedClassURLClasspathHelper.
Throws a HelperAlreadyDefinedException if the ClassLoader already has a different type of helper OR
if the ClassLoader has a SharedClassURLClasspathHelper with a different classpath.
Returns null if a SecurityManager is installed and there is no
SharedClassPermission for the ClassLoader specified.
loader
- ClassLoader.
ClassLoader to which this SharedClassURLClasspathHelper will belongclasspath
- URL[].
The current URL classpath of this ClassLoader
HelperAlreadyDefinedException
SharedClassURLClasspathHelper
SharedClassURLClasspathHelper getURLClasspathHelper(java.lang.ClassLoader loader, java.net.URL[] classpath, SharedClassFilter filter) throws HelperAlreadyDefinedException
Creates a new SharedClassURLClasspathHelper if one cannot be found,
otherwise if the classpath specified matches the classpath of an existing helper, returns existing SharedClassURLClasspathHelper.
If a new SharedClassHelper is created, the specified SharedClassURLFilter is applied to it. If the filter argument is null, no filter is applied.
Throws a HelperAlreadyDefinedException if the ClassLoader already has a different type of helper OR
if the ClassLoader has a SharedClassURLClasspathHelper with a different classpath.
Returns null if a SecurityManager is installed and there is no
SharedClassPermission for the ClassLoader specified.
loader
- ClassLoader.
ClassLoader to which this SharedClassURLClasspathHelper will belongclasspath
- URL[].
The current URL classpath of this ClassLoaderfilter
- SharedClassURLFilter.
Specify a filter which limits the classes that are found or stored in the cache
HelperAlreadyDefinedException
SharedClassURLClasspathHelper
,
SharedClassFilter
SharedClassURLHelper getURLHelper(java.lang.ClassLoader loader, SharedClassFilter filter) throws HelperAlreadyDefinedException
Creates a new SharedClassURLHelper if one cannot be found, otherwise returns existing SharedClassURLHelper.
If a new SharedClassHelper is created, the specified SharedClassURLFilter is applied to it. If the filter argument is null, no filter is applied.
Throws a HelperAlreadyDefinedException if the ClassLoader already has a different type of helper.
Returns null if a SecurityManager is installed and there is no
SharedClassPermission for the ClassLoader specified.
loader
- ClassLoader.
ClassLoader to which this SharedClassURLHelper will belongfilter
- SharedClassURLFilter.
Specify a filter which limits the classes that are found or stored in the cache
HelperAlreadyDefinedException
SharedClassURLHelper
,
SharedClassFilter
SharedClassHelper findHelperForClassLoader(java.lang.ClassLoader loader)
Can be used to determine whether a given ClassLoader already has a helper, before calling a getter method.
Returns an existing SharedClassHelper or null.
loader
- ClassLoader.
ClassLoader which may or may not have a SharedClassHelper
SharedClassHelper
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |