当前位置: 首页>>代码示例>>Java>>正文


Java AbstractLoggingActor类代码示例

本文整理汇总了Java中akka.actor.AbstractLoggingActor的典型用法代码示例。如果您正苦于以下问题:Java AbstractLoggingActor类的具体用法?Java AbstractLoggingActor怎么用?Java AbstractLoggingActor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AbstractLoggingActor类属于akka.actor包,在下文中一共展示了AbstractLoggingActor类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldLogResponseFromCoffeeHouse

import akka.actor.AbstractLoggingActor; //导入依赖的package包/类
@Test
public void shouldLogResponseFromCoffeeHouse() {
    new JavaTestKit(system) {{
        interceptInfoLogMessage(this, "stub response", 1, () -> {
            new CoffeeHouseApp(system) {
                @Override
                protected ActorRef createCoffeeHouse() {
                    return createStubActor("stub-coffee-house", () -> new AbstractLoggingActor() {
                        @Override
                        public Receive createReceive() {
                            return receiveBuilder().matchAny(o -> getSender().tell("stub response", getSelf())).build();
                        }
                    });
                }
            };
        });
    }};
}
 
开发者ID:ironfish,项目名称:oreilly-reactive-with-akka,代码行数:19,代码来源:CoffeeHouseAppTest.java

示例2: printerProps

import akka.actor.AbstractLoggingActor; //导入依赖的package包/类
private static Props printerProps(ActorRef coffeeHouse) {
    return Props.create(AbstractLoggingActor.class, () -> new AbstractLoggingActor() {
        @Override
        public Receive createReceive() {
            return receiveBuilder().matchAny(o -> log().info(o.toString())).build();
        }

        {
            coffeeHouse.tell("Brew Coffee", self());
        }
    });
}
 
开发者ID:ironfish,项目名称:oreilly-reactive-with-akka,代码行数:13,代码来源:CoffeeHouseApp.java

示例3: printerProps

import akka.actor.AbstractLoggingActor; //导入依赖的package包/类
private static Props printerProps(ActorRef coffeeHouse) {
    return Props.create(AbstractLoggingActor.class, () -> {
        return new AbstractLoggingActor() {
            @Override
            public Receive createReceive() {
                return receiveBuilder().matchAny(o -> log().info(o.toString())).build();
            }

            {
                coffeeHouse.tell("Brew Coffee", self());
            }
        };
    });
}
 
开发者ID:ironfish,项目名称:oreilly-reactive-with-akka,代码行数:15,代码来源:CoffeeHouseApp.java

示例4: printerProps

import akka.actor.AbstractLoggingActor; //导入依赖的package包/类
private static Props printerProps(ActorRef coffeeHouse) {
    return Props.create(AbstractLoggingActor.class, () -> new AbstractLoggingActor() {
        {
            coffeeHouse.tell("Brew Coffee", self());

            receive(ReceiveBuilder.
                    matchAny(o -> log().info(o.toString())).build()
            );
        }
    });
}
 
开发者ID:ironfish,项目名称:oreilly-reactive-architecture-old,代码行数:12,代码来源:CoffeeHouseApp.java

示例5: shouldLogResponseFromCoffeeHouse

import akka.actor.AbstractLoggingActor; //导入依赖的package包/类
@Test
public void shouldLogResponseFromCoffeeHouse() {
    new JavaTestKit(system) {{
        interceptInfoLogMessage(this, "stub response", 1, () -> {
            new CoffeeHouseApp(system) {
                @Override
                protected ActorRef createCoffeeHouse() {
                    return createStubActor("stub-coffee-house", () -> new AbstractLoggingActor() {{
                        receive(ReceiveBuilder.matchAny(o -> sender().tell("stub response", self())).build());
                    }});
                }
            };
        });
    }};
}
 
开发者ID:ironfish,项目名称:oreilly-reactive-architecture-old,代码行数:16,代码来源:CoffeeHouseAppTest.java

示例6: printerProps

import akka.actor.AbstractLoggingActor; //导入依赖的package包/类
private static Props printerProps(ActorRef coffeeHouse) {
    return Props.create(AbstractLoggingActor.class, () -> new AbstractLoggingActor() {
        @Override
        public Receive createReceive() {
            return receiveBuilder().matchAny(o -> log().info(o.toString())).build();
        }

        {
            coffeeHouse.tell("Brew Coffee", getSelf());
        }
    });
}
 
开发者ID:ironfish,项目名称:oreilly-reactive-architecture-student,代码行数:13,代码来源:CoffeeHouseApp.java


注:本文中的akka.actor.AbstractLoggingActor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。