1 19 20 package org.netbeans.modules.debugger.jpda; 21 22 import java.util.Map ; 23 24 import org.netbeans.api.debugger.jpda.JPDADebugger; 25 import org.netbeans.api.debugger.jpda.ListeningDICookie; 26 import org.netbeans.spi.debugger.SessionProvider; 27 import org.netbeans.spi.debugger.ContextProvider; 28 import org.openide.util.NbBundle; 29 30 34 public class ListeningSessionProvider extends SessionProvider { 35 36 private ContextProvider contextProvider; 37 private ListeningDICookie smadic; 38 39 public ListeningSessionProvider (ContextProvider contextProvider) { 40 this.contextProvider = contextProvider; 41 smadic = (ListeningDICookie) contextProvider.lookupFirst 42 (null, ListeningDICookie.class); 43 }; 44 45 public String getSessionName () { 46 Map arguments = (Map ) contextProvider.lookupFirst 47 (null, Map .class); 48 if (arguments != null) { 49 String processName = (String ) arguments.get ("name"); 50 if (processName != null) 51 return LaunchingSessionProvider.findUnique (processName); 52 } 53 if (smadic.getSharedMemoryName () != null) 54 return NbBundle.getMessage 55 (ListeningSessionProvider.class, "CTL_Listening") + 56 ":" + smadic.getSharedMemoryName (); 57 return NbBundle.getMessage 58 (ListeningSessionProvider.class, "CTL_Listening") + 59 ":" + smadic.getPortNumber (); 60 } 61 62 public String getLocationName () { 63 return NbBundle.getMessage 64 (ListeningSessionProvider.class, "CTL_Localhost"); 65 } 66 67 public String getTypeID () { 68 return JPDADebugger.SESSION_ID; 69 } 70 71 public Object [] getServices () { 72 return new Object [0]; 73 } 74 } 75 76 | Popular Tags |