Aspects for Object Types—Interfaces and Annotations
Supplemental interfaces and annotations let you model aspects of managed objects—such as states, configuration and references.
The results of your managed objects analysis indicate the aspects of each object type (see Aspects of Managed Objects). When defining an object type in interface style, implement these interfaces to model those aspects. When defining an object type in annotation style, use the corresponding annotations to model those aspects.
Aspect | Interface
com.tibco.tea.agent.api |
Annotation
com.tibco.tea.agent.annotations |
---|---|---|
States | WithStatus | TeaGetStatus |
Configuration | WithConfig | TeaGetConfig |
Members (containment relationship) | WithMembers | TeaGetMembers |
In contrast, to model operations and references you must use an annotation—even in interface style. See Defining Operations, Defining References for Object Types with Interfaces and Defining References for Object Types with Annotations.
- 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. - Modeling Configuration in Interface Style
To model a managed object that has configuration, implement the supplemental interface com.tibco.tea.agent.api.WithConfig<CONFIG>. WithConfig is a generic interface. It requires that you implement one method, getConfig, which returns a configuration object. - Modeling Members in Interface Style
To model a managed object that contains other managed objects, implement the supplemental interface com.tibco.tea.agent.api.WithMembers. - Modeling State in Annotation Style
To model a managed object that has states, implement a method the returns the current state, and annotate that method as @TeaGetStatus. - Modeling Configuration in Annotation Style
To model a managed object that has configuration, implement a method that returns a configuration object, and annotate that method as @TeaGetConfig - Modeling Members in Annotation Style
To model a managed object that contains other managed objects, implement a method that returns an array or java.util.Collection of members, and annotate that method as @TeaGetMembers.