Formatting java codes with sbt-java-formatter.

This commit is contained in:
hepin1989 2019-01-12 04:00:53 +08:00
parent 27500001ea
commit 998c5a9285
401 changed files with 19750 additions and 17450 deletions

View file

@ -12,77 +12,91 @@ import com.typesafe.config.ConfigFactory;
public class PersistenceMultiDocTest {
//#default-plugins
abstract class AbstractPersistentActorWithDefaultPlugins extends AbstractPersistentActor {
@Override
public String persistenceId() {
return "123";
}
// #default-plugins
abstract class AbstractPersistentActorWithDefaultPlugins extends AbstractPersistentActor {
@Override
public String persistenceId() {
return "123";
}
//#default-plugins
}
// #default-plugins
//#override-plugins
abstract class AbstractPersistentActorWithOverridePlugins extends AbstractPersistentActor {
@Override
public String persistenceId() {
return "123";
}
// Absolute path to the journal plugin configuration entry in the `reference.conf`
@Override
public String journalPluginId() {
return "akka.persistence.chronicle.journal";
}
// Absolute path to the snapshot store plugin configuration entry in the `reference.conf`
@Override
public String snapshotPluginId() {
return "akka.persistence.chronicle.snapshot-store";
}
// #override-plugins
abstract class AbstractPersistentActorWithOverridePlugins extends AbstractPersistentActor {
@Override
public String persistenceId() {
return "123";
}
//#override-plugins
//#runtime-config
abstract class AbstractPersistentActorWithRuntimePluginConfig extends AbstractPersistentActor implements RuntimePluginConfig {
// Variable that is retrieved at runtime, from an external service for instance.
String runtimeDistinction = "foo";
@Override
public String persistenceId() {
return "123";
}
// Absolute path to the journal plugin configuration entry in the `reference.conf`
@Override
public String journalPluginId() {
return "journal-plugin-" + runtimeDistinction;
}
// Absolute path to the snapshot store plugin configuration entry in the `reference.conf`
@Override
public String snapshotPluginId() {
return "snapshot-store-plugin-" + runtimeDistinction;
}
// Configuration which contains the journal plugin id defined above
@Override
public Config journalPluginConfig() {
return ConfigFactory.empty().withValue(
"journal-plugin-" + runtimeDistinction,
getContext().getSystem().settings().config().getValue("journal-plugin") // or a very different configuration coming from an external service.
);
}
// Configuration which contains the snapshot store plugin id defined above
@Override
public Config snapshotPluginConfig() {
return ConfigFactory.empty().withValue(
"snapshot-plugin-" + runtimeDistinction,
getContext().getSystem().settings().config().getValue("snapshot-store-plugin") // or a very different configuration coming from an external service.
);
}
// Absolute path to the journal plugin configuration entry in the `reference.conf`
@Override
public String journalPluginId() {
return "akka.persistence.chronicle.journal";
}
//#runtime-config
// Absolute path to the snapshot store plugin configuration entry in the `reference.conf`
@Override
public String snapshotPluginId() {
return "akka.persistence.chronicle.snapshot-store";
}
}
// #override-plugins
// #runtime-config
abstract class AbstractPersistentActorWithRuntimePluginConfig extends AbstractPersistentActor
implements RuntimePluginConfig {
// Variable that is retrieved at runtime, from an external service for instance.
String runtimeDistinction = "foo";
@Override
public String persistenceId() {
return "123";
}
// Absolute path to the journal plugin configuration entry in the `reference.conf`
@Override
public String journalPluginId() {
return "journal-plugin-" + runtimeDistinction;
}
// Absolute path to the snapshot store plugin configuration entry in the `reference.conf`
@Override
public String snapshotPluginId() {
return "snapshot-store-plugin-" + runtimeDistinction;
}
// Configuration which contains the journal plugin id defined above
@Override
public Config journalPluginConfig() {
return ConfigFactory.empty()
.withValue(
"journal-plugin-" + runtimeDistinction,
getContext()
.getSystem()
.settings()
.config()
.getValue(
"journal-plugin") // or a very different configuration coming from an external
// service.
);
}
// Configuration which contains the snapshot store plugin id defined above
@Override
public Config snapshotPluginConfig() {
return ConfigFactory.empty()
.withValue(
"snapshot-plugin-" + runtimeDistinction,
getContext()
.getSystem()
.settings()
.config()
.getValue(
"snapshot-store-plugin") // or a very different configuration coming from an
// external service.
);
}
}
// #runtime-config
}