code: public void startPolling(final String polledObject, final int pollingPeriod) throws DevFailed {
          try {
              final AttributeImpl attr = AttributeGetterSetter.getAttribute(polledObject, device.getAttributeList());
              attr.configurePolling(pollingPeriod);
              device.startPolling(attr);
          } catch (final DevFailed e) {
              if (polledObject.equalsIgnoreCase(DeviceImpl.STATE_NAME)
                      || polledObject.equalsIgnoreCase(DeviceImpl.STATUS_NAME)) {
                  final CommandImpl cmd = device.getCommand(polledObject);
                  cmd.configurePolling(pollingPeriod);
                  device.startPolling(cmd);
              } else {
                  throw e;
              }
          }
      }
docs: Configure polling of an attribute or a command and start it
  
  @param polledObject  The name of the polled object (attribute or command)
  @param pollingPeriod The polling period
  @throws DevFailed