Package org.jboss.aspects.asynchronous

Examples of org.jboss.aspects.asynchronous.AsynchronousTask


  public static void test2AsynchronousCallOnSameInstance2() {
    BusinessModel bm1 = new BusinessModel();
    AsynchronousFacade asynchronousFacade = (AsynchronousFacade)bm1;
    asynchronousFacade.setTimeout(50);
    long res1 = bm1.processBusinessModel2(1000);
    AsynchronousTask asynchronousTask1 =
      asynchronousFacade.getAsynchronousTask();
    asynchronousFacade.setTimeout(200);
    long res2 = bm1.processBusinessModel2(10);
    AsynchronousTask asynchronousTask2 =
      asynchronousFacade.getAsynchronousTask();
    assertEquals(
      "Method did not timeout !",
      TIMEOUT,
      asynchronousFacade.getResponseCode(asynchronousTask1));
View Full Code Here


      object instanceof AsynchronousFacade);
    assertTrue(
      "static method not an asynchronous call:" + (t1 - t0) + " ms.",
      (t1 - t0) < 100);
    AsynchronousFacade asynchronousFacade = (AsynchronousFacade)object;
    AsynchronousTask asynchronousTask1 =
      asynchronousFacade.getAsynchronousTask();
    assertEquals(
      "Method does not return the right value !",
      200,
      ((Long)asynchronousFacade.getReturnValue(asynchronousTask1))
View Full Code Here

    assertEquals(
      "Method did not timeout !",
      TIMEOUT,
      asynchronousFacade1.getResponseCode());
    AsynchronousFacade asynchronousFacade = (AsynchronousFacade)object2;
    AsynchronousTask asynchronousTask2 =
      asynchronousFacade.getAsynchronousTask();
    assertEquals(
      "Method does not return the right value !",
      150,
      ((Long)asynchronousFacade.getReturnValue(asynchronousTask2))
View Full Code Here

  public void run() {
    AsynchronousFacade asynchronousFacade =
      (AsynchronousFacade)businessModel;
    long res1 = businessModel.processBusinessModel2(parameter);
    BusinessModel.sleep(sleep);
    AsynchronousTask asynchronousTask1 =
      asynchronousFacade.getAsynchronousTask();
    if (!asynchronousFacade.isDone(asynchronousTask1))
      asynchronousFacade.waitForResponse(asynchronousTask1);
      result =asynchronousFacade.getReturnValue(asynchronousTask1);
View Full Code Here

  public JUnitTestAsynchronousAspects(String arg0) {
    super(arg0);
    BusinessModel bm1 = new BusinessModel();

    bm1.processBusinessModel();
    AsynchronousTask aT = ((AsynchronousFacade)bm1).getAsynchronousTask();
    ThreadManagerResponse response = aT.getResponse();

  }
View Full Code Here

  }
  public static void test2AsynchronousCallOnSameInstance() {
    BusinessModel bm1 = new BusinessModel();
    long res1 = bm1.processBusinessModel2(15);
    AsynchronousFacade asynchronousFacade = (AsynchronousFacade)bm1;
    AsynchronousTask asynchronousTask1 =
      asynchronousFacade.getAsynchronousTask();
    long res2 = bm1.processBusinessModel2(10);
    AsynchronousTask asynchronousTask2 =
      asynchronousFacade.getAsynchronousTask();
    assertEquals(
      "Method is not succesfull !",
      OK,
      asynchronousFacade.getResponseCode(asynchronousTask1));
View Full Code Here

    businessModel.processBusinessModel2(parameter);

    BusinessModel.sleep(sleep);

    AsynchronousTask asynchronousTask1 =

      asynchronousFacade.getAsynchronousTask();

    if (!asynchronousFacade.isDone(asynchronousTask1))
View Full Code Here



    bm1.processBusinessModel();

    AsynchronousTask aT = ((AsynchronousFacade)bm1).getAsynchronousTask();

    aT.getResponse();



  }
View Full Code Here

    bm1.processBusinessModel2(15);

    AsynchronousFacade asynchronousFacade = (AsynchronousFacade)bm1;

    AsynchronousTask asynchronousTask1 =

      asynchronousFacade.getAsynchronousTask();

    bm1.processBusinessModel2(10);

    AsynchronousTask asynchronousTask2 =

      asynchronousFacade.getAsynchronousTask();

    assertEquals(
View Full Code Here

    asynchronousFacade.setTimeout(50);

    bm1.processBusinessModel2(1000);

    AsynchronousTask asynchronousTask1 =

      asynchronousFacade.getAsynchronousTask();

    asynchronousFacade.setTimeout(200);

    bm1.processBusinessModel2(10);

    AsynchronousTask asynchronousTask2 =

      asynchronousFacade.getAsynchronousTask();

    assertEquals(
View Full Code Here

TOP

Related Classes of org.jboss.aspects.asynchronous.AsynchronousTask

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.