org.apache.tuscany.sca.core
Class DefaultUtilityExtensionPoint

java.lang.Object
  extended by org.apache.tuscany.sca.core.DefaultUtilityExtensionPoint
All Implemented Interfaces:
UtilityExtensionPoint

public class DefaultUtilityExtensionPoint
extends java.lang.Object
implements UtilityExtensionPoint

Default implementation of an extension point to hold Tuscany utility utilities.


Constructor Summary
DefaultUtilityExtensionPoint(ExtensionPointRegistry extensionPoints)
          Constructs a new extension point.
 
Method Summary
 void addUtility(java.lang.Object utility)
          Add a utility to the extension point.
<T> T
getUtility(java.lang.Class<T> utilityType)
          Get the utility by the interface that it implements
 void removeUtility(java.lang.Object utility)
          Remove a utility based on the interface that it implements
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUtilityExtensionPoint

public DefaultUtilityExtensionPoint(ExtensionPointRegistry extensionPoints)
Constructs a new extension point.

Method Detail

addUtility

public void addUtility(java.lang.Object utility)
Add a utility to the extension point. This default implementation stores utilities against the interfaces that they implement.

Specified by:
addUtility in interface UtilityExtensionPoint
Parameters:
utility - The instance of the utility
Throws:
java.lang.IllegalArgumentException - if utility is null

getUtility

public <T> T getUtility(java.lang.Class<T> utilityType)
Get the utility by the interface that it implements

Specified by:
getUtility in interface UtilityExtensionPoint
Parameters:
utilityType - The lookup key (utility interface)
Returns:
The instance of the utility
Throws:
java.lang.IllegalArgumentException - if utilityType is null

removeUtility

public void removeUtility(java.lang.Object utility)
Remove a utility based on the interface that it implements

Specified by:
removeUtility in interface UtilityExtensionPoint
Parameters:
utility - The utility to remove
Throws:
java.lang.IllegalArgumentException - if utility is null