Package commonj.work

Examples of commonj.work.WorkEvent


     */
    private void workAccepted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workAccepted(event);
        }
    }
View Full Code Here


     */
    private void workStarted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_STARTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workStarted(event);
        }
    }
View Full Code Here

        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }
View Full Code Here

   public synchronized WorkItem schedule( Work         work,
                                          WorkListener listener )
   throws WorkException,
          IllegalArgumentException
   {
      WorkEvent event;

      if ( work == null )
      {
         throw new IllegalArgumentException( MSG.getMessage( Keys.NULL_WORK) );
      }
View Full Code Here

       */
      public void run(  )
      { //todo fix this
         WorkItem  workItem = new WorkItemImpl(  );

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

   public synchronized WorkItem schedule( Work         work,
                                          WorkListener listener )
   throws WorkException,
          IllegalArgumentException
   {
      WorkEvent event;

      if ( work == null )
      {
         throw new IllegalArgumentException( MSG.getMessage( Keys.NULL_WORK) );
      }
View Full Code Here

       */
      public void run(  )
      { //todo fix this
         WorkItem  workItem = new WorkItemImpl(  );

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

     */
    private void workAccepted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_ACCEPTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workAccepted(event);
        }
    }
View Full Code Here

     */
    private void workStarted(final WorkItemImpl workItem, final Work work) {
        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_STARTED);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workStarted(event);
        }
    }
View Full Code Here

        WorkListener listener = workItems.get(workItem);
        if (listener != null) {
            workItem.setStatus(WorkEvent.WORK_COMPLETED);
            workItem.setResult(work);
            workItem.setException(exception);
            WorkEvent event = new WorkEventImpl(workItem);
            listener.workCompleted(event);
            workItems.remove(workItem);
        }
    }
View Full Code Here

TOP

Related Classes of commonj.work.WorkEvent

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.