org.apache.tuscany.sca.context
Class DefaultContextFactoryExtensionPoint

java.lang.Object
  extended by org.apache.tuscany.sca.context.DefaultContextFactoryExtensionPoint
All Implemented Interfaces:
ContextFactoryExtensionPoint

public class DefaultContextFactoryExtensionPoint
extends java.lang.Object
implements ContextFactoryExtensionPoint

Default implementation of a model factory extension point.


Constructor Summary
DefaultContextFactoryExtensionPoint(ExtensionPointRegistry registry)
           
 
Method Summary
 void addFactory(java.lang.Object factory)
          Add a model factory extension.
<T> T
getFactory(java.lang.Class<T> factoryInterface)
          Get a factory implementing the given interface.
 void removeFactory(java.lang.Object factory)
          Remove a model factory extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultContextFactoryExtensionPoint

public DefaultContextFactoryExtensionPoint(ExtensionPointRegistry registry)
Method Detail

addFactory

public void addFactory(java.lang.Object factory)
                throws java.lang.IllegalArgumentException
Add a model factory extension.

Specified by:
addFactory in interface ContextFactoryExtensionPoint
Parameters:
factory - The factory to add.
Throws:
java.lang.IllegalArgumentException - if factory is null

removeFactory

public void removeFactory(java.lang.Object factory)
                   throws java.lang.IllegalArgumentException
Remove a model factory extension.

Specified by:
removeFactory in interface ContextFactoryExtensionPoint
Parameters:
factory - The factory to remove
Throws:
java.lang.IllegalArgumentException - if factory is null

getFactory

public <T> T getFactory(java.lang.Class<T> factoryInterface)
             throws java.lang.IllegalArgumentException
Get a factory implementing the given interface.

Specified by:
getFactory in interface ContextFactoryExtensionPoint
Parameters:
factoryInterface - The lookup key (factory interface)
Returns:
The factory
Throws:
java.lang.IllegalArgumentException