
public interface Configurable
private Configurable.Environment environment ;
public void setEnvironment(Environment env) {
this.environment = env ;
}
public Environment getEnvironment() {
return this.environment ;
}
Since Java 8: many methods are now default methods and so do not need to be implemented
using the Environment object.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Configurable.Environment
instances of this class are created by the subsystem startup.
|
| Modifier and Type | Method and Description |
|---|---|
default void |
alias(String alias)
aliases this component.
|
default void |
change(String parameterName,
Object value)
Implementation of this method
should be annotated as
|
default ViewValue |
getCheckedValueFromConfiguration(String parameterName,
Object value)
to be used by "facade" commands that may set a value.
|
default <T> LinkedHashMap<String,T> |
getChildren(Class<T> clazz)
return a map of children that are "assignale to" the argument class.
|
default Object |
getComponentByName(String name)
returns a component in the same subsystem that bears this name.
|
default Dictionary |
getDictionary()
returns a command dictionary for this object (or its delegate in case the object is a proxy)
|
Configurable.Environment |
getEnvironment() |
default String |
getName()
get the name of this component
|
default Map.Entry<String,Object> |
getParent()
returns name and value of the parent object.
|
default Object |
getParentObject() |
default Subsystem |
getSubsystem() |
default void |
init()
this method is called as a "postStart" operation.
|
default void |
injectResources()
this method enables to inject field values provided the fields are declared in the current class
inherited fields are not accessible through this facility.
|
default List<Configurable> |
listChildren()
returns a list of children of the current object.
|
default void |
notifyChange(String parameterName,
String value)
to be used by "facade" commands that may set a value
the calling must have made a preliminary check with the configuration service. |
default void |
notifyChangeWithoutPreliminaryChecks(String parameterName,
Object value)
to be used by "facade" commands that may set a value then notify the
configuration without going through the preliminary check of the
configuration service.
|
default void |
postStart()
once all hardware components have been started this method is invoked.
|
default void |
proceduralWalk(java.util.function.Consumer<Configurable> pre,
java.util.function.Consumer<Configurable> post)
applies method recursively from the current node in the Component's tree.
|
default void |
publish(KVList kvlist)
publishes a list of key_object on the status bus
|
default void |
publish(List<ValueNotification> tdl)
publishes a predefined list of ValueNotification on the status bus.
|
default void |
publish(long timestamp,
KVList kvlist)
publishes a list of key_object on the status bus
|
default void |
publish(long timestamp,
String key,
Object value)
publishes a data object on the status bus
|
default void |
publish(String key,
long[] timestamps,
Object[] objects)
publishes a list of objects with corresponding timestamp on the bus
|
default void |
publish(String key,
Object value)
publishes a data object on the status bus
|
void |
setEnvironment(Configurable.Environment environment)
sets the current Environment Object for the Component.
|
default void |
shutdownNow()
requires the component to perform end of life operation.
|
default void |
start()
The component is ready to respond.
|
default TreeWalkerDiag |
treeWalk(java.util.function.Function<Configurable,TreeWalkerDiag> func,
java.util.function.Consumer<Configurable> post)
walks the components tree applying rules of TreeWalkerDiag (the walk
can be interrupted by HANDLING_CHILDREN (the code is not invoked on children)
or STOP (the code abruptly ends)
|
void setEnvironment(Configurable.Environment environment)
environment - Configurable.Environment getEnvironment()
default Subsystem getSubsystem()
default void init()
default void start()
default void postStart()
throws HardwareException
HardwareExceptiondefault void shutdownNow()
default String getName()
default void alias(String alias)
alias - default Object getComponentByName(String name)
name - default <T> LinkedHashMap<String,T> getChildren(Class<T> clazz)
T - clazz - could be an interface (or even Object.class)default List<Configurable> listChildren()
default Object getParentObject()
default Map.Entry<String,Object> getParent()
default void injectResources()
@Command(description="returns the Command dictionary for this component", type=QUERY) default Dictionary getDictionary()
default void publish(long timestamp,
String key,
Object value)
timestamp - key - value - default void publish(String key, Object value)
key - value - default void publish(long timestamp,
KVList kvlist)
timestamp - kvlist - default void publish(KVList kvlist)
kvlist - default void publish(String key, long[] timestamps, Object[] objects)
key - timestamps - should be the same size as the array of objectsobjects - default void publish(List<ValueNotification> tdl)
tdl - @Command(description="engineering mode change of parameter value", type=CONFIGURATION) default void change(@Argument(name="parameterName",description="Configuration parameter name") String parameterName, @Argument(name="value",description="Configuration parameter value") Object value) throws Exception
parameterName - value - Exceptiondefault ViewValue getCheckedValueFromConfiguration(String parameterName, Object value) throws Exception
parameterName - value - Exception - if the configuration service is unreachable or the
parsing fails or additional constraints added by the configuration
faildefault void notifyChangeWithoutPreliminaryChecks(String parameterName, Object value) throws Exception
parameterName - value - A string representing the value to be changed (use
String.valueOf(Object) if necessary)Exception - any exception that the configuration service may
firedefault void notifyChange(String parameterName, String value) throws Exception
parameterName - value - Exceptiondefault void proceduralWalk(java.util.function.Consumer<Configurable> pre, java.util.function.Consumer<Configurable> post)
try {
mainModule.proceduralWalk(Cocoon.consumer(MyClass::myMethodThatThrowsMyException), null);
} catch (MyException exc) {
//do something
}
pre - the method applied when visiting the nodepost - the method applied when all children of the node have been visited (can be null)default TreeWalkerDiag treeWalk(java.util.function.Function<Configurable,TreeWalkerDiag> func, java.util.function.Consumer<Configurable> post)
func - post - Copyright © 2015 LSST. All rights reserved.