code: void addToRelockList(final DeviceProxy dev, final int validity) throws DevFailed {
          // Check if it is the first relock
          if (relockMap == null) {
              // Create hash table for admin devices object
              relockMap = new Hashtable<String, LockedDeviceAmin>();
  
              // Create a thread to unlock all devices at exit
              Runtime.getRuntime().addShutdownHook(new ShutdownThread());
  
              // Create thread fo garbage callector call preiodicaly
              new GarbageThread().start();
          }
          // Check if admin device already exists.
          String adm;
          try {
              adm = dev.adm_name();
          } catch (final DevFailed e) {
              // Give up
              return;
          }
          final LockedDevice ld = new LockedDevice(dev.get_name(), validity);
          LockedDeviceAmin lda;
          if (!relockMap.containsKey(adm)) {
              // if not, crate and add th the list
              lda = new LockedDeviceAmin(adm, ld);
              lda.start();
              relockMap.put(adm, lda);
          } else {
              lda = relockMap.get(adm);
              lda.add(ld);
          }
      }
docs: ===============================================================