public void connectionStateChanged(TransportStateEvent change) {
if (localhostSubagentsOnly &&
(change.getNewState() == TransportStateEvent.STATE_CONNECTED) &&
(change.getPeerAddress() instanceof IpAddress)) {
IpAddress peerAddress = (IpAddress)change.getPeerAddress();
if (!peerAddress.getInetAddress().isLoopbackAddress()) {
LOGGER.warn("Connection attempt made from non loopback (i.e. local) address '"+
peerAddress+"' which will be ignored");
change.setCancelled(true);
return;
}