Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Defining a Top-Level Object Type in Interface Style

Defining a top-level object type is a special case of defining a singleton type, with two differences: First, a top-level object type does not require a getConcept method, because its concept is self-evident (it is always TeaConcept.TOP_LEVEL). Second, TopLevelTeaObject extends the WithMembers interface, so you must implement the getMemebers method.

Procedure
1. Define a class that models the managed object type. Your class must implement the interface TopLevelTeaObject.
   For example, when modeling a car, the top-level is the car itself.

       public class Car implements TopLevelTeaObject {

           public String getName() {
               // Return the name of the car instance;
               return "Car";
           }

           public String getDescription() {
               // Return the description of the car instance;
               return "Car";
           }

           public String getKey() {
               // Return the key that corresponds to the car instance;
               return "Car";
           }

             // These methods give the top-level object functionality
            // that would otherwise be in the provider.

           public String getTypeName() {
               // Return the name of the car object type.
               return "Car";
           }

           public String getTypeDescription() {
               // Return the description of the car object type.
               return "Car";
           }

           public Collection<BaseTeaObject> getMembers() {
               	// Return the main parts of the car.
           }

       }

2. Register the unique instance of the class.

       CarAgentServer server = ...
       Car myCar = new Car;server.registerInstance(myCar);
       // Register other instances.
        ...
       server.start();

   Notice that instead of registering the provider, we register the unique instance of the car class.

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.