Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Defining Multiple Object Types on One Class

In annotation style, you can use one Java class to model two or more managed object types.

Procedure
1. Annotate the class as @TeaObjectTypes, and include within it a separate @TeaObjectType annotation for each of the object types that the class can represent.

   For example,

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

2. For each object type, define a method that translates from an object key to basic information about the object, and annotate that method as @TeaGetInfo. You must include the objectType attribute in the annotation, to distinguish the object type to which each such method applies.

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

           @TeaGetInfo(objectType = "TOMCAT_SERVER")
           AgentObjectInfo getServerInfo(@KeyParam final String key) {
               ...
           }

           @TeaGetInfo(objectType = "TOMCAT_WEBAPP")
           AgentObjectInfo getWebappInfo(@KeyParam final String key) {
               ...
           }
       }

3. Similarly, include the objectType attribute when modeling aspects such as state, configuration, members, operations and references.

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.