Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# How to Share a TeaObject

To share an object, use the share() method of the TeaPersistence class. Once an object is shared, it is available for other agents to use. When you share a TeaObject, you share all the references in that object too. For example, if you share a person object called Peter who has cousins (references in the object Peter) named Adam, Sarah, and Brian, when you share Peter, you effectively share objects Adam, Sarah and Brian too.

Here is a sample code which shares a TeaObject, John:

    @TeaOperation(name = "sharePerson", description = "Share a Person object")

    public void sharePerson() throws IOException {
    // Person implements TeaObject and has objectTypeName="Person"
    //in this instance the key="John"
    final Person person = new Person("John", "Public John Person");
    //teaAgentServer is an instance of //com.tibco.tea.agent.server.TeaAgentServer //or//com.tibco.tea.agent.server.TeaAgentServletfinal TeaPersistence persistence = teaAgentServer.getPersistence();
    persistence.share(person);
    }

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.