1 19 20 package org.netbeans.api.debugger; 21 22 import java.beans.*; 23 import java.io.*; 24 import java.util.*; 25 26 103 public final class DebuggerEngine { 104 105 106 108 private Lookup lookup; 109 private ActionsManager actionsManager; 110 111 112 DebuggerEngine ( 113 String typeID, 114 Session s, 115 Object [] services, 116 Lookup sessionLookup 117 ) { 118 Object [] services1 = new Object [services.length + 1]; 119 System.arraycopy (services, 0, services1, 0, services.length); 120 services1 [services1.length - 1] = this; 121 Lookup privateLookup = new Lookup.Compound ( 122 new Lookup.Instance (services1), 123 new Lookup.MetaInf (typeID) 124 ); 125 this.lookup = new Lookup.Compound ( 126 privateLookup, 127 sessionLookup 128 ); 129 } 130 131 151 157 public List lookup (String folder, Class service) { 158 return lookup.lookup (folder, service); 159 } 160 161 167 public Object lookupFirst (String folder, Class service) { 168 return lookup.lookupFirst (folder, service); 169 } 170 171 172 174 175 public synchronized ActionsManager getActionsManager () { 176 if (actionsManager == null) 177 actionsManager = new ActionsManager (lookup); 178 return actionsManager; 179 } 180 181 182 184 190 public class Destructor { 191 192 195 public void killEngine () { 196 Session[] ss = DebuggerManager.getDebuggerManager ().getSessions (); 197 int i, k = ss.length; 198 for (i = 0; i < k; i++) 199 ss [i].removeEngine (DebuggerEngine.this); 200 getActionsManager ().destroy (); 201 } 202 203 209 public void killLanguage (Session s, String language) { 210 s.removeLanguage (language, DebuggerEngine.this); 211 getActionsManager ().destroy (); 212 } 213 } 214 } 215 216 | Popular Tags |