Package commonj.work

Examples of commonj.work.WorkItem


   
    // commonj.work.WorkListener implementations
   
    public void workAccepted(WorkEvent we)
    {
        WorkItem workItem = we.getWorkItem();
        if (log.isDebugEnabled()) log.debug("[CommonjWorkMonitorImpl] workAccepted: " + workItem);
    }
View Full Code Here


        if (log.isDebugEnabled()) log.debug("[CommonjWorkMonitorImpl] workAccepted: " + workItem);
    }

    public void workRejected(WorkEvent we)
    {
        WorkItem workItem = we.getWorkItem();
        if (log.isDebugEnabled()) log.debug("[CommonjWorkMonitorImpl] workRejected: " + workItem);
       
        if (this.jobWorksMonitorEnabled)
        {
            removeMonitoredJobWork(workItem);
View Full Code Here

        }
    }

    public void workStarted(WorkEvent we)
    {
        WorkItem workItem = we.getWorkItem();
        if (log.isDebugEnabled()) log.debug("[CommonjWorkMonitorImpl] workStarted: " + workItem);
    }
View Full Code Here

        if (log.isDebugEnabled()) log.debug("[CommonjWorkMonitorImpl] workStarted: " + workItem);
    }

    public void workCompleted(WorkEvent we)
    {
        WorkItem workItem = we.getWorkItem();
        if (log.isDebugEnabled()) log.debug("[CommonjWorkMonitorImpl] workCompleted: " + workItem);
       
        if (this.jobWorksMonitorEnabled)
        {
            removeMonitoredJobWork(workItem);
View Full Code Here

                while (!this.renderingJobs.isEmpty())
                {
                    for (Iterator it = this.renderingJobs.iterator(); it.hasNext(); )
                    {
                        RenderingJob job = (RenderingJob) it.next();
                        WorkItem workItem = (WorkItem) job.getWorkerAttribute(COMMONJ_WORK_ITEM_ATTR);
                        int status = WorkEvent.WORK_ACCEPTED;
                       
                        if (workItem != null)
                        {
                            status = workItem.getStatus();
                        }
                       
                        boolean isTimeout = job.isTimeout();
                       
                        if (isTimeout)
View Full Code Here

                    }
                }
            } catch (Exception e) {
                log.error("Exceptiong during job killing.", e);
            } finally {
                WorkItem workItem = (WorkItem) job.getWorkerAttribute(COMMONJ_WORK_ITEM_ATTR);
               
                if (workItem != null)
                {
                    removeMonitoredJobWork(workItem);
                }
View Full Code Here

* @version $Rev: 430937 $ $Date: 2006-08-11 18:17:56 -0700 (Fri, 11 Aug 2006) $
*/
public class Jsr237WorkSchedulerTestCase extends TestCase {

    public void testSchedule() throws Exception {
        WorkItem item = createMock(WorkItem.class);
        WorkManager mgr = createMock(WorkManager.class);
        mgr.schedule(isA(Work.class));
        expectLastCall().andReturn(item);
        replay(mgr);
        Jsr237WorkScheduler scheduler = new Jsr237WorkScheduler(mgr);
View Full Code Here

        verify(mgr);
    }

    @SuppressWarnings("unchecked")
    public void testListener() throws Exception {
        WorkItem item = createMock(WorkItem.class);
        WorkManager mgr = createMock(WorkManager.class);
        mgr.schedule(isA(Work.class), isA(WorkListener.class));
        expectLastCall().andReturn(item);
        replay(mgr);
        Jsr237WorkScheduler scheduler = new Jsr237WorkScheduler(mgr);
View Full Code Here

   * @throws Exception the exception
   */
  public void run(Work job, WorkListener listener) throws Exception {
    logger.debug("IN");
    try {
      WorkItem wi = wm.schedule(job, listener);

    } catch (Exception e) {
      logger.error("Exception", e);
      throw e;
    } finally {
View Full Code Here

  public FooRemoteWorkItem runWithReturn(Work job, WorkListener listener) throws Exception {
    logger.debug("IN");
    FooRemoteWorkItem fooRemoteWorkItem=null;
    try {
      fooRemoteWorkItem=new FooRemoteWorkItem(job, listener, wm);
      WorkItem wi = wm.schedule(job, listener);

    } catch (Exception e) {
      logger.error("Exception", e);
      throw e;
    } finally {
View Full Code Here

TOP

Related Classes of commonj.work.WorkItem

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.