org.jvnet.hk2.config
Class ConfigBean
java.lang.Object
com.sun.hk2.component.AbstractInhabitantImpl<T>
com.sun.hk2.component.LazyInhabitant
org.jvnet.hk2.config.Dom
org.jvnet.hk2.config.ConfigBean
- All Implemented Interfaces:
- com.sun.hk2.component.Holder, java.lang.reflect.InvocationHandler, org.jvnet.hk2.component.Inhabitant, ConfigView, ObservableBean
public class ConfigBean
- extends Dom
- implements ConfigView
ConfigBean is the core implementation of the config beans. It has features like locking
view creation and optional features attachement.
- Author:
- Jerome Dochez
| Nested classes/interfaces inherited from interface com.sun.hk2.component.Holder |
com.sun.hk2.component.Holder.Impl<T> |
| Fields inherited from class com.sun.hk2.component.LazyInhabitant |
habitat |
| Methods inherited from class org.jvnet.hk2.config.Dom |
addLeafElement, addListener, attribute, attribute, attributes, changeLeafElement, convertName, createProxy, createProxy, createWomb, digAnnotation, digAnnotation, domNodeByTypeElements, element, getAttributeNames, getElementNames, getInjector, getKey, getLocation, getProxyType, getSymbolSpaceRoot, initializationCompleted, inject, injectInto, insertAfter, invoke, invoke, leafElement, leafElements, nodeByTypeElement, nodeByTypeElements, nodeElement, nodeElements, parent, rawAttribute, rawLeafElement, rawLeafElements, release, removeChild, removeLeafElement, removeListener, replaceChild, resolveReference, setLeafElements, setNodeElements, unwrap, writeTo |
| Methods inherited from class com.sun.hk2.component.LazyInhabitant |
get, metadata, type, typeName |
| Methods inherited from class com.sun.hk2.component.AbstractInhabitantImpl |
companions, get, getSerializedMetadata, getSerializedMetadata, lead, setCompanions |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.lang.reflect.InvocationHandler |
invoke |
ConfigBean
public ConfigBean(org.jvnet.hk2.component.Habitat habitat,
DomDocument document,
Dom parent,
ConfigModel model,
javax.xml.stream.XMLStreamReader in)
getObjectName
public javax.management.ObjectName getObjectName()
setObjectName
public void setObjectName(javax.management.ObjectName objectNameIn)
getHabitat
public org.jvnet.hk2.component.Habitat getHabitat()
getOptionalFeature
public <T> T getOptionalFeature(java.lang.Class<T> featureType)
- 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
protected void setter(ConfigModel.Property target,
java.lang.Object value)
throws java.lang.Exception
- Overrides:
setter in class Dom
- Throws:
java.lang.Exception
getter
protected java.lang.Object getter(ConfigModel.Property target,
java.lang.reflect.Type t)
- Overrides:
getter in class Dom
addInterceptor
public void addInterceptor(ConfigBeanInterceptor interceptor)
- Add a new ConfigBeanInterceptor to this ConfigBean instance. The inteceptor will
be called each time a attribute of this bean is accessed.
- Parameters:
interceptor - the new interceptor
getMasterView
public ConfigBean getMasterView()
- We are the master view.
- Specified by:
getMasterView in interface ConfigView
- Returns:
- the master view
setMasterView
public void setMasterView(ConfigView view)
- Specified by:
setMasterView in interface ConfigView
getProxy
public <T extends ConfigBeanProxy> T getProxy(java.lang.Class<T> proxyType)
- Creates a proxy for this view.
- Specified by:
getProxy in interface ConfigView
- Parameters:
proxyType - requested proxy type
- Returns:
- Java SE proxy
getLock
public java.util.concurrent.locks.Lock 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 concurrentely modified
- Returns:
- lock instance
Copyright © 2009 Sun Microsystems, Inc.. All Rights Reserved.