Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Modeling Configuration in Interface Style

To model a managed object that has configuration, implement the supplemental interface com.tibco.tea.agent.api.WithConfig<CONFIG>. WithConfig is a generic interface. It requires that you implement one method, getConfig, which returns a configuration object.

See also Configuration Aspect.

Before you beginThe container object is defined in interface style.

Procedure
1. Define a configuration bean that encapsulates all the parameters of the managed object.
   For example, the configuration of a radio could include changeable settings (such as the frequency and volume) and unchanging attributes (such as model and serial number).

       public class RadioConfig {

           private long frequency;
           private int volume;
           private string model;
           private string serial;

           // Constructors.  Get and set methods for each field.
           ...
       }

2. Implement the WithConfig<CONFIG> interface in your managed object type. Substitute your configuration class as the generic type parameter CONFIG.

       public class Radio implements TopLevelTeaObject, WithConfig<RadioConfig> {
           ...
           public RadioConfig getConfig() {
               ...
           }
       }

3. Declare that the getConfig method returns an instance of your configuration class.

       public class Radio implements TopLevelTeaObject, WithConfig<RadioConfig> {
           ...
           public RadioConfig getConfig() {
               ...
           }
       }

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.