Apache Tuscany > Home > Java SCA Subproject > Java SCA Documentation Menu > Java SCA Extension Developer Guide | User List | Dev List | Issue Tracker |
Apache Tuscany SCA Java Extension Guide This page is work in progress. Thanks for your contribution
A presentation on how to extend Tuscany in Microsoft PowerPoint formatWhat is an extension?Extension is a module (or a set of modules),when built with Tuscany SCA, can extend it to work with additional bindings, language implementations, programming models or databindings. SCA assembly model is defined such that extensions can be added for new interface types or for new implementation types such as ruby and python, or new binding types such as CXF. However, the definition of extension SPIs is left to the implementor. Tuscany SCA Java provides a simple set of SPIs for implementing extensions. It also defines additional extension points such as data binding, for example support for SDO and JAXB. This guide explains the steps to add each of these extension types. Please help us refine the guide as you go through the steps of adding extensions. Name spaces used by extensionsHow to add a new component implementation?Musings on Adding a New Component Type by Mike E How to add a new binding?How to add a new interface binding?How to add a new databinding?General guide for developing extensions
Detail on extension architectureThe ExtensionPointRegistrypackage org.apache.tuscany.sca.core; /** * The registry for the Tuscany core extension points. As the point of contact * for all extension artifacts this registry allows loaded extensions to find * all other parts of the system and register themselves appropriately. * * @version $Rev: 539355 $ $Date: 2007-05-18 03:05:14 -0700 (Fri, 18 May 2007) $ */ public interface ExtensionPointRegistry { /** * Add an extension point to the registry * @param extensionPoint The instance of the extension point */ void addExtensionPoint(Object extensionPoint); /** * Get the extension point by the interface * @param extensionPointType The lookup key (extension point interface) * @return The instance of the extension point */ <T> T getExtensionPoint(Class<T> extensionPointType); /** * Remove an extension point * @param extensionPoint The extension point to remove */ void removeExtensionPoint(Object extensionPoint); } The ModuleActivatorpackage org.apache.tuscany.core; import java.util.Map; /** * ModuleActivator represents a module that plugs into the Tuscany system. Each module should * provide an implementation of this interface and registry the implementation class by defining * a file named as "META-INF/services/org.apache.tuscany.spi.bootstrp.ModuleActivator". The * content of the file is the class name of the implementation. The implementation class must * have a no-arg constructor. The same instance will be used to invoke all the methods during * different phases of the module activation. * * @version $Rev: 529327 $ $Date: 2007-04-16 10:10:43 -0700 (Mon, 16 Apr 2007) $ */ public interface ModuleActivator { /** * Get a map of the extension points defined by this module. The key is the * java interface to represent the extension point and the the value is the * instance of the implementation of the interface. * * @return All the extension points defined by this module */ Map<Class, Object> getExtensionPoints(); /** * This method is invoked when the module is started by the Tuscany system. * It can be used by this module to registr extensions against extension * points. * * @param registry The extension point registry */ void start(ExtensionPointRegistry registry); /** * This method is invoked when the module is stopped by the Tuscany system. * It can be used by this module to unregister extensions against the * extension points. * * @param registry The extension point registry */ void stop(ExtensionPointRegistry registry); } The ModuleActivator represents a module that plugs into the Tuscany system. During bootstraping, the following sequence will happen: 1) All the module activators will be discovered by the presence of During shutting down, the stop() method is invoked for all the modules to |