Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Auto-Registering in the Servlet Mode

The following example shows how the TeaAgentServlet can be configured to auto-register itself.

    public class HelloWorldAgentServlet extends TeaAgentServlet{
    	private static final long serialVersionUID = 8327019718482894467L;

    	@Override
    	public void init() throws ServletException {
    		super.init();
    this.autoRegisterAgent("http://localhost:8777", "http://localhost:8080");
    	}

    	@Override
    	protected Object[] getObjectInstances() throws ServletException {
    		return new Object[] {new HelloWorld()};
    	}
    }

After making a call to the init method in the super class of TeaAgentServlet, call thecom.tibco.tea.agent.server.TeaAgentServlet.autoRegisterAgent() method.
Note: The com.tibco.tea.agent.server.TeaAgentServlet.autoRegisterAgent() must be the last line in the code for the class. You cannot call any other method such as the unregisterAgent() method after this line.

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.