|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.classloader.spi.base.BaseClassLoaderPolicy
org.jboss.classloader.spi.ClassLoaderPolicy
org.jboss.classloader.test.support.MockClassLoaderPolicy
public class MockClassLoaderPolicy
MockClassLoaderPolicy.
Constructor Summary | |
---|---|
MockClassLoaderPolicy()
Create a new MockClassLoaderPolicy filtering org.jboss.* classes with logical name "mock" |
|
MockClassLoaderPolicy(String name)
Create a new MockClassLoaderPolicy filtering org.jboss.* classes |
|
MockClassLoaderPolicy(String name,
ClassFilter nonJDKFilter)
Create a new MockClassLoaderPolicy filtering the given patterns |
|
MockClassLoaderPolicy(String name,
String[] classPatterns,
String[] resourcePatterns,
String[] packagePatterns)
Create a new MockClassLoaderPolicy filtering org.jboss.* classes |
Method Summary | |
---|---|
List<? extends DelegateLoader> |
getDelegates()
Get the delegate loaders for imported stuff |
String |
getName()
Get a simple name for the classloader |
ObjectName |
getObjectName()
Get the object name the classloader is registered in the MBeanServer with |
PackageInformation |
getPackageInformation(String packageName)
Get the package information |
String[] |
getPackageNames()
Get the exported packages |
String[] |
getPaths()
Get the paths to expose |
String |
getPrefix()
Get the prefix. |
protected ProtectionDomain |
getProtectionDomain(String className,
String path)
Get the protection domain |
URL |
getResource(String path)
Get the resource |
void |
getResources(String path,
Set<URL> urls)
Get resources |
boolean |
isImportAll()
Whether to import all exports from other classloaders in the domain |
protected ClassLoader |
isJDKRequest(String name)
Check whether this a request from the jdk if it is return the relevant classloader |
void |
setDelegates(List<? extends DelegateLoader> delegates)
Set the delegates |
void |
setExcluded(Class<?>... classes)
Set the excluded classes |
void |
setExcluded(String... excluded)
Set the excluded classes |
void |
setImportAll(boolean importAll)
Set the importAll. |
void |
setIncluded(Class<?>... classes)
Set the included classes |
void |
setIncluded(String... included)
Set the included classes |
void |
setPackageNames(Class<?>... classes)
Set the exported package names |
void |
setPackageNames(String... packageNames)
Set the exported package names |
void |
setPath(String path)
Set the path to expose |
void |
setPaths(Class<?>... classes)
Set the paths to expose |
void |
setPaths(String... paths)
Set the paths to expose |
void |
setPathsAndPackageNames(Class<?>... classes)
Set the paths and the exported package names |
void |
setPathsAndPackageNames(String... packages)
Set the paths and the exported package names |
void |
setPrefix(String prefix)
Set the prefix. |
void |
toLongString(StringBuilder builder)
For subclasses to add information for toLongString() |
String |
toString()
|
Methods inherited from class org.jboss.classloader.spi.ClassLoaderPolicy |
---|
getClassPackageInformation, getExported, getResourceAsStream, isBlackListable, isCacheable |
Methods inherited from class org.jboss.classloader.spi.base.BaseClassLoaderPolicy |
---|
addTranslator, clearBlackList, getAccessControlContext, getDomainName, getTranslators, removeTranslator, setTranslators, shutdownPolicy, toLongString, transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MockClassLoaderPolicy()
public MockClassLoaderPolicy(String name)
name
- the logical name of the policypublic MockClassLoaderPolicy(String name, String[] classPatterns, String[] resourcePatterns, String[] packagePatterns)
name
- the nameclassPatterns
- the class patternsresourcePatterns
- the resourcePatternspackagePatterns
- the packagePatternspublic MockClassLoaderPolicy(String name, ClassFilter nonJDKFilter)
name
- the logical name of the policynonJDKFilter
- the filter for nonJDK classes
IllegalArgumentException
- for a null filterMethod Detail |
---|
public String getName()
BaseClassLoaderPolicy
getName
in class BaseClassLoaderPolicy
public List<? extends DelegateLoader> getDelegates()
ClassLoaderPolicy
There are no imports by default
NOTE: Protected access for security reasons
getDelegates
in class ClassLoaderPolicy
public void setDelegates(List<? extends DelegateLoader> delegates)
delegates
- the delegate importspublic String getPrefix()
public void setPrefix(String prefix)
prefix
- the prefix.public String[] getPaths()
public void setPath(String path)
path
- the pathpublic void setPaths(String... paths)
paths
- the paths to exposepublic void setPaths(Class<?>... classes)
classes
- the classes to reference to determine the package pathspublic String[] getPackageNames()
ClassLoaderPolicy
Provides a hint for indexing
No packages are exported by default
The returned package names can be null to indicate nothing is exported, but if an array is returned it should not include a null package element.
getPackageNames
in class ClassLoaderPolicy
public void setPackageNames(String... packageNames)
packageNames
- the exported packagespublic void setPackageNames(Class<?>... classes)
classes
- the classes to reference to determine the package namespublic void setIncluded(String... included)
included
- the classes to include from the pathspublic void setIncluded(Class<?>... classes)
classes
- the classes to include from the pathspublic void setExcluded(String... excluded)
excluded
- the classes to include from the pathspublic void setExcluded(Class<?>... classes)
classes
- the classes to exclude from the pathspublic void setPathsAndPackageNames(Class<?>... classes)
classes
- the classes to referencepublic void setPathsAndPackageNames(String... packages)
packages
- the packagespublic boolean isImportAll()
ClassLoaderPolicy
False by default
isImportAll
in class ClassLoaderPolicy
public void setImportAll(boolean importAll)
importAll
- the importAll.public URL getResource(String path)
ClassLoaderPolicy
getResource
in class ClassLoaderPolicy
path
- the path
public void getResources(String path, Set<URL> urls) throws IOException
ClassLoaderPolicy
getResources
in class ClassLoaderPolicy
path
- the resource nameurls
- the list of urls to add to
IOException
- for any errorprotected ProtectionDomain getProtectionDomain(String className, String path)
ClassLoaderPolicy
By default there is no protection domain
NOTE: Protected access for security reasons
getProtectionDomain
in class ClassLoaderPolicy
className
- the class namepath
- the path
public PackageInformation getPackageInformation(String packageName)
ClassLoaderPolicy
There is no package information by default
getPackageInformation
in class ClassLoaderPolicy
packageName
- the package information
protected ClassLoader isJDKRequest(String name)
ClassLoaderPolicy
By default this uses the and returns the system classloader if true.
isJDKRequest
in class ClassLoaderPolicy
name
- the class name
public ObjectName getObjectName()
BaseClassLoaderPolicy
getObjectName
in class ClassLoaderPolicy
public void toLongString(StringBuilder builder)
BaseClassLoaderPolicy
toLongString
in class ClassLoaderPolicy
builder
- the builderpublic String toString()
toString
in class BaseClassLoaderPolicy
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |