return m_container.getServerEndpoint();
}
@Override
public AgentClient getKnownAgentClient(Agent agent) {
AgentClient agent_client;
if (agent == null) {
throw new IllegalStateException("Agent must be non-null - is a resource not assigned an agent?");
}
// first see if its already cached, if not we need to create one.
synchronized (m_knownAgentClients) {
String agent_address = agent.getAddress();
int agent_port = agent.getPort();
agent_client = m_knownAgentClients.get(getEndpointKey(agent_address, agent_port));
// BZ1071994: Note that this cache can be dirty in an HA environment. As such, we need to ensure cache
// entries are correct. Do a quick token match on the cache entry, when accessed, and recreate as needed.
if ((agent_client == null) || !agent_client.getAgent().getAgentToken().equals(agent.getAgentToken())) {
String remote_uri;
InvokerLocator locator = m_knownAgents.getAgent(agent_address, agent_port);
if (locator != null) {
remote_uri = locator.getLocatorURI();