org.apache.commons.classscan.util
Class ServiceVisitor<T>
java.lang.Object
org.apache.commons.classscan.util.ServiceVisitor<T>
- Type Parameters:
T
- The type of the provider
public abstract class ServiceVisitor<T>
- extends Object
Visit the provider instances specified in the META-INF/services directories
Method Summary |
protected abstract boolean |
visit(T serviceProvider)
The callback method which is invoked upon finding a service provider |
void |
visitProviders(Class<T> serviceInterface,
ClassLoader classLoader)
Visit the service provider available for the given interface and ClassLoader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServiceVisitor
public ServiceVisitor()
visitProviders
public void visitProviders(Class<T> serviceInterface,
ClassLoader classLoader)
- Visit the service provider available for the given interface and ClassLoader
- Parameters:
serviceInterface
- The interface of the serviceclassLoader
- The ClassLoader which will load the service
visit
protected abstract boolean visit(T serviceProvider)
- The callback method which is invoked upon finding a service provider
- Parameters:
serviceProvider
- An instance of the service provider
- Returns:
- true, if additional service providers desired; false, stop the visiting
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.