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


Java LoggingAdapter.info方法代码示例

本文整理汇总了Java中akka.event.LoggingAdapter.info方法的典型用法代码示例。如果您正苦于以下问题:Java LoggingAdapter.info方法的具体用法?Java LoggingAdapter.info怎么用?Java LoggingAdapter.info使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在akka.event.LoggingAdapter的用法示例。


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

示例1: main

import akka.event.LoggingAdapter; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {
    //setup actor system
    final ActorSystem system = ActorSystem.create("mediator");
    //setup logger for main
    final LoggingAdapter log = Logging.getLogger(system, "main");

    //setup actors
    log.info("Initializing mediator actors...");

    String configPath = null;
    if (args.length==2 && args[0].equals("--conf")) {
        configPath = args[1];
        log.info("Loading mediator configuration from '" + configPath + "'...");
    } else {
        log.info("No configuration specified. Using default properties...");
    }

    MediatorConfig config = loadConfig(configPath);
    final MediatorServer server = new MediatorServer(system, config);

    //setup shutdown hook
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            log.info("Shutting down mediator");
            server.stop();
            system.shutdown();
        }
    });

    log.info("Starting mediator server...");
    server.start();

    log.info(String.format("%s listening on %s:%s", config.getName(), config.getServerHost(), config.getServerPort()));
    Thread.currentThread().join();
}
 
开发者ID:gerard-bisama,项目名称:DHIS2-fhir-lab-app,代码行数:37,代码来源:MediatorMain.java

示例2: main

import akka.event.LoggingAdapter; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {

        ApplicationContext context =
            SpringApplication.run(XRoadCatalogCollector.class, args);

        ActorSystem system = context.getBean(ActorSystem.class);

        final LoggingAdapter log = Logging.getLogger(system, "Application");
        Long collectorInterval = (Long)context.getBean("getCollectorInterval");

        log.info("Starting up catalog collector with collector interval of {}", collectorInterval);


        SpringExtension ext = context.getBean(SpringExtension.class);

        // Use the Spring Extension to create props for a named actor bean
        ActorRef supervisor = system.actorOf(
                ext.props("supervisor"));

        system.scheduler().schedule(Duration.Zero(), Duration.create(collectorInterval,
                TimeUnit.MINUTES), supervisor,
                Supervisor
                .START_COLLECTING,
                system.dispatcher(), null);

    }
 
开发者ID:vrk-kpa,项目名称:xroad-catalog,代码行数:27,代码来源:XRoadCatalogCollector.java

示例3: _RxJavaAndAkkaStreams

import akka.event.LoggingAdapter; //导入方法依赖的package包/类
@Test
public void _RxJavaAndAkkaStreams() {
    new JavaTestKit(system) {
        {
            JavaTestKit probe = new JavaTestKit(system);
            LoggingAdapter log = Logging.getLogger(probe.getSystem(), this);

            long start = System.nanoTime();
            ActorFlowMaterializer mat = ActorFlowMaterializer.create(system);

            Subscriber<Integer> subscriber = RxReactiveStreams.toSubscriber(new rx.Subscriber<Integer>() {
                @Override
                public void onCompleted() {
                }

                @Override
                public void onError(Throwable e) {
                }

                @Override
                public void onNext(Integer integer) {
                    log.info("subscribe:" + integer.toString());
                }
            });

            Observable<Integer> range = Observable.range(1, 10);

            Publisher<Integer> publisher = RxReactiveStreams.toPublisher(range);

            publisher.subscribe(subscriber);

            Source<Integer, BoxedUnit> source = Source
                    .from(publisher)
                    .map(i -> i * 2)
                    .scan(0, (prev, next) -> prev + next);

            Publisher<Integer> akkaPublisher = source.runWith(Sink.fanoutPublisher(1, 1), mat);

            RxReactiveStreams.toObservable(akkaPublisher).map(s -> "result:" + s).toBlocking().forEach(log::info);

            long end = System.nanoTime();

            log.info(TimeUnit.MILLISECONDS.convert((end - start), TimeUnit.NANOSECONDS) + "ms");
        }
    };
}
 
开发者ID:grimrose,项目名称:jjug-2015-reactive-streams,代码行数:47,代码来源:CollaborationTest.java

示例4: main

import akka.event.LoggingAdapter; //导入方法依赖的package包/类
public static void main(String... args) throws Exception {

        //setup actor system
        final ActorSystem system = ActorSystem.create("mediator");
        //setup logger for main
        final LoggingAdapter log = Logging.getLogger(system, "main");

        //setup server
        log.info("Initializing mediator server...");

        String configPath = null;
        //for now only --conf param is supported... poorly
        //TODO support custom config for mediator registration info json
        //TODO better parameter handling
        if (args.length==2 && args[0].equals("--conf")) {
            configPath = args[1];
            log.info("Loading mediator configuration from '" + configPath + "'...");
        } else {
            log.info("No configuration specified. Using default properties...");
        }

        MediatorConfig config = loadConfig(configPath);
        final MediatorServer server = new MediatorServer(system, config);

        if (isSecure(config)) {
            loadSSLConfig(config);
        }

        //setup shutdown hook
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                log.info("Shutting down mediator");
                server.stop();
                system.shutdown();
            }
        });

        log.info("Starting HTTP server...");
        server.start();


        //notify http-connector about the ihe cert
        if (isSecure(config)) {
            ActorSelection httpConnector = system.actorSelection(config.userPathFor("http-connector"));
            httpConnector.tell(
                    new SetupHTTPSCertificate(
                            config.getProperty("ihe.keystore"),
                            config.getProperty("ihe.keypassword"),
                            config.getProperty("ihe.keystore"),
                            true
                    ),
                    ActorRef.noSender()
            );
        }

        log.info(String.format("%s listening on %s:%s", config.getName(), config.getServerHost(), config.getServerPort()));
        Thread.currentThread().join();
    }
 
开发者ID:jembi,项目名称:openhim-mediator-xds,代码行数:60,代码来源:XDSMediatorMain.java


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