本文整理汇总了Java中akka.event.LoggingAdapter类的典型用法代码示例。如果您正苦于以下问题:Java LoggingAdapter类的具体用法?Java LoggingAdapter怎么用?Java LoggingAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LoggingAdapter类属于akka.event包,在下文中一共展示了LoggingAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HomeController
import akka.event.LoggingAdapter; //导入依赖的package包/类
@Inject
public HomeController(ActorSystem actorSystem,
Materializer mat,
WebJarAssets webJarAssets) {
org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass());
LoggingAdapter logging = Logging.getLogger(actorSystem.eventStream(), logger.getName());
//noinspection unchecked
Source<String, Sink<String, NotUsed>> source = MergeHub.of(String.class)
.log("source", logging)
.recoverWithRetries(-1, new PFBuilder().match(Throwable.class, e -> Source.empty()).build());
Sink<String, Source<String, NotUsed>> sink = BroadcastHub.of(String.class);
Pair<Sink<String, NotUsed>, Source<String, NotUsed>> sinkSourcePair = source.toMat(sink, Keep.both()).run(mat);
Sink<String, NotUsed> chatSink = sinkSourcePair.first();
Source<String, NotUsed> chatSource = sinkSourcePair.second();
this.userFlow = Flow.fromSinkAndSource(chatSink, chatSource).log("userFlow", logging);
this.webJarAssets = webJarAssets;
}
示例2: HomeController
import akka.event.LoggingAdapter; //导入依赖的package包/类
@Inject
public HomeController(ActorSystem actorSystem,
Materializer mat) {
org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass());
LoggingAdapter logging = Logging.getLogger(actorSystem.eventStream(), logger.getName());
//noinspection unchecked
Source<String, Sink<String, NotUsed>> source = MergeHub.of(String.class)
.log("source", logging)
.recoverWithRetries(-1, new PFBuilder().match(Throwable.class, e -> Source.empty()).build());
Sink<String, Source<String, NotUsed>> sink = BroadcastHub.of(String.class);
Pair<Sink<String, NotUsed>, Source<String, NotUsed>> sinkSourcePair = source.toMat(sink, Keep.both()).run(mat);
Sink<String, NotUsed> chatSink = sinkSourcePair.first();
Source<String, NotUsed> chatSource = sinkSourcePair.second();
this.userFlow = Flow.fromSinkAndSource(chatSink, chatSource).log("userFlow", logging);
}
示例3: HomeController
import akka.event.LoggingAdapter; //导入依赖的package包/类
@Inject
public HomeController(ActorSystem actorSystem,
Materializer mat,
WebJarsUtil webJarsUtil) {
org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(this.getClass());
LoggingAdapter logging = Logging.getLogger(actorSystem.eventStream(), logger.getName());
//noinspection unchecked
Source<String, Sink<String, NotUsed>> source = MergeHub.of(String.class)
.log("source", logging)
.recoverWithRetries(-1, new PFBuilder().match(Throwable.class, e -> Source.empty()).build());
Sink<String, Source<String, NotUsed>> sink = BroadcastHub.of(String.class);
Pair<Sink<String, NotUsed>, Source<String, NotUsed>> sinkSourcePair = source.toMat(sink, Keep.both()).run(mat);
Sink<String, NotUsed> chatSink = sinkSourcePair.first();
Source<String, NotUsed> chatSource = sinkSourcePair.second();
this.userFlow = Flow.fromSinkAndSource(chatSink, chatSource).log("userFlow", logging);
this.webJarsUtil = webJarsUtil;
}
示例4: insertTiledLayer
import akka.event.LoggingAdapter; //导入依赖的package包/类
protected CompletableFuture<List<Long>> insertTiledLayer(AsyncHelper tx,
TiledLayer theTiledLayer, Integer genericLayerId, LoggingAdapter log) {
return tx
.insert(tiledLayer)
.set(tiledLayer.metaWidth, theTiledLayer.metaWidth())
.set(tiledLayer.metaHeight, theTiledLayer.metaHeight())
.set(tiledLayer.expireCache, theTiledLayer.expireCache())
.set(tiledLayer.expireClients, theTiledLayer.expireClients())
.set(tiledLayer.gutter, theTiledLayer.gutter())
.set(tiledLayer.genericLayerId, genericLayerId)
.executeWithKey(tiledLayer.id)
.thenCompose(
tlId -> {
log.debug("Inserted tilelayer id: " + tlId);
log.debug("Insert mimeformats: " + theTiledLayer.mimeformats());
return f.sequence(
theTiledLayer.mimeformats().stream()
.map(name ->
tx
.insert(tiledLayerMimeformat)
.set(tiledLayerMimeformat.tiledLayerId, tlId.get())
.set(tiledLayerMimeformat.mimeformat, name)
.execute())
.collect(Collectors.toList()));
});
}
示例5: 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();
}
示例6: DeviceActorMessageProcessor
import akka.event.LoggingAdapter; //导入依赖的package包/类
public DeviceActorMessageProcessor(ActorSystemContext systemContext, LoggingAdapter logger, DeviceId deviceId) {
super(systemContext, logger);
this.deviceId = deviceId;
this.sessions = new HashMap<>();
this.attributeSubscriptions = new HashMap<>();
this.rpcSubscriptions = new HashMap<>();
this.rpcPendingMap = new HashMap<>();
initAttributes();
}
示例7: DeviceActorMessageProcessor
import akka.event.LoggingAdapter; //导入依赖的package包/类
public DeviceActorMessageProcessor(ActorSystemContext systemContext, LoggingAdapter logger, DeviceId deviceId) {
super(systemContext, logger);
this.deviceId = deviceId;
this.sessions = new HashMap<>();
this.attributeSubscriptions = new HashMap<>();
this.rpcSubscriptions = new HashMap<>();
this.rpcPendingMap = new HashMap<>();
initAttributes();
}
示例8: serializeMessage
import akka.event.LoggingAdapter; //导入依赖的package包/类
public static Object serializeMessage(Object msg, LoggingAdapter log) {
Object result = null;
if (SERIALIZE_ALL_MESSAGES) {
try {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(msg);
oos.close();
byte[] msgBytes = bos.toByteArray();
if (LOG_SERIALIZED_MESSAGE_SIZES) {
log.debug("Serialize {}, #bytes={}", msg.getClass().getSimpleName(), msgBytes.length);
}
ByteArrayInputStream bis = new ByteArrayInputStream(msgBytes);
ObjectInputStream ois = new ObjectInputStream(bis);
result = ois.readObject();
ois.close();
}
catch (Exception ex) {
System.err.println("Exception thrown in TestSerializer");
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
else {
result = msg;
}
return result;
}
示例9: main
import akka.event.LoggingAdapter; //导入依赖的package包/类
public static void main(String[] args) {
final ActorSystem system = ActorSystem.create("dsgdpllt");
final LoggingAdapter log = Logging.getLogger(system, "dsgdpllt");
run(args, new Supplier<Theory>() {
@Override
public Theory get() {
try {
return new DistributedTheory(new DefaultTheoryCreator(), system, log);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
}
});
system.terminate();
}
示例10: DistributedSatisfiabilityOfSingleVariableStepSolver
import akka.event.LoggingAdapter; //导入依赖的package包/类
public DistributedSatisfiabilityOfSingleVariableStepSolver(
ExpressionStepSolver localSatisfiabilityStepSolver, ActorRefFactory actorRefFactory,
LoggingAdapter localLog) {
super(constructCreator(localSatisfiabilityStepSolver));
this.actorRefFactory = actorRefFactory;
this.localLog = localLog;
updateCreator();
}
开发者ID:aic-sri-international,项目名称:aic-distributed-sgdpll,代码行数:10,代码来源:DistributedSatisfiabilityOfSingleVariableStepSolver.java
示例11: DistributedQuantifierEliminationStepSolver
import akka.event.LoggingAdapter; //导入依赖的package包/类
public DistributedQuantifierEliminationStepSolver(
QuantifierEliminationStepSolver localQuantifierEliminatorStepSolver, ActorRefFactory actorRefFactory,
LoggingAdapter localLog) {
super(constructCreator(localQuantifierEliminatorStepSolver));
this.actorRefFactory = actorRefFactory;
this.localLog = localLog;
updateCreator();
}
开发者ID:aic-sri-international,项目名称:aic-distributed-sgdpll,代码行数:10,代码来源:DistributedQuantifierEliminationStepSolver.java
示例12: setLocalActorInfo
import akka.event.LoggingAdapter; //导入依赖的package包/类
public void setLocalActorInfo(ActorRefFactory actorRefFactory, LoggingAdapter actorLog) {
this.actorRefFactory = actorRefFactory;
this.localLog = actorLog;
updateCreator();
((DistributedTheory)getTheory()).setLocalActorInfo(actorRefFactory, actorLog);
}
开发者ID:aic-sri-international,项目名称:aic-distributed-sgdpll,代码行数:9,代码来源:DistributedQuantifierEliminationStepSolver.java
示例13: setup
import akka.event.LoggingAdapter; //导入依赖的package包/类
@Before
public void setup() {
LoggingAdapter log = Logging.getLogger(system, this);
f = new FutureUtils(system, Timeout.apply(1, TimeUnit.SECONDS));
db = new AsyncDatabaseHelper(database, f, log);
}
示例14: setup
import akka.event.LoggingAdapter; //导入依赖的package包/类
@Before
public void setup() {
ActorSystem actorSystem = ActorSystem.create();
recorder = actorSystem.actorOf(Recorder.props(), "recorder");
database = actorSystem.actorOf(DatabaseMock.props(recorder), "database");
LoggingAdapter log = Logging.getLogger(actorSystem, this);
f = new FutureUtils(actorSystem, Timeout.apply(1, TimeUnit.SECONDS));
db = new AsyncDatabaseHelper(database, f, log);
}
示例15: PublishServiceQuery
import akka.event.LoggingAdapter; //导入依赖的package包/类
public PublishServiceQuery(LoggingAdapter log, FutureUtils f, AsyncHelper tx, Service stagingService, Optional<String> environmentId) {
super(log, f, new SQLSubQuery());
this.tx = tx;
this.stagingService = stagingService;
this.environmentId = environmentId.orElse(null);
}