private void fireWorkContextSetupFailed ( Object workContext , String errorCode , WorkListener workListener , Work work , WorkException exception ) { if ( workListener != null ) { WorkEvent event = new WorkEvent ( this , WorkEvent . WORK_STARTED , work , null ) ; workListener . workStarted ( event ) ; } if ( workContext instanceof WorkContextLifecycleListener ) { WorkContextLifecycleListener listener = ( WorkContextLifecycleListener ) workContext ; listener . contextSetupFailed ( errorCode ) ; } if ( workListener != null ) { WorkEvent event = new WorkEvent ( this , WorkEvent . WORK_COMPLETED , work , exception ) ; workListener . workCompleted ( event ) ; } }
Calls listener with given error code .