@Override
   public void scheduleWork(Work work) throws WorkException
   {
      if (policy == null || selector == null || transport == null ||
          work == null || !(work instanceof DistributableWork) || !scheduleWorkDistributionEnabled)
      {
         localScheduleWork(work);
      }
      else
      {
         doFirstChecks(work, WorkManager.INDEFINITE, null);
         checkTransport();

         DistributableWork dw = (DistributableWork)work;
         boolean executed = false;

         if (policy.shouldDistribute(this, dw))
         {
            Address dwmAddress = selector.selectDistributedWorkManager(getLocalAddress(), dw);
            if (dwmAddress != null && !getLocalAddress().equals(dwmAddress))
            {
               transport.scheduleWork(dwmAddress, dw);
               executed = true;
            }
         }

         if (!executed)
         {
            localScheduleWork(work);
         }
      }
   }
@ Override public void scheduleWork ( Work work ) throws WorkException { if ( policy == null || selector == null || transport == null || work == null || ! ( work instanceof DistributableWork ) || ! scheduleWorkDistributionEnabled ) { localScheduleWork ( work ) ; } else { doFirstChecks ( work , WorkManager . INDEFINITE , null ) ; checkTransport ( ) ; DistributableWork dw = ( DistributableWork ) work ; boolean executed = false ; if ( policy . shouldDistribute ( this , dw ) ) { Address dwmAddress = selector . selectDistributedWorkManager ( getLocalAddress ( ) , dw ) ; if ( dwmAddress != null && ! getLocalAddress ( ) . equals ( dwmAddress ) ) { transport . scheduleWork ( dwmAddress , dw ) ; executed = true ; } } if ( ! executed ) { localScheduleWork ( work ) ; } } }
{@inheritDoc}