Examples of Work


Examples of com.alexecollins.vbox.core.Work

  public void setContext(String context) {
    this.context = context;
  }

  protected Work work() {
    return new Work(new Context(context));
  }
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Work

        BatchClass batch = analyze.getBatchClass();
        Collection<Work> works = batch.getDescription().getWorks();

        assertThat(works.size(), is(1));
        Work work = works.iterator().next();
        assertThat(work.getDeclaring(), is(batch.getDescription()));
        assertThat(work.getDependencies().size(), is(0));
        assertThat(work.getDescription(), is((Object) new JobFlowWorkDescription(JobFlow1.class)));
    }
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Work

@Batch(name = "join")
public class JoinBatch extends BatchDescription {

    @Override
    protected void describe() {
        Work first = run(FirstJobFlow.class).soon();
        Work second = run(SecondJobFlow.class).after(first);
        Work side = run(SideJobFlow.class).after(first);
        run(JoinJobFlow.class).after(second, side);
    }
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Work

@Batch(name = "ordered")
public class OrderedBatch extends BatchDescription {

    @Override
    protected void describe() {
        Work first = run(FirstJobFlow.class).soon();
        run(SecondJobFlow.class).after(first);
    }
View Full Code Here

Examples of com.asakusafw.vocabulary.batch.Work

@Batch(name = "diamond")
public class DiamondBatch extends BatchDescription {

    @Override
    protected void describe() {
        Work first = run(FirstFlow.class).soon();
        Work left = run(LeftFlow.class).after(first);
        Work right = run(RightFlow.class).after(first);
        run(LastFlow.class).after(left, right);
    }
View Full Code Here

Examples of com.googlecode.richrest.client.work.Work

    backButton = new Button(shell, SWT.PUSH);
    backButton.setText("后台运行");
    backButton.setBounds(264, 110, 80, 24);
    backButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        final Work work = WorkDialog.this.work;
        if (work != null && work.isBackable()) {
          ThreadUtils.execute(new Runnable(){
            public void run() {
              try {
                work.back();
              } catch (final Throwable t) {
                shell.getDisplay().asyncExec(new Runnable() {
                  public void run() {
                    MessageDialog.openError(shell, "后台运行", "后台运行传输项失败! 原因: " + t.getMessage());
                  }
                });
              }
            }
          });
        }
      }
    });

    abortButton = new Button(shell, SWT.PUSH);
    abortButton.setText("中止");
    abortButton.setBounds(348, 110, 80, 24);
    abortButton.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent event) {
        final Work work = WorkDialog.this.work;
        if (work != null && work.isAbortable()) {
          ThreadUtils.execute(new Runnable(){
            public void run() {
              try {
                work.abort();
              } catch (final Throwable t) {
                shell.getDisplay().asyncExec(new Runnable() {
                  public void run() {
                    MessageDialog.openError(shell, "中止", "中止传输项失败! 原因: " + t.getMessage());
                  }
                });
              }
            }
          });
        }
      }
    });

    workListener = new WorkAdapter() { // 只在非UI线程执行
      public void onForeWorking(WorkEvent event) {
        if (UIUtils.isNonUIThread(event.getThread())) {
          showWork(event.getWork());
        }
      }
      public void onBackWorking(WorkEvent event) {
        onWorked(event);
      }
      public void onWorked(WorkEvent event) {
        if (UIUtils.isNonUIThread(event.getThread())) {
          try {
            if (Worker.getWorker().isForeWorking()) {
              Work work = Worker.getWorker().getForeWorks().iterator().next();
              showWork(work);
              return;
            }
          } catch (Throwable t) {
            // ignore
View Full Code Here

Examples of com.projity.datatype.Work

    public Object convert(Class type, Object value) throws ConversionException {
      if (value == null)
        return Duration.getInstanceFromDouble(null);
     
      if (value instanceof Number) {
        return new Work(((Number)value).longValue());
      } else if (value instanceof Work) {
        return new Work(((Work)value).longValue());
      } else if (value instanceof Duration) {
        return value;
      } else if (value instanceof String) {
        try {
          return DurationFormat.getWorkInstance().parseObject((String) value);
View Full Code Here

Examples of com.sun.corba.se.spi.orbutil.threadpool.Work

            ((ThreadPoolImpl)workerThreadPool).notifyForAvailableWork(this);
    }

    synchronized Work requestWork(long waitTime) throws TimeoutException, InterruptedException
    {
        Work workItem;
        ((ThreadPoolImpl)workerThreadPool).incrementNumberOfAvailableThreads();

            if (theWorkQueue.size() != 0) {
                workItem = (Work)theWorkQueue.removeFirst();
                totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime();
                workItemsDequeued++;
                ((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads();
                return workItem;
            }

            try {

                long remainingWaitTime = waitTime;
                long finishTime = System.currentTimeMillis() + waitTime;

                do {

                    this.wait(remainingWaitTime);

                    if (theWorkQueue.size() != 0) {
                        workItem = (Work)theWorkQueue.removeFirst();
                        totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime();
                        workItemsDequeued++;
                        ((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads();
                        return workItem;
                    }
View Full Code Here

Examples of commonj.work.Work

  // Implementation of the Spring SchedulingTaskExecutor interface
  //-------------------------------------------------------------------------

  public void execute(Runnable task) {
    Assert.state(this.workManager != null, "No WorkManager specified");
    Work work = new DelegatingWork(task);
    try {
      if (this.workListener != null) {
        this.workManager.schedule(work, this.workListener);
      }
      else {
View Full Code Here

Examples of edu.csusm.cs671.auction.model.Work

    AuctionAgent auctionAgent = new AuctionAgentImpl(agentConfig);
    auctionAgent.start();
   
    StartAuctionMessage auctionMessage = new StartAuctionMessage();
   
    Work work = new Work(WorkType.TYPE_A,new Size(10000) );
   
    auctionMessage.setAuctionID(UUID.randomUUID());
    //auctionMessage.setTimeAuctionIsOpen(new Duration(10));
    auctionMessage.setWorkForAuction(work);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.