public DME2Locator(Access access, DME2Manager dm, String service, String version, String envContext, String routeOffer, boolean removeSelf) throws DME2Exception, UnknownHostException, LocatorException {
this.access = access;
if(dm==null) {
this.dm = new DME2Manager("DME2Locator created DME2Manager",System.getProperties());
} else {
this.dm = dm;
}
this.service = service;
this.version = version;
this.envContext = envContext;
this.routeOffer = routeOffer;
refresh();
DME2Server server = dm.getServer();
if(server == null) {
thisMachine = InetAddress.getLocalHost().getHostName();
thisPort = 0;
} else {
try {
thisMachine = server.getServerProperties().getHostname();
thisPort = server.getServerProperties().getPort();
} catch(NullPointerException np) {
access.log(Level.ERROR, "WARNING: DME2 threw a NullPointer Exception getting Server Machine and Port");
thisMachine = InetAddress.getLocalHost().getHostName();
thisPort = 0;
}
}
this.removeSelf = removeSelf;
}