Defining References for Object Types with Interfaces
A method on one of the registered object types can be exposed as a reference available to TIBCO Enterprise Administrator server and the user interface. In this manner, you can refer a TeaObject from another TeaObject.
Procedure
-
Define the method signature. The method cannot have any parameters and must return an array of objects that implement
com.tibco.tea.agent.api.BaseTeaObject.
For example, the
getNodes() method returns an array of nodes, and the Node class implements the class
com.tibco.tea.agent.api.BaseTeaObject.
public Node[] getNodes(){
// The code...
}
-
Mark the method as a reference using the
@TeaReference annotation. It provides the following information:
| Parameters |
Description |
| name |
Name of the reference |
| objectType (optional) |
Needed when more than one object types are defined on the referenced class |
For example:
@TeaReference(name = "nodes")
public Node[] getNodes(){
// The code...
}
Copyright © Cloud Software Group, Inc. All Rights Reserved.