Back to index
Back to module hivemind

Service hivemind.BuilderFactory

Interfaceorg.apache.hivemind.ServiceImplementationFactory
Parameters Occursrequired
Used to construct a service from a class name and optional constructor parameters and properties.

Parameters Schema

Element construct
A single construct element identifies the class to instantiate.
Attribute class Required
The name of the class to instantiate.
Attribute messages-property Optional
The name of a property to assign invoking module's messages to.
Attribute log-property Optional
The name of a property to assign the Log instance for the service to. The Log instance is built from the service configuration point id.
Attribute service-id-property Optional
The name of a property to assign the configuration point id of the service to.
Attribute initialize-method Optional
The name of a public instance method (taking no parameters) to be invoked after the service is constructed.
Attribute error-handler-property Optional
The name of a property to assign the module's ErrorHandler to.
Attribute class-resolver-property Optional
The name of a property to assign the module's ClassResolver to.
Attribute autowire-services Optional
Translatorboolean,default=true
If true (the default), the BuilderFactory will attempt to connect unclaimed properties to services.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderParameter" />
  • <read-attribute attribute="class" property="className" />
  • <read-attribute attribute="initialize-method" property="initializeMethod" />
  • <read-attribute attribute="autowire-services" property="autowireServices" skip-if-null="false" />
  • <invoke-parent method="addElement" />
  • <create-object class="org.apache.hivemind.service.impl.BuilderMessagesFacet" />
  • <read-attribute attribute="messages-property" property="propertyName" />
  • <invoke-parent depth="1" method="addProperty" />
  • <create-object class="org.apache.hivemind.service.impl.BuilderLogFacet" />
  • <read-attribute attribute="log-property" property="propertyName" />
  • <invoke-parent depth="2" method="addProperty" />
  • <create-object class="org.apache.hivemind.service.impl.BuilderServiceIdFacet" />
  • <read-attribute attribute="service-id-property" property="propertyName" />
  • <invoke-parent depth="3" method="addProperty" />
  • <create-object class="org.apache.hivemind.service.impl.BuilderErrorHandlerFacet" />
  • <read-attribute attribute="error-handler-property" property="propertyName" />
  • <invoke-parent depth="4" method="addProperty" />
  • <create-object class="org.apache.hivemind.service.impl.BuilderClassResolverFacet" />
  • <read-attribute attribute="class-resolver-property" property="propertyName" />
  • <invoke-parent depth="5" method="addProperty" />
Element string
A string value constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element int
An integer value constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element long
A long (64-bit) integer value constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element boolean
A boolean value constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element service
A constructor parameter providing the identified HiveMind service.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element configuration
A constructor parameter providing a HiveMind configuration point (as a List).

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element resource
A Resource constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element log
Placeholder for a Log instance for the constructed service as constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderLogFacet" />
  • <invoke-parent depth="6" method="addParameter" />
Element error-handler
Placeholder for the module's ErrorHandler instance passed in as a constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderErrorHandlerFacet" />
  • <invoke-parent depth="6" method="addParameter" />
Element class-resolver
Placeholder for the module's ClassResolver instance passed in as a constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderClassResolverFacet" />
  • <invoke-parent depth="6" method="addParameter" />
Element messages
Placeholder for a Messages object (from the invoking module) as constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderMessagesFacet" />
  • <invoke-parent depth="6" method="addParameter" />
Element service-id
Placeholder for the service id (of the constructed service) as constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderServiceIdFacet" />
  • <invoke-parent depth="6" method="addParameter" />
Element object
Placeholder for an object provided by the object translator as a constructor parameter.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-content property="value" />
  • <invoke-parent depth="6" method="addParameter" />
Element set
Configures a property of the service instance.
Attribute property Required
The name of a property of the service instance to configure.
Attribute value Required
The value to set the property to. The value will be converted to the type of the property.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderSmartPropertyFacet" />
  • <read-attribute attribute="property" property="propertyName" />
  • <read-attribute attribute="value" property="attributeValue" />
  • <invoke-parent depth="6" method="addProperty" />
Element set-object
Configures a property of the service instance using an object.
Attribute property Required
The name of a property of the service instance to configure.
Attribute value Required
Translatorobject
The value to set the property to, in the form of a prefix and a locator for that prefix. Prefixes are defined by the ObjectProviders configuration point. Each prefix provides a different interpretation for the locator, such as a service id or class name.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-attribute attribute="property" property="propertyName" />
  • <read-attribute attribute="value" property="value" />
  • <invoke-parent depth="6" method="addProperty" />
Element set-service
Configures a property of the service instance to another service.
Attribute property Required
The name of the property of the service instance to configure.
Attribute service-id Required
Translatorservice
The id of the service.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-attribute attribute="property" property="propertyName" />
  • <read-attribute attribute="service-id" property="value" />
  • <invoke-parent depth="6" method="addProperty" />
Element set-configuration
Configures a property of the service instance to the elements contributed to an configuration point.
Attribute property Required
The name of the property of the service instance to configure.
Attribute configuration-id Required
Translatorconfiguration
The id of the configuration point to access.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-attribute attribute="property" property="propertyName" />
  • <read-attribute attribute="configuration-id" property="value" />
  • <invoke-parent depth="6" method="addProperty" />
Element set-resource
Configures a property of the service instance to a resource.
Attribute property Required
The name of the property of the service instance to configure.
Attribute path Required
Translatorresource
The path, relative to the module's deployment descriptor, of the resource.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.BuilderPropertyFacet" />
  • <read-attribute attribute="property" property="propertyName" />
  • <read-attribute attribute="path" property="value" />
  • <invoke-parent depth="6" method="addProperty" />
Element event-listener
Registers the new services as an event listener for events produced by the specified service.
Attribute service-id Required
Translatorservice
The service which will produce events.
Attribute event-set Optional
If given, the name of an event set for which the service will be registered. If omitted, the service will be registered for all events sets for which it implements the necessary listener interfaces.

Conversion Rules

  • <create-object class="org.apache.hivemind.service.impl.EventRegistration" />
  • <read-attribute attribute="service-id" property="producer" />
  • <read-attribute attribute="event-set" property="eventSetName" />
  • <invoke-parent depth="6" method="addEventRegistration" />

Implementation


Back to index
Back to module hivemind