public void initialise() throws InitialisationException
{
try
{
Agent agent = createRmiAgent();
final MuleRegistry registry = muleContext.getRegistry();
if (!isAgentRegistered(agent))
{
registry.registerAgent(agent);
}
// any existing jmx agent will be modified with remote connector settings
agent = createJmxAgent();
// there must be only one jmx agent, so lookup by type instead
if (registry.lookupObject(JmxAgent.class) == null)
{
registry.registerAgent(agent);
}
if (loadLog4jAgent)
{
agent = createLog4jAgent();
if (!isAgentRegistered(agent))
{
registry.registerAgent(agent);
}
}
agent = createJmxNotificationAgent();
if (!isAgentRegistered(agent))
{
registry.registerAgent(agent);
}
if (loadJdmkAgent)
{
agent = createJdmkAgent();
if (!isAgentRegistered(agent))
{
registry.registerAgent(agent);
}
}
if (loadMx4jAgent)
{
agent = createMx4jAgent();
if (!isAgentRegistered(agent))
{
registry.registerAgent(agent);
}
}
if (loadProfilerAgent)
{
agent = createProfilerAgent();
if (!isAgentRegistered(agent))
{
registry.registerAgent(agent);
}
}
// remove this agent once it has registered the other agents
//TODO RM* this currently does nothing!!!
registry.unregisterAgent(name);
}
catch (MuleException e)
{
throw new InitialisationException(e, this);
}