Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Defining an Object Type in Annotation Style

In annotation style, agent code models a managed object type by defining a class, and marking it with annotations, such as @TeaObjectType.

Procedure
1. Annotate the object type class as @TeaObjectType. Supply the required attributes—name, description and concept.

       @TeaObjectType(name="TOMCAT_SERVER",
           description="Tomcat Server"
           concept=TeaConcept.PROCESS,)
       public class TomcatServerManager {
           ...
       }

2. Define a method that translates from an object key to basic information about the object, and annotate that method as @TeaGetInfo.
   This method must return an instance of AgentObjectInfo.

       @TeaObjectType(name="TOMCAT_SERVER",
           description="Tomcat Server"
           concept=TeaConcept.PROCESS,)
       public class TomcatServerManager {

           @TeaGetInfo
           public AgentObjectInfo getInfo(@KeyParam final String key) {
               Server server = lookupTomcatServer(key);
               AgentObjectInfo result = new AgentObjectInfo();
               result.setName(server.getName());
               result.setDesc(server.getDescription);
               return result;
           }

           Server lookupTomcatServer(String key) {
               ... // domain specific implementation
           }
       }

   For top-level object types, this method does not accept any arguments. (An object key would be superfluous because a top-level type can have only one instance.)

3. If the object type has state, define a method that returns the current state of an instance, and annotate it as @TeaGetStatus.
   For details, see Modeling State in Annotation Style.
4. If the object type has configuration, define a method that returns the configuration, and annotate it as @TeaGetConfig.
   For details, see Modeling Configuration in Annotation Style.
5. If the object type can contain members, define a method that returns the members, and annotate it as @TeaGetMembers.
   For details, see Modeling Members in Annotation Style.

What to do next

Annotations:

To model aspects of object types in annotation style, see these topics:

- Modeling State in Annotation Style
- Modeling Configuration in Annotation Style
- Modeling Members in Annotation Style
- Defining Operations
- Defining References for Object Types with Annotations

Subtopics

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO® Enterprise Administrator

Copyright © 1996-2025. Cloud Software Group, Inc. All Rights Reserved.