Defining an Object Type in Interface Style
To define an object type in interface style, your agent code models a managed object as a Java class that implements appropriate interfaces. Then it registers an instance, which lets the agent library call the interface methods.
We present the general task of defining an object type that can have more than one instance. Singleton object types and top-level object types are special cases; to see how they differ from this general case, see
Defining a Singleton Object Type in Interface Style and
Defining a Top-Level Object Type in Interface Style.
Procedure
- Defining a Singleton Object Type in Interface Style
Defining a singleton object type is a special case of defining an object type. The difference is that a singleton object type does not require a provider. Alternatively, we might say that its unique instance is its own provider. - 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. - Access to Instances
Your agent code can give the agent library access to your object instances. The agent library can call methods of those instances. You can either register a single instances, or register a provider that lets the agent library request instances on demand.
Related tasks
Copyright © Cloud Software Group, Inc. All rights reserved.