コード例 #1
0
 private void checkValidStateChange(IWirelessSniffingModule module) {
   if (running)
     throw new IllegalStateException("Cannot enable/disable modules while daemon is running");
   if (!wirelessModules.contains(module))
     throw new IllegalArgumentException(
         "Cannot enable/disable unknown module : " + module.getName());
 }
コード例 #2
0
 void removeModule(IWirelessSniffingModule module) {
   disableModule(module);
   synchronized (wirelessModules) {
     wirelessModules.remove(module);
     modulesByName.remove(module.getName());
   }
 }
コード例 #3
0
 void addModule(IWirelessSniffingModule module) {
   synchronized (wirelessModules) {
     wirelessModules.add(module);
     modulesByName.put(module.getName(), module);
   }
   enableModule(module);
 }
コード例 #4
0
 void requestModuleInformation(IMessenger messenger, RequestWirelessModuleInformation msg)
     throws MessengerException {
   final List<ModuleRecord> modules = new ArrayList<ModuleRecord>();
   for (IWirelessSniffingModule m : wirelessModules) {
     modules.add(new ModuleRecord(m.getName(), isWirelessModuleEnabled(m)));
   }
   messenger.emitMessage(msg.createResponse(modules));
 }