org.apache.hivemind.service.impl
Class BuilderFacet
java.lang.Object
org.apache.hivemind.impl.BaseLocatable
org.apache.hivemind.service.impl.BuilderFacet
- All Implemented Interfaces:
- Locatable, LocationHolder
- Direct Known Subclasses:
- BuilderClassResolverFacet, BuilderErrorHandlerFacet, BuilderErrorLogFacet, BuilderLogFacet, BuilderMessagesFacet, BuilderPropertyFacet, BuilderServiceIdFacet
public abstract class BuilderFacet
- extends BaseLocatable
Represents one facet of constructing a service implementation instance. A facet is either a
property to be set on the constructed instance, or a parameter to the instance class'
constructor. Facets are nested properties within
BuilderParameter
, and are used by
BuilderFactory
.
- Author:
- Howard Lewis Ship
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BuilderFacet
public BuilderFacet()
getFacetValue
public abstract java.lang.Object getFacetValue(ServiceImplementationFactoryParameters factoryParameters,
java.lang.Class targetType)
- Implemented in subclasses to provide a specific value for the facet (for use as a constructor
parameter, or as a value to set a property to).
- Parameters:
factoryParameters
- the parameters that define the service point and its environmenttargetType
- the desired property type (extracted from the property type of the property to be
updated, when a property is known)
isAssignableToType
public abstract boolean isAssignableToType(ServiceImplementationFactoryParameters factoryParameters,
java.lang.Class targetType)
getPropertyName
public java.lang.String getPropertyName()
setPropertyName
public void setPropertyName(java.lang.String string)
autowire
public java.lang.String autowire(java.lang.Object target,
ServiceImplementationFactoryParameters factoryParameters)
- Attempts to autowire a property of the target. This requires that
- The facet type defines a default property name and facet type
- The facet instance does not have a specified property name
- The (default) property is writeable
- The (default) property is assignable from the facet type
If all conditions are met, then the property is updated to the facet value, and the property
name is returned. In all other cases, null is returned.
- Parameters:
target
- The service implementation being constructedfactoryParameters
- the parameters that define the service point and its environment
getDefaultPropertyName
protected java.lang.String getDefaultPropertyName()
- Returns null. Subclasses can provide the default name for a property used by
autowire(Object, ServiceImplementationFactoryParameters)
.
canAutowireConstructorParameter
public boolean canAutowireConstructorParameter()
- Since:
- 1.1