blob: 27f93ef490a9c49014e3ada52274a93ce6402cf0 [file] [log] [blame]
<?xml version="1.0"?>
<!--
Copyright 2004, 2005 The Apache Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<module id="tapestry.enhance" version="4.0.0" package="org.apache.tapestry.enhance">
Services and configurations related to component and page class enhancement.
<service-point id="ComponentConstructorFactory"
interface="org.apache.tapestry.services.ComponentConstructorFactory">
Performs enhancements on a component class as directed by the component's specification and the enhancement
workers contributed to the tapestry.enhance.EnhancementWorkers configuration point.
<invoke-factory>
<construct class="org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl">
<set-service property="classFactory" service-id="tapestry.ClassFactory" />
<event-listener service-id="tapestry.ResetEventHub" />
<event-listener service-id="tapestry.describe.ReportStatusHub" />
<set-service property="validator" service-id="EnhancedClassValidator" />
<set-service property="chain" service-id="EnhancementWorkerChain" />
</construct>
</invoke-factory>
</service-point>
<service-point id="EnhancementWorkerChain" interface="EnhancementWorker">
The chain of enhancement workers built from the EnhancementWorkers configuration.
<invoke-factory service-id="hivemind.lib.ChainFactory">
<construct configuration-id="EnhancementWorkers" />
</invoke-factory>
</service-point>
<service-point id="EnhancedClassValidator">
Validates that an enhanced class does implement all abstract methods inherited from super-classes.
<invoke-factory>
<construct class="EnhancedClassValidatorImpl">
<set-configuration property="classInspectors" configuration-id="ClassInspectors" />
</construct>
</invoke-factory>
</service-point>
<configuration-point id="ClassInspectors">
Definition of contributing to the class inspectors config point used by EnhancedClassValidator.
<schema>
<element name="inspector">
<attribute name="object" translator="object">
An object that implements the ClassInspector interface.
</attribute>
<rules>
<push-attribute attribute="object" />
<invoke-parent method="addElement" />
</rules>
</element>
</schema>
</configuration-point>
<contribution configuration-id="ClassInspectors" if="not (class java.lang.annotation.Annotation)">
<inspector object="service:ClassInspector" />
</contribution>
<contribution configuration-id="ClassInspectors" if="class java.lang.annotation.Annotation">
<inspector object="service:GenericsClassInspector" />
</contribution>
<service-point id="ClassInspector" interface="ClassInspector">
<invoke-factory>
<construct class="ClassInspectorImpl" />
</invoke-factory>
</service-point>
<service-point id="GenericsClassInspector" interface="ClassInspector">
<invoke-factory>
<construct class="GenericsClassInspectorImpl" />
</invoke-factory>
</service-point>
<configuration-point id="EnhancementWorkers" schema-id="hivemind.lib.ChainContribution">
Provides the logic for component class enhancements.
</configuration-point>
<service-point id="AutowireWorkerFactory" interface="org.apache.hivemind.ServiceImplementationFactory"
parameters-occurs="none">
Constructs AutowireWorker.
<invoke-factory>
<construct class="org.apache.tapestry.enhance.AutowireWorkerFactory" />
</invoke-factory>
</service-point>
<service-point id="AutowireWorker" interface="org.apache.tapestry.enhance.EnhancementWorker">
Automatically injects HiveMind service objects into read-only properties if exactly one HiveMind service point
is compatible with the property type.
<invoke-factory service-id="AutowireWorkerFactory" />
</service-point>
<contribution configuration-id="EnhancementWorkers">
<!-- These can actually run in any order, as long as abstract-property runs later. -->
<command id="inject-messages" object="service:InjectMessagesWorker" before="abstract-property" />
<command id="inject-specification" object="service:InjectSpecificationWorker" before="abstract-property" />
<command id="inject-event-invoker" object="service:InjectEventInvokerWorker" before="abstract-property" />
<command id="inject-render-worker" object="service:InjectRenderWorker" before="abstract-property" />
<command id="specified-property" object="service:SpecifiedPropertyWorker" before="abstract-property" />
<command id="parameter" object="service:ParameterPropertyWorker" before="abstract-property" />
<command id="dispatch-inject" object="service:DispatchToInjectWorker" before="abstract-property" />
<command id="inject-component" object="service:InjectComponentWorker" before="abstract-property" />
<command id="inject-bean" object="service:InjectBeanWorker" before="abstract-property" />
<command id="inject-asset" object="service:InjectAssetWorker" before="abstract-property" />
<command id="inject-autowire" object="service:AutowireWorker" before="tapestry.enhance.abstract-property"
after="tapestry.enhance.inject-messages,tapestry.enhance.inject-specification,tapestry.enhance.specified-property,tapestry.enhance.parameter,tapestry.enhance.dispatch-inject,tapestry.enhance.inject-component,tapestry.enhance.inject-bean,tapestry.enhance.inject-asset" />
<command id="clientid-property" object="service:ClientIdPropertyWorker" />
<!-- After all the previous workers have had their chance, we "fill in" any unclaimed properties
as transient page properties. -->
<command id="abstract-property" object="service:AbstractPropertyWorker" />
<!-- These need to come last, since the previous commands (including abstract-property)
may have added interfaces to the class. -->
<command id="page-detach-listener" object="service:InjectPageDetachListenerWorker" after="abstract-property" />
<command id="page-attach-listener" object="service:InjectPageAttachListenerWorker" after="abstract-property" />
<command id="page-validate-listener" object="service:InjectPageValidateListenerWorker"
after="abstract-property" />
<command id="page-begin-render-listener" object="service:InjectPageBeginRenderListenerWorker"
after="abstract-property" />
<command id="page-end-render-listener" object="service:InjectPageEndRenderListenerWorker"
after="abstract-property" />
</contribution>
<configuration-point id="InjectWorkers">
Maps injection types to InjectEnhancementWorker objects.
<schema>
<element name="worker" key-attribute="type">
<attribute name="type">
The type of injection performed by this object. Matches against the type attribute of the component
specification's &lt;inject&gt; element.
</attribute>
<attribute name="object" required="true" translator="object">
The object implementing the InjectEnhancementWorker interface.
</attribute>
<rules>
<push-attribute attribute="object" />
<invoke-parent method="addElement" />
</rules>
</element>
</schema>
</configuration-point>
<contribution configuration-id="InjectWorkers">
<worker type="object" object="service:InjectObjectWorker" />
<worker type="state" object="service:InjectStateWorker" />
<worker type="state-flag" object="service:InjectStateFlagWorker" />
<worker type="meta" object="service:InjectMetaWorker" />
<worker type="script" object="service:InjectScriptWorker" />
<worker type="page" object="instance:InjectPageWorker" />
</contribution>
<service-point id="DispatchToInjectWorker" interface="EnhancementWorker">
Dispatches to the correct InjectEnhancementWorker, based on the injection type.
<invoke-factory>
<construct class="DispatchToInjectWorker">
<set-object property="injectWorkers" value="configuration:InjectWorkers" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectMessagesWorker" interface="EnhancementWorker">
Injects the messages property into all components.
<invoke-factory>
<construct class="InjectMessagesWorker">
<set-object property="componentMessagesSource" value="infrastructure:componentMessagesSource" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectSpecificationWorker" interface="EnhancementWorker">
Injects the specification property into all components.
<invoke-factory>
<construct class="InjectSpecificationWorker" />
</invoke-factory>
</service-point>
<service-point id="InjectEventInvokerWorker" interface="EnhancementWorker">
Injects the eventInvoker property into all components.
<invoke-factory>
<construct class="InjectEventInvokerWorker">
<set-service property="componentEventInvoker" service-id="tapestry.event.EventInvoker" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectRenderWorker" interface="EnhancementWorker">
Injects the ComponentRenderWorker property into all components.
<invoke-factory>
<construct class="InjectRenderWorker">
<set-service property="renderWorker" service-id="tapestry.render.ComponentRenderChain" />
</construct>
</invoke-factory>
</service-point>
<service-point id="SpecifiedPropertyWorker" interface="EnhancementWorker">
Finds specified properties (from the specification) and constructs the corresponding properties in the enhanced
class.
<invoke-factory>
<construct class="SpecifiedPropertyWorker">
<set-service property="bindingSource" service-id="tapestry.bindings.BindingSource" />
</construct>
</invoke-factory>
</service-point>
<service-point id="ParameterPropertyWorker" interface="EnhancementWorker">
Adds properties for connected parameters to the enhanced class.
<invoke-factory>
<construct class="ParameterPropertyWorker" />
</invoke-factory>
</service-point>
<service-point id="InjectObjectWorker" interface="InjectEnhancementWorker">
Injects objects obtained from HiveMind into properties of the enhanced class.
<invoke-factory>
<construct class="InjectObjectWorker">
<set-service property="provider" service-id="tapestry.InjectedValueProvider" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectStateWorker" interface="InjectEnhancementWorker">
Injects properties that reference application state objects.
<invoke-factory>
<construct class="InjectStateWorker">
<set-service property="applicationStateManager" service-id="tapestry.state.ApplicationStateManager" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectStateFlagWorker" interface="InjectEnhancementWorker">
Injects boolean properties that indicate if a particular application state object exists or not.
<invoke-factory>
<construct class="InjectStateFlagWorker">
<set-service property="applicationStateManager" service-id="tapestry.state.ApplicationStateManager" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectMetaWorker" interface="InjectEnhancementWorker">
Injects meta data from the component's specification (or elsewhere) and handles type conversion.
<invoke-factory>
<construct class="InjectMetaWorker">
<set-object property="valueConverter" value="infrastructure:valueConverter" />
<set-object property="source" value="infrastructure:componentPropertySource" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectScriptWorker" interface="InjectEnhancementWorker">
Injects an IScript (a parsed script template, ready to be executed). The injected object is the relative path to
the script template file.
<invoke-factory>
<construct class="InjectScriptWorker">
<set-object property="source" value="infrastructure:scriptSource" />
<set-service property="assetSource" service-id="tapestry.asset.AssetSource"/>
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectComponentWorker" interface="EnhancementWorker">
Injects contained components as properties of the containing component.
<invoke-factory>
<construct class="InjectComponentWorker" />
</invoke-factory>
</service-point>
<service-point id="InjectBeanWorker" interface="EnhancementWorker">
Injects managed beans as properties of the containing component.
<invoke-factory>
<construct class="InjectBeanWorker" />
</invoke-factory>
</service-point>
<service-point id="InjectAssetWorker" interface="EnhancementWorker">
Injects assets as properties of the containing component.
<invoke-factory>
<construct class="InjectAssetWorker" />
</invoke-factory>
</service-point>
<service-point id="ClientIdPropertyWorker" interface="EnhancementWorker">
Enhances the IComponent.getClientId() abstract getter to properly provide client id's depending on the context
called in. Does the same thing as AbstractPropertyWorker + the logic described.
<invoke-factory>
<construct class="ClientIdPropertyWorker" />
</invoke-factory>
</service-point>
<service-point id="AbstractPropertyWorker" interface="EnhancementWorker">
Finds otherwise unclaimed abstract properties and converts them into concrete properties, as if they were
defined in the specification.
<invoke-factory>
<construct class="AbstractPropertyWorker" />
</invoke-factory>
</service-point>
<service-point id="InjectPageDetachListenerWorker" interface="EnhancementWorker">
Registers components as PageDetachListeners, if they implement the interface.
<invoke-factory>
<construct class="InjectListenerRegistrationWorker">
<set-object property="listenerInterface" value="class:org.apache.tapestry.event.PageDetachListener" />
<set property="registerMethodName" value="addPageDetachListener" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectPageAttachListenerWorker" interface="EnhancementWorker">
Registers components as PageAttachListeners, if they implement the interface.
<invoke-factory>
<construct class="InjectListenerRegistrationWorker">
<set-object property="listenerInterface" value="class:org.apache.tapestry.event.PageAttachListener" />
<set property="registerMethodName" value="addPageAttachListener" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectPageEndRenderListenerWorker" interface="EnhancementWorker">
Registers components as PageEndRenderListeners, if they implement the interface.
<invoke-factory>
<construct class="InjectListenerRegistrationWorker">
<set-object property="listenerInterface" value="class:org.apache.tapestry.event.PageEndRenderListener" />
<set property="registerMethodName" value="addPageEndRenderListener" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectPageBeginRenderListenerWorker" interface="EnhancementWorker">
Registers components as PageBeginRenderListeners, if they implement the interface.
<invoke-factory>
<construct class="InjectListenerRegistrationWorker">
<set-object property="listenerInterface"
value="class:org.apache.tapestry.event.PageBeginRenderListener" />
<set property="registerMethodName" value="addPageBeginRenderListener" />
</construct>
</invoke-factory>
</service-point>
<service-point id="InjectPageValidateListenerWorker" interface="EnhancementWorker">
Registers components as PageValidateListeners, if they implement the interface.
<invoke-factory>
<construct class="InjectListenerRegistrationWorker">
<set-object property="listenerInterface" value="class:org.apache.tapestry.event.PageValidateListener" />
<set property="registerMethodName" value="addPageValidateListener" />
</construct>
</invoke-factory>
</service-point>
</module>