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
ConstructorDescriptionTreeConfigProducer
(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 void
Adds a child to this config producer.protected void
Returns this ConfigProducer's children (only 1st level)<J extends AnyConfigProducer>
List<J>getChildrenByTypeRecursive
(Class<J> type) protected ClassLoader
getConfigClassLoader
(String producerName) Returns a list of all the children of this who are instances of Servicevoid
removeChild
(CHILD child) void
validate()
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, stateIsHosted
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getDescendantServices
in interfaceConfigProducer
- Overrides:
getDescendantServices
in classAnyConfigProducer
-
addDescendantService
-
getConfigClassLoader
- Overrides:
getConfigClassLoader
in classAnyConfigProducer
-
validate
Description copied from interface:ConfigProducer
check constraints depending on the state of the vespamodel graph. When overriding, you must invoke super.- Specified by:
validate
in interfaceConfigProducer
- Overrides:
validate
in classAnyConfigProducer
- Throws:
Exception
-