Package org.alfresco.traitextender
-
Interface Summary Interface Description AJExtender.ExtensionBypass<R> Implementors are aspectJ extension ignoring closures.Extensible AnExtensibleobject exposes a set ofTraits asExtendedTraits objects.
AnExtendedTraitis an association between aTraitexposing object and several extension objects.
The actualTraits and associated extensions provided by anExtensibleobject are given by itsExtensionPointhandling strategy and by the current set of registered extensions (seeExtender).
The exposedTraits can be thought of as parts of an object's interface that will be exposed to an extension.ExtensionBundle Implementors are sets of extension implementations that are registered on specificExtensionPointfor givenExtenders.ExtensionFactory<E> Creates extension instances for givenTraits andExtensionPoints.Trait Markup interface.
Subinterfaces represent distiguishing features ofExtensibleobjects that are meant to be extended and exposed to the extending code.
Ideally they would be the only means of interaction between extensions and the extended modules. -
Class Summary Class Description AJExtender Static utility used for aspectJ extension consistency , routing and for maintaining thread-local extension-bypass context stack.
AspectJ extension routing distinguishes between the following contexts in which an extended method (i.e.AJProxyTrait JavaProxyInvocationHandlerto be used in conjuction with asprctJ extended traits.
Method calls will be delegated to a givenExtensibleobject method having the same signature within anAJExtender.ExtensionBypasscontext.ExtendedTrait<T extends Trait> Trait based extension reference holder.
Keeps track of extension references for one extensible and allows the collection of those extensions when the extensible is collected.Extender Trait-extender central extension registry and life cycle handler.
Implementors must handle:ExtensionBundlelife cycle operations that start and stop bundles of extension points implementations at runtime.ExtenderImpl Standard-singletonExtenderimplementation.ExtensionPoint<E,M extends Trait> Defines a two-way interfacing mechanism between aTraitexposing object and an extension of that object.
The extended object can call methods of theExtensionPoint.extensionAPIwhich will be able to interact with the extended object through theExtensionPoint.traitAPIinterface it was paired with in the extension point.InstanceExtension<E,T extends Trait> Sub classes are extension API implementors that get instantiated once per extensible-extension point definition.InstanceExtensionFactory<I extends InstanceExtension<E,T>,T extends Trait,E> Creates extension sub classes that are extension API implementors once per extensible-extension point definition.RegistryExtensionBundle RouteExtensions An method override extension routing aspect.
Overrides calls to methods marked by anExtendannotation with calls to methods having the same signature in extensions registered for theExtensionPointreferred by theExtendmethod annotation.
Overriding methods can call the overridden method using its correspondentTraitrepresentation (i.e.SingletonExtension<E,T extends Trait> A singleton extension API implementor.SingletonExtensionFactory<E,S extends SingletonExtension<E,T>,T extends Trait> Creates singleton extension sub classes that are extension API implementors.SpringBeanExtension<E,T extends Trait> ASingletonExtensionextension-API implementor defined as a spring-bean.
Handles also spring-bundle extension registrations.SpringExtensionBundle ASpringBeanExtensions collection that get registered on theExtender's registry onSpringExtensionBundle.afterPropertiesSet().
Works in conjunction withSpringBeanExtensions andSpringExtensionPoints to define and start spring basedExtensionBundles ofSingletonExtensions.
The spring-context XML sample bellow shows the definition of spring-bundled trait-extensions:SpringExtensionPoint AnExtensionPointspring bean wrapper with spring registering life-cycle management.
Works in conjunction withSpringBeanExtensions andSpringExtensionBundles to define spring basedExtensionBundles of singleton extensions. -
Exception Summary Exception Description ExtensionTargetException Trait-extension runtime target-exception wrapper.InvalidExtension Signals an invalid extension state or extension definition. -
Annotation Types Summary Annotation Type Description Extend A runtime retained annotation that marks AJ-trait-extended methods ofExtensibleobjects.
It defines the actual circumstances in which theExtensionPointdefined usingExtend.extensionAPI()andExtend.traitAPI()has its extension invoked.
Methods marked by this aspect are advised by an extension-routing around advice inRouteExtensions.