Examples of LoggingAdapter


Examples of akka.event.LoggingAdapter

   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    ActorSystem system = ActorSystem.create("faultTolerance");

    LoggingAdapter log = Logging.getLogger(system, system);

    Integer originalValue = Integer.valueOf(0);

    ActorRef supervisor = system.actorOf(new Props(SupervisorActor2.class),
        "supervisor");

    log.info("Sending value 8, no exceptions should be thrown! ");
    supervisor.tell(Integer.valueOf(8));

    Integer result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    log.info("Value Received-> {}", result);
    assert result.equals(Integer.valueOf(8));

    log.info("Sending value -8, ArithmeticException should be thrown! Our Supervisor strategy says resume !");
    supervisor.tell(Integer.valueOf(-8));

    result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    log.info("Value Received-> {}", result);
    assert result.equals(Integer.valueOf(8));

    log.info("Sending value null, NullPointerException should be thrown! Our Supervisor strategy says restart !");
    supervisor.tell(null);

    result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    log.info("Value Received-> {}", result);
    assert originalValue.equals(result);

    log.info("Sending value \"String\", IllegalArgumentException should be thrown! Our Supervisor strategy says Stop !");

    supervisor.tell(String.valueOf("Do Something"));

    log.info("Worker Actor shutdown !");
    system.shutdown();

  }
View Full Code Here

Examples of akka.event.LoggingAdapter

   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    ActorSystem system = ActorSystem.create("faultTolerance");

    LoggingAdapter log = Logging.getLogger(system, system);

    Integer originalValue = Integer.valueOf(0);

    ActorRef supervisor = system.actorOf(new Props(SupervisorActor.class),
        "supervisor");

    log.info("Sending value 8, no exceptions should be thrown! ");
    supervisor.tell(Integer.valueOf(8));

    Integer result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    log.info("Value Received-> {}", result);
    assert result.equals(Integer.valueOf(8));

    log.info("Sending value -8, ArithmeticException should be thrown! Our Supervisor strategy says resume !");
    supervisor.tell(Integer.valueOf(-8));

    result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    log.info("Value Received-> {}", result);
    assert result.equals(Integer.valueOf(8));

    log.info("Sending value null, NullPointerException should be thrown! Our Supervisor strategy says restart !");
    supervisor.tell(null);

    result = (Integer) Await.result(
        Patterns.ask(supervisor, new Result(), 5000),
        Duration.create(5000, TimeUnit.MILLISECONDS));

    log.info("Value Received-> {}", result);
    assert originalValue.equals(result);

    log.info("Sending value \"String\", IllegalArgumentException should be thrown! Our Supervisor strategy says Stop !");

    supervisor.tell(String.valueOf("Do Something"));

    log.info("Worker Actor shutdown !");
    system.shutdown();
  }
View Full Code Here

Examples of akka.event.LoggingAdapter

    assertSame(Option.none(), Option.none());
  }

  @Test
  public void mustBeAbleToGetNoLogging() {
      LoggingAdapter a = NoLogging.getInstance();
      assertNotNull(a);
  }
View Full Code Here

Examples of com.boxysystems.jgoogleanalytics.LoggingAdapter

        }
        if(trackingEnabled) {
            tracker = new JGoogleAnalyticsTracker("Leonardo","UA-17798312-2");
            mainApp = new FocusPoint("MainApp");
            tracker.setLoggingAdapter(new LoggingAdapter(){
                public void logError(String s) {
                    u.p("logging error: " + s);
                }

                public void logMessage(String s) {
View Full Code Here

Examples of org.auraframework.adapter.LoggingAdapter

@Controller
public class TestLoggingAdapterController {

    @AuraEnabled
    public static void beginCapture() {
        LoggingAdapter adapter = Aura.get(LoggingAdapter.class);
        if (!(adapter instanceof TestLoggingAdapter)) {
            throw new Error("TestLoggingAdapter not configured!");
        }
        ((TestLoggingAdapter) adapter).clear();
        ((TestLoggingAdapter) adapter).beginCapture();
View Full Code Here

Examples of org.auraframework.adapter.LoggingAdapter

        ((TestLoggingAdapter) adapter).beginCapture();
    }

    @AuraEnabled
    public static List<Map<String, Object>> endCapture() {
        LoggingAdapter adapter = Aura.get(LoggingAdapter.class);
        if (!(adapter instanceof TestLoggingAdapter)) {
            throw new Error("TestLoggingAdapter not configured!");
        }
        ((TestLoggingAdapter) adapter).endCapture();
        return ((TestLoggingAdapter) adapter).getLogs();
View Full Code Here

Examples of org.auraframework.adapter.LoggingAdapter

    /**
     * Get the logging context
     */
    protected LoggingContext getLoggingContext() {
        LoggingAdapter la = AuraImpl.getLoggingAdapter();
        if (la == null || !la.isEstablished()) {
            return null;
        }
        return la.getLoggingContext();
    }
View Full Code Here

Examples of org.auraframework.adapter.LoggingAdapter

    private List<Map<String, Object>> getCspReportLogs(int expectedLogs) throws InterruptedException {
        int waitTime = 30000;
        int waitedFor = 0;
        int interval = 500;

        LoggingAdapter adapter = Aura.get(LoggingAdapter.class);
        if (!(adapter instanceof TestLoggingAdapter)) {
            throw new Error("TestLoggingAdapter not configured!");
        }
        List<Map<String, Object>> cspRecords = Lists.newArrayList();
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.