public synchronized void statusMachine ( final String status , final DeviceState state ) throws DevFailed { if ( status != null ) { logger . debug ( "Changing status to: {}" , status ) ; this . status = status ; if ( setStatusMethod != null ) { try { setStatusMethod . invoke ( businessObject , status ) ; } catch ( final IllegalArgumentException e ) { throw DevFailedUtils . newDevFailed ( e ) ; } catch ( final IllegalAccessException e ) { throw DevFailedUtils . newDevFailed ( e ) ; } catch ( final InvocationTargetException e ) { if ( e . getCause ( ) instanceof DevFailed ) { throw ( DevFailed ) e . getCause ( ) ; } else { throw DevFailedUtils . newDevFailed ( e . getCause ( ) ) ; } } } } }
Change status of the device