Package org.jvnet.hk2.config
Class ConfigBean
java.lang.Object
org.glassfish.hk2.utilities.DescriptorImpl
org.glassfish.hk2.utilities.AbstractActiveDescriptor
org.jvnet.hk2.config.Dom
org.jvnet.hk2.config.ConfigBean
- All Implemented Interfaces:
Externalizable,Serializable,InvocationHandler,org.glassfish.hk2.api.ActiveDescriptor,org.glassfish.hk2.api.Descriptor,org.glassfish.hk2.api.SingleCache,ConfigView,ObservableBean
ConfigBean is the core implementation of the config beans. It has features like locking
view creation and optional features attachement.
- Author:
- Jerome Dochez
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConfigBean(org.glassfish.hk2.api.ServiceLocator habitat, DomDocument document, ConfigBean parent, ConfigModel model, XMLStreamReader in) ConfigBean(Dom source, Dom parent) Copy constructor, used to get a deep copy of the passed instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInterceptor(Class<?> interceptorType, ConfigBeanInterceptor interceptor) Add a new ConfigBeanInterceptor to this ConfigBean instance.Allocate a new ConfigBean object as part of the Transaction associated with this configuration object.protected <T extends Dom>
Tcopy(T parent) Returns a copy of itself providing the parent for the new copy.booleangetLock()Returns the lock on this object, only one external view (usually the writeable view) can acquire the lock ensuring that the objects cannot be concurrently modifiedWe are the master view.<T> TgetOptionalFeature(Class<T> featureType) Returns an optional feature of the ConfigBean.<T extends ConfigBeanProxy>
TCreates a proxy for this view.protected Objectgetter(ConfigModel.Property target, Type t) inthashCode()parent()If this DOM is a child of another DOM, the parent pointer.voidsetMasterView(ConfigView view) voidsetObjectName(ObjectName objectNameIn) protected voidsetter(ConfigModel.Property target, Object value) Methods inherited from class org.jvnet.hk2.config.Dom
addDefaultChildren, addLeafElement, addListener, attribute, attribute, attributes, changeLeafElement, convertName, create, createCreator, createProxy, createProxy, digAnnotation, digAnnotation, domNodeByTypeElements, element, get, getAttributeNames, getCache, getContractTypes, getElementNames, getFactoryLocatorId, getFactoryServiceId, getHabitat, getImplementationClass, getImplementationType, getInjectees, getInjector, getKey, getLocation, getProxyType, getQualifierAnnotations, getScopeAnnotation, getServiceLocator, getSymbolSpaceRoot, initializationCompleted, inject, insertAfter, invoke, invoke, isCacheSet, isReified, leafElement, leafElements, nodeByTypeElement, nodeByTypeElements, nodeElement, nodeElements, rawAttribute, rawLeafElement, rawLeafElements, release, releaseCache, removeChild, removeLeafElement, removeListener, replaceChild, resolveReference, setCache, setImplementationType, setLeafElements, setNodeElements, skipFromXml, unwrap, writeTo, writeToXmlMethods inherited from class org.glassfish.hk2.utilities.AbstractActiveDescriptor
addContractType, addQualifierAnnotation, dispose, getScopeAsAnnotation, removeContractType, removeQualifierAnnotation, setFactoryId, setName, setReified, setScopeAnnotation, setScopeAsAnnotationMethods inherited from class org.glassfish.hk2.utilities.DescriptorImpl
addAdvertisedContract, addMetadata, addMetadata, addQualifier, clearMetadata, descriptorEquals, getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, pretty, readExternal, readObject, removeAdvertisedContract, removeAllMetadata, removeMetadata, removeQualifier, setClassAnalysisName, setDescriptorType, setDescriptorVisibility, setImplementation, setLoader, setLocatorId, setMetadata, setProxiable, setProxyForSameScope, setRanking, setScope, setServiceId, toString, writeExternal, writeObjectMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jvnet.hk2.config.ConfigView
getProxyTypeMethods inherited from interface org.glassfish.hk2.api.Descriptor
getAdvertisedContracts, getClassAnalysisName, getDescriptorType, getDescriptorVisibility, getImplementation, getLoader, getLocatorId, getMetadata, getName, getQualifiers, getRanking, getScope, getServiceId, isProxiable, isProxyForSameScope, setRankingMethods inherited from interface java.lang.reflect.InvocationHandler
invoke
-
Constructor Details
-
ConfigBean
public ConfigBean(org.glassfish.hk2.api.ServiceLocator habitat, DomDocument document, ConfigBean parent, ConfigModel model, XMLStreamReader in) -
ConfigBean
Copy constructor, used to get a deep copy of the passed instance.- Parameters:
source- the instance to copy
-
-
Method Details
-
getObjectName
-
setObjectName
-
copy
Returns a copy of itself providing the parent for the new copy. -
equals
-
hashCode
public int hashCode() -
getOptionalFeature
Returns an optional feature of the ConfigBean. Optional features are implemented by other objects and attached to this instance. Attached features can be queried using the getOptionalFeature method giving the type of the requestion optional feature.- Parameters:
featureType- type of the optional feature requested.- Returns:
- optional feature implementation is one is attached to this instance
-
setter
-
getter
-
addInterceptor
Add a new ConfigBeanInterceptor to this ConfigBean instance. The inteceptor will be called each time a attribute of this bean is accessed.- Parameters:
interceptorType- type of the type interceptor.interceptor- the new interceptor
-
getMasterView
We are the master view.- Specified by:
getMasterViewin interfaceConfigView- Returns:
- the master view
-
setMasterView
- Specified by:
setMasterViewin interfaceConfigView
-
getProxy
Creates a proxy for this view.- Specified by:
getProxyin interfaceConfigView- Parameters:
proxyType- requested proxy type- Returns:
- Java SE proxy
-
allocate
Allocate a new ConfigBean object as part of the Transaction associated with this configuration object. This will eventually be moved to a factory.- Parameters:
type- the request configuration object type- Returns:
- the properly constructed configuration object
-
getLock
Returns the lock on this object, only one external view (usually the writeable view) can acquire the lock ensuring that the objects cannot be concurrently modified- Returns:
- lock instance
-
parent
Description copied from class:DomIf this DOM is a child of another DOM, the parent pointer. Otherwise null.
-