本文整理汇总了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();
}
示例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);
}
示例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");
}
};
}
示例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();
}