intarsys runtime library

de.intarsys.tools.provider
Class Providers

java.lang.Object
  extended by de.intarsys.tools.provider.Providers

public class Providers
extends Object

This is an alternative service- or provider loading tool.

The standard ServiceLoader architecture is quite unfriendly to reflective access and is even more unfriendly to a lightweight generic build&deployment procedure.

This implementation uses a single file "META-INF/provider/provider.list" to enumerate service/implementation pairs. Each service is listed on a line of its own. The service is followed by a ";", then followed by the implementation class. Empty lines are ignored.


Field Summary
static char COMMENT
           
static String SEPARATOR
           
 
Method Summary
static Providers get()
           
static Providers get(ClassLoader classloader)
           
<S> Iterator<S>
lookupProviders(Class<S> service)
           
 void register(InputStream is)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENT

public static final char COMMENT
See Also:
Constant Field Values

SEPARATOR

public static final String SEPARATOR
See Also:
Constant Field Values
Method Detail

get

public static Providers get()

get

public static Providers get(ClassLoader classloader)

lookupProviders

public <S> Iterator<S> lookupProviders(Class<S> service)

register

public void register(InputStream is)
              throws IOException
Throws:
IOException

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.