For a provider to receive get operation requests, the provider must either a) implement the DOFObject.Provider interface or b) extend the DOFObject.DefaultProvider class. In this example, we show how to extend the DefaultProvider class and override the get method.
For a provider to handle any interface property, it must store the property’s value, usually in a class field. The type definition for the AlarmActive property is a boolean.
The Java OAL includes a DOFObject.Provider interface that you may implement fully when customized behavior is needed for all the callbacks in the Provider interface. However, it also contains a DOFObject.DefaultProvider class that implements the Provider interface and provides default functionality for operations you do not need to support. This can enable you to create more elegant code and it prevents you from having to implement methods that you do not need. For example, if you are providing a DOF interface that does not contain any methods, using DefaultProvider allows you to keep from having to implement your own invoke methods.
All requests to get a property are handled by this method. When the get request is received, the appropriate value is determined. Once the value is determined, the response to the request can be made using that value.