Configuring TIBCO Enterprise Administrator Agent for Auto-Registration

The TIBCO Enterprise Administrator agent library can be configured to auto-register itself with the TIBCO Enterprise Administrator server. When TIBCO Enterprise Administrator Agent comes up, the agent library connects to the server and registers itself. Ensure that the agent library is setup with the correct connection details for the server.

Procedure

  1. Configure the authentication for connecting with the server using java.net.Authenticator.
     Authenticator.setDefault(new Authenticator() {
                            
                            /* (non-Javadoc)
                            * @see java.net.Authenticator#getPasswordAuthentication()
                            */
                            @Override
                            protected PasswordAuthentication getPasswordAuthentication() {
                            return new PasswordAuthentication("admin", "admin".toCharArray());
                            }
                            });
                            server.registerInstance(new HelloWorldAgent());
                        
  2. com.tibco.tea.agent.server.TeaAgentServer.registerAgentAutoRegisterListener() should be used for specifying that the agent should register with the server and the serverUrl where the server is accessible.
    server.registerAgentAutoRegisterListener("http://localhost:8777/tea");
                            server.start();

Example: Configuring TeaAgentServer for Auto-registeration

This example shows how TeaAgentServer can be configured to auto-register itself. You can use the same procedure to configure TeaAgentServlet to auto-register with the server.

TeaAgentServer server = new TeaAgentServer("HelloWorldAgent", "1.0", "Hello World Agent", 1234, "/helloworldagent", true);
Authenticator.setDefault(new Authenticator() {

	@Override
	protected PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication("admin", "admin".toCharArray());
	}
});
server.registerInstance(new HelloWorldAgent());
server.registerAgentAutoRegisterListener("http://localhost:8777/tea");
server.start();

Unregistering an Agent: The agent is unregistered by using the TeaAgentServer.unregisterAgent() method. Similar to registration, authentication is configured using the java.net.Authenticator method.