com.prosysopc.ua.server.nodes
Class ReflectionCallback
java.lang.Object
com.prosysopc.ua.server.nodes.ReflectionCallback
- All Implemented Interfaces:
- UaVariableCallback
public class ReflectionCallback
- extends Object
- implements UaVariableCallback
|
Field Summary |
static boolean |
LAZY_INIT
A global flag which determines whether the reflective property getters and setters are
initialized only upon first use. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LAZY_INIT
public static boolean LAZY_INIT
- A global flag which determines whether the reflective property getters and setters are
initialized only upon first use. The alternative is to initialize them when the
ReflectiveVariable is created, which enables error-checking upon property creation, instead of
when the property is first accessed from a UA client.
The option is not set by default, to give more emphasis on earlier error checking. set it on,
once you have checked your application and you know that all properties are OK, and you can
safely give it a small performance boost by limiting the initialization to those properties
that are actually used.
ReflectionCallback
public ReflectionCallback(Object object,
String propertyName)
throws SecurityException,
NoSuchMethodException
- Parameters:
object - propertyName -
- Throws:
NoSuchMethodException
SecurityException
getValue
public Object getValue()
throws StatusException
- Specified by:
getValue in interface UaVariableCallback
- Returns:
- the current value of the variable.
- Throws:
StatusException - if the value is not available. Set the StatusCode to what should be
provided.
setValue
public boolean setValue(Object newValue)
throws StatusException
- Specified by:
setValue in interface UaVariableCallback
- Parameters:
newValue - the new value to set for the variable.
- Returns:
- true if the value was changed
- Throws:
StatusException - if the value cannot or may not be written
Copyright © 2018. All rights reserved.