int attachedPort = attCookie.getPortNumber(); if (sameMachine(attCookie.getHostName(), host) && Integer.parseInt(port) == attachedPort) {
@Override public void run() { if (ServerRegistry.getInstance().getServerInstance(url) == null) { return; } Target target = _retrieveTarget(null); ServerDebugInfo sdi = getServerDebugInfo(target); if (sdi == null) { LOGGER.log(Level.FINE, "DebuggerInfo cannot be found for: " + ServerInstance.this); return; // give it up } AttachingDICookie attCookie = (AttachingDICookie)session.lookupFirst(null, AttachingDICookie.class); if (attCookie == null) { LOGGER.log(Level.FINE, "AttachingDICookie cannot be found for: " + ServerInstance.this); return; // give it up } if (ServerDebugInfo.TRANSPORT_SHMEM.equals(sdi.getTransport())) { String shmem = attCookie.getSharedMemoryName(); if (shmem != null && shmem.equalsIgnoreCase(sdi.getShmemName())) { registerListener(session); } } else { String host = attCookie.getHostName(); if (host != null && isSameHost(host, sdi.getHost()) && attCookie.getPortNumber() == sdi.getPort()) { registerListener(session); } } } });
private boolean isDebugged() { J2eeModuleProvider jmp = getProject().getLookup().lookup(J2eeModuleProvider.class); ServerDebugInfo sdi = jmp.getServerDebugInfo(); if (sdi == null) { return false; } Session[] sessions = DebuggerManager.getDebuggerManager().getSessions(); for (int i=0; i < sessions.length; i++) { Session s = sessions[i]; if (s != null) { Object o = s.lookupFirst(null, AttachingDICookie.class); if (o != null) { AttachingDICookie attCookie = (AttachingDICookie)o; if (sdi.getTransport().equals(ServerDebugInfo.TRANSPORT_SHMEM)) { if (attCookie.getSharedMemoryName().equalsIgnoreCase(sdi.getShmemName())) { return true; } } else { if (attCookie.getHostName().equalsIgnoreCase(sdi.getHost()) && attCookie.getPortNumber() == sdi.getPort()) { return true; } } } } } return false; }
if (attCookie.getPortNumber() == sdi.getPort()) { return true;
if (attCookie.getPortNumber() == sdi.getPort()) { return true;
if (attCookie.getPortNumber() == sdi.getPort()) { return true;
if (host == null) continue; if (host.equalsIgnoreCase(sdi.getHost())) { if (attCookie.getPortNumber() == sdi.getPort()) { Object d = s.lookupFirst(null, JPDADebugger.class); if (d != null) {
String host = attCookie.getHostName(); if (host != null && isSameHost(host, sdi.getHost()) && attCookie.getPortNumber() == sdi.getPort()) {
int attachedPort = attCookie.getPortNumber(); ServerDebugInfo dbi = (ServerDebugInfo)debugInfoMap.get(sunDm.getHost()+sunDm.getPort()); if (null != dbi) {
String host = attCookie.getHostName(); if (host != null && isSameHost(host, sdi.getHost()) && attCookie.getPortNumber() == sdi.getPort()) { s.kill();