Modeling State in Interface Style
To model a managed object that has states, implement the supplemental interface com.tibco.tea.agent.api.WithStatus. WithStatus requires that you implement one method, getStatus, which returns the current state of a managed object.
See also States Aspect.
Procedure
Implement the
WithStatus interface in your managed object type.
The status method must return an instance of the class
com.tibco.tea.agent.types.AgentObjectStatus.
AgentObjectStatus is a standard format for encapsulating state within agents. It has three fields:
- state
- Required. The state name.
- desc
- Optional. An interpretive description of the state.
- uptime
- Optional. The length of time that the managed object has been in this state.
public class TomcatServer implements TeaObject, WithStatus ... public AgentObjectStatus getStatus() { ... } }
Copyright © Cloud Software Group, Inc. All Rights Reserved.