Interface ClassResolver
- All Known Implementing Classes:
DefaultClassResolver
public interface ClassResolver
A resolver of Java classes.
- Author:
- Steve Ebersole, Hardy Ferentschik
-
Method Summary
Modifier and TypeMethodDescriptionClass
<?> classForName
(String className) Locate a class by name.<S> Collection
<S> loadJavaServices
(Class<S> serviceType) Discovers and instantiates implementations of the givenJava service
contract.locateResource
(String resourceName) Locate a resource by namepackageForName
(String packageName) Locate a pacakge by name.
-
Method Details
-
classForName
Locate a class by name.- Parameters:
className
- The name of the class to locate- Returns:
- The class reference
- Throws:
ClassLoadingException
- Indicates the class could not be found
-
packageForName
Locate a pacakge by name.- Parameters:
packageName
- The name of the package to locate- Returns:
- The package reference
- Throws:
ClassLoadingException
- Indicates the class could not be found
-
locateResource
Locate a resource by name- Parameters:
resourceName
- The name of the resource to resolve- Returns:
- The located resource;
may return
null
to indicate the resource was not found
-
loadJavaServices
Discovers and instantiates implementations of the givenJava service
contract.- Type Parameters:
S
- The type of the service contract- Parameters:
serviceType
- The java type defining the service contract- Returns:
- The ordered set of discovered services.
-