public interface SharedClassHelperFactory
SharedClassHelperFactory provides an interface that is 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 different types of SharedClassHelper:Modifier and Type | Method and Description |
---|---|
SharedClassHelper |
findHelperForClassLoader(java.lang.ClassLoader loader)
Utility function that returns a SharedClassHelper for a given ClassLoader.
|
SharedClassTokenHelper |
getTokenHelper(java.lang.ClassLoader loader)
Returns a SharedClassTokenHelper for a given ClassLoader.
|
SharedClassTokenHelper |
getTokenHelper(java.lang.ClassLoader loader,
SharedClassFilter filter)
Returns a SharedClassTokenHelper for a given ClassLoader.
|
SharedClassURLClasspathHelper |
getURLClasspathHelper(java.lang.ClassLoader loader,
java.net.URL[] classpath)
Returns a SharedClassURLClasspathHelper for a given ClassLoader.
|
SharedClassURLClasspathHelper |
getURLClasspathHelper(java.lang.ClassLoader loader,
java.net.URL[] classpath,
SharedClassFilter filter)
Returns a SharedClassURLClasspathHelper for a given ClassLoader.
|
SharedClassURLHelper |
getURLHelper(java.lang.ClassLoader loader)
Returns a SharedClassURLHelper for a given ClassLoader.
|
SharedClassURLHelper |
getURLHelper(java.lang.ClassLoader loader,
SharedClassFilter filter)
Returns a SharedClassURLHelper for a given ClassLoader.
|
SharedClassTokenHelper getTokenHelper(java.lang.ClassLoader loader) throws HelperAlreadyDefinedException
Returns a SharedClassTokenHelper for a given ClassLoader.
Creates a new SharedClassTokenHelper if one cannot be found, otherwise returns an 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 belongHelperAlreadyDefinedException
- when another helper has been already defined for this class loader.SharedClassTokenHelper
SharedClassTokenHelper getTokenHelper(java.lang.ClassLoader loader, SharedClassFilter filter) throws HelperAlreadyDefinedException
Returns a SharedClassTokenHelper for a given ClassLoader.
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 cacheHelperAlreadyDefinedException
- when another helper has been already defined for this class loaderSharedClassTokenHelper
SharedClassURLHelper getURLHelper(java.lang.ClassLoader loader) throws HelperAlreadyDefinedException
Returns a SharedClassURLHelper for a given ClassLoader.
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 belongHelperAlreadyDefinedException
- when another helper has been already defined for this class loaderSharedClassURLHelper
SharedClassURLClasspathHelper getURLClasspathHelper(java.lang.ClassLoader loader, java.net.URL[] classpath) throws HelperAlreadyDefinedException
Returns a SharedClassURLClasspathHelper for a given ClassLoader.
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 ClassLoaderHelperAlreadyDefinedException
- when another helper has been already defined for this class loaderSharedClassURLClasspathHelper
SharedClassURLClasspathHelper getURLClasspathHelper(java.lang.ClassLoader loader, java.net.URL[] classpath, SharedClassFilter filter) throws HelperAlreadyDefinedException
Returns a SharedClassURLClasspathHelper for a given ClassLoader.
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 cacheHelperAlreadyDefinedException
- when another helper has been already defined for this class loaderSharedClassURLClasspathHelper
,
SharedClassFilter
SharedClassURLHelper getURLHelper(java.lang.ClassLoader loader, SharedClassFilter filter) throws HelperAlreadyDefinedException
Returns a SharedClassURLHelper for a given ClassLoader.
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 cacheHelperAlreadyDefinedException
- when another helper has been already defined for this class loaderSharedClassURLHelper
,
SharedClassFilter
SharedClassHelper findHelperForClassLoader(java.lang.ClassLoader loader)
Utility function that returns a SharedClassHelper for a given ClassLoader.
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 SharedClassHelperSharedClassHelper
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1998, 2023 IBM Corp. and others.