|
||||||||||
| 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)
Create a new MockClassLoaderPolicy filtering org.jboss.* classes |
|
| Method Summary | |
|---|---|
List<? extends DelegateLoader> |
getDelegates()
Get the delegate loaders for imported stuff |
ObjectName |
getObjectName()
Get the object name the classloader is registered in the MBeanServer with |
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 |
setImportAll(boolean importAll)
Set the importAll. |
void |
setIncluded(Class... classes)
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 |
|---|
getExported, getPackageInformation, getResourceAsStream, isBlackListable, isCachable |
| Methods inherited from class org.jboss.classloader.spi.base.BaseClassLoaderPolicy |
|---|
clearBlackList, getAccessControlContext, getDomainName, 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 policy
public MockClassLoaderPolicy(String name,
String[] classPatterns,
String[] resourcePatterns)
name - the nameclassPatterns - the class patternsresourcePatterns - the resourcePatterns
public MockClassLoaderPolicy(String name,
ClassFilter nonJDKFilter)
name - the logical name of the policynonJDKFilter - the filter for nonJDK classes
IllegalArgumentException - for a null filter| Method Detail |
|---|
public List<? extends DelegateLoader> getDelegates()
ClassLoaderPolicyThere are no imports by default
NOTE: Protected access for security reasons
getDelegates in class ClassLoaderPolicypublic 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()
ClassLoaderPolicyProvides 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 ClassLoaderPolicypublic void setPackageNames(String... packageNames)
packageNames - the exported packagespublic void setPackageNames(Class... classes)
classes - the classes to reference to determine the package namespublic void setIncluded(Class... classes)
classes - 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()
ClassLoaderPolicyFalse by default
isImportAll in class ClassLoaderPolicypublic void setImportAll(boolean importAll)
importAll - the importAll.public URL getResource(String path)
ClassLoaderPolicy
getResource in class ClassLoaderPolicypath - the path
public void getResources(String path,
Set<URL> urls)
throws IOException
ClassLoaderPolicy
getResources in class ClassLoaderPolicypath - the resource nameurls - the list of urls to add to
IOException - for any error
protected ProtectionDomain getProtectionDomain(String className,
String path)
ClassLoaderPolicyBy default there is no protection domain
NOTE: Protected access for security reasons
getProtectionDomain in class ClassLoaderPolicyclassName - the class namepath - the path
protected ClassLoader isJDKRequest(String name)
ClassLoaderPolicyBy default this uses the and returns the system classloader if true.
isJDKRequest in class ClassLoaderPolicyname - the class name
public ObjectName getObjectName()
ClassLoaderPolicy
getObjectName in class ClassLoaderPolicypublic void toLongString(StringBuilder builder)
BaseClassLoaderPolicy
toLongString in class ClassLoaderPolicybuilder - the builderpublic String toString()
toString in class BaseClassLoaderPolicy
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||