code: private void callEventSubscriptionAndConnect(DeviceProxy device, String eventType)
              throws DevFailed {
          //  Done for IDL>=5 and not for notifd event system (no attribute name)
          String device_name = device.name();
          String[] info = new String[] {
                  device_name,
                  "",
                  "subscribe",
                  eventType,
                  Integer.toString(device.get_idl_version())
          };
          DeviceData argIn = new DeviceData();
          argIn.insert(info);
          String cmdName = getEventSubscriptionCommandName();
          ApiUtil.printTrace(device.get_adm_dev().name() + ".command_inout(\"" +
                  cmdName + "\") for " + device_name + eventType);
          DeviceData argOut =
                  device.get_adm_dev().command_inout(cmdName, argIn);
          ApiUtil.printTrace("    command_inout done.");
  
          //	And then connect to device
          checkDeviceConnection(device, null, argOut, eventType);
      }
docs: ===============================================================