org.apache.qpid.proton
Class ProtonFactoryLoader<C extends ProtonFactory>

java.lang.Object
  extended by org.apache.qpid.proton.ProtonFactoryLoader<C>

public class ProtonFactoryLoader<C extends ProtonFactory>
extends java.lang.Object

A thin wrapper around ServiceLoader intended for loading Proton object factories. If system property "qpid.proton.implementationtype" if set, loads a factory whose ProtonFactory.ImplementationType matches its value.


Field Summary
static java.lang.String IMPLEMENTATION_TYPE_PROPERTY
           
 
Constructor Summary
ProtonFactoryLoader()
          Use this constructor if you intend to explicitly provide factory interface later, i.e.
ProtonFactoryLoader(java.lang.Class<C> factoryInterface)
           
ProtonFactoryLoader(java.lang.Class<C> factoryInterface, ProtonFactory.ImplementationType implementationType)
           
 
Method Summary
 C loadFactory()
          Returns the Proton factory that implements the stored _factoryInterface class.
 C loadFactory(java.lang.Class<C> factoryInterface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMPLEMENTATION_TYPE_PROPERTY

public static final java.lang.String IMPLEMENTATION_TYPE_PROPERTY
See Also:
Constant Field Values
Constructor Detail

ProtonFactoryLoader

public ProtonFactoryLoader()
Use this constructor if you intend to explicitly provide factory interface later, i.e. by calling loadFactory(Class). This is useful if you want to use the same ProtonFactoryLoader instance for loading multiple factory types.


ProtonFactoryLoader

public ProtonFactoryLoader(java.lang.Class<C> factoryInterface)

ProtonFactoryLoader

public ProtonFactoryLoader(java.lang.Class<C> factoryInterface,
                           ProtonFactory.ImplementationType implementationType)
Parameters:
factoryInterface - will be used as the factory interface class in calls to loadFactory().
Method Detail

loadFactory

public C loadFactory()
Returns the Proton factory that implements the stored _factoryInterface class.


loadFactory

public C loadFactory(java.lang.Class<C> factoryInterface)