本文整理匯總了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);
}