Package commonj.work

Examples of commonj.work.WorkRejectedException


         if ( listener != null )
         {
            listener.workRejected( event );
         }

         throw new WorkRejectedException( e );
      }

      event = new WorkEventImpl( WorkEvent.WORK_ACCEPTED, workItem );
      this.processEvent( event );
      if ( listener != null )
View Full Code Here


         if ( listener != null )
         {
            listener.workRejected( event );
         }

         throw new WorkRejectedException( e );
      }

      event = new WorkEventImpl( WorkEvent.WORK_ACCEPTED, workItem );
      this.processEvent( event );
      if ( listener != null )
View Full Code Here

        } else {
            workItem.setStatus(WorkEvent.WORK_REJECTED);
            if (workListener != null) {
                workListener.workRejected(new WorkEventImpl(workItem));
            }
            throw new WorkRejectedException("Unable to schedule work");
        }
    }
View Full Code Here

        } else {
            workItem.setStatus(WorkEvent.WORK_REJECTED);
            if (workListener != null) {
                workListener.workRejected(new DefaultWorkEvent(workItem));
            }
            throw new WorkRejectedException("Unable to schedule work");
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public void testWorkRejectedListener() throws Exception {
        WorkManager mgr = createMock(WorkManager.class);
        mgr.schedule(isA(Work.class), isA(WorkListener.class));
        expectLastCall().andThrow(new WorkRejectedException());
        replay(mgr);
        Jsr237WorkScheduler scheduler = new Jsr237WorkScheduler(mgr);
        Work work = createMock(Work.class);
        NotificationListener<Runnable> listener = createMock(NotificationListener.class);
        listener.workRejected(isA(Runnable.class));
View Full Code Here

    @SuppressWarnings("unchecked")
    public void testWorkRejectedNoListener() throws Exception {
        WorkManager mgr = createMock(WorkManager.class);
        mgr.schedule(isA(Work.class));
        expectLastCall().andThrow(new WorkRejectedException());
        replay(mgr);
        Jsr237WorkScheduler scheduler = new Jsr237WorkScheduler(mgr);
        Work work = createMock(Work.class);
        try {
            scheduler.scheduleWork(work);
View Full Code Here

         if ( listener != null )
         {
            listener.workRejected( event );
         }

         throw new WorkRejectedException( e );
      }

      event = new WorkEventImpl( WorkEvent.WORK_ACCEPTED, workItem );
      this.processEvent( event );
      if ( listener != null )
View Full Code Here

TOP

Related Classes of commonj.work.WorkRejectedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.