Provider Interface

A provider is an object within your agent code that translates instance keys into the corresponding Java objects.

When an agent defines an object type using the interface style , and that object type has more than one instance, then the agent must also define a corresponding provider.

Each such object type requires a separate provider class. (Top level object types and singleton object types do not require providers. Alternatively, one might say that for these types the single instance serves as its own provider.)

A provider class implements the interface TeaObjectProvider.

The getInstance method of this interface translates from instance keys to Java instances. Recall that the TIBCO Enterprise Administrator server refers to a managed object using an object ID; when the agent library receives an ID, it calls this provider method to obtain the actual Java instance that represents that managed object.

Other methods of the provider interface return information about the object type; for example, getTypeName. (For object types that have only one instance, the agent code defines these other methods on the object type class. For example, getConcept is part of the SingletonTeaObject interface.)

Your agent code must create an instance of the provider, and register it with the agent library.

If needed, you can register the Object provider for an interface/class that extends/implements the TeaObject interface. In this Object provider, you can choose to return instances of objects that implement this interface. For example, consider an object graph where clusters can have multiple machine, each machine can have multiple processes. Each process can have engines and an engine can have multiple cache/query/inference. In this example, the object provider for the engine can be registered and this object provider can return instances of cache/query/inference. The engine interface is implemented by cache, query, and inference.