Package com.yahoo.config.model.producer
Class TreeConfigProducer<CHILD extends AnyConfigProducer>
java.lang.Object
com.yahoo.config.model.producer.AnyConfigProducer
com.yahoo.config.model.producer.TreeConfigProducer<CHILD>
- All Implemented Interfaces:
com.yahoo.config.ConfigInstance.Producer,ConfigProducer,Serializable
- Direct Known Subclasses:
AbstractConfigProducerRoot,AbstractService,Admin,ApplicationConfigProducerRoot,Chain,Chains,Client,ClusterControllerCluster,Component,ConfigProducerGroup,ConfigserverCluster,ContainerCluster,ContentCluster,ContentSearchCluster,DistributorCluster,Host,HostSystem,Http,ModelConfigProvider,PersistenceEngine,SearchCluster,SimpleConfigProducer,StorageCluster
Superclass for all producers with children.
Config producers constructs and returns config instances on request.
- Author:
- gjoranv, arnej
- See Also:
-
Field Summary
Fields inherited from class com.yahoo.config.model.producer.AnyConfigProducer
log -
Constructor Summary
ConstructorsConstructorDescriptionTreeConfigProducer(TreeConfigProducer parent, String subId) Creates a new TreeConfigProducer with the given parent and subId.TreeConfigProducer(String subId) Create an config producer with a configId only. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds a child to this config producer.protected voidReturns this ConfigProducer's children (only 1st level)<J extends AnyConfigProducer>
List<J>getChildrenByTypeRecursive(Class<J> type) protected ClassLoadergetConfigClassLoader(String producerName) Returns a list of all the children of this who are instances of ServicevoidremoveChild(CHILD child) voidvalidate()check constraints depending on the state of the vespamodel graph.Methods inherited from class com.yahoo.config.model.producer.AnyConfigProducer
addConfigId, addUserConfig, cascadeConfig, currentConfigId, findInheritedClassLoader, getConfigId, getMonitoringService, getParent, getRoot, getSubId, getUserConfigs, hostSystem, mergeUserConfigs, remove, setParent, setUserConfigs, stateIsHostedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.yahoo.vespa.model.ConfigProducer
dump
-
Constructor Details
-
TreeConfigProducer
Creates a new TreeConfigProducer with the given parent and subId. This constructor will add the resulting producer to the children of parent.- Parameters:
parent- the parent of this ConfigProducersubId- the fragment of the config id for the producer
-
TreeConfigProducer
Create an config producer with a configId only. Used e.g. to create root nodes, and producers that are given children after construction usingaddChild(AnyConfigProducer).- Parameters:
subId- The sub configId. Note that this can be prefixed when calling addChild with this producer as arg.
-
-
Method Details
-
addChild
Adds a child to this config producer.- Parameters:
child- the child config producer to add
-
removeChild
-
getChildren
Returns this ConfigProducer's children (only 1st level) -
getChildrenByTypeRecursive
-
getDescendantServices
Returns a list of all the children of this who are instances of Service- Specified by:
getDescendantServicesin interfaceConfigProducer- Overrides:
getDescendantServicesin classAnyConfigProducer
-
addDescendantService
-
getConfigClassLoader
- Overrides:
getConfigClassLoaderin classAnyConfigProducer
-
validate
Description copied from interface:ConfigProducercheck constraints depending on the state of the vespamodel graph. When overriding, you must invoke super.- Specified by:
validatein interfaceConfigProducer- Overrides:
validatein classAnyConfigProducer- Throws:
Exception
-