public AppServiceHub extends ServiceHub
A annotationclass CordaService
annotated class requires a constructor taking a
single parameter of type interface AppServiceHub
.
With the interface AppServiceHub
parameter a annotationclass CordaService
is able to access to privileged operations.
In particular such a annotationclass CordaService
can initiate and track flows marked
with annotationclass StartableByService
.
static net.corda.core.node.AppServiceHub.Companion Companion
static int SERVICE_PRIORITY_HIGH
static int SERVICE_PRIORITY_NORMAL
static int SERVICE_PRIORITY_LOW
@NotNull <T> FlowHandle<T> startFlow(@NotNull FlowLogic<? extends T> flow)
Start the given flow with the given arguments. flow
must be annotated
with annotationclass StartableByService
.
TODO it is assumed here that the flow object has an appropriate classloader.
flow
,
annotationclass StartableByService
@NotNull <T> FlowProgressHandle<T> startTrackedFlow(@NotNull FlowLogic<? extends T> flow)
Start the given flow with the given arguments, returning an Observable with a single observation of the
result of running the flow. flow
must be annotated with annotationclass StartableByService
.
TODO it is assumed here that the flow object has an appropriate classloader.
flow
,
annotationclass StartableByService
@NotNull CordaTransactionSupport getDatabase()
Accessor to interface CordaTransactionSupport
in order to perform sensitive actions within new, independent top level transaction.
There are times when a user thread may want to perform certain actions within a new top level DB transaction. This will be an independent transaction from those used in the framework.
interface CordaTransactionSupport
void register(int priority, @NotNull ServiceLifecycleObserver observer)
Allows to register interface ServiceLifecycleObserver
such that it will start receiving enum ServiceLifecycleEvent
s
priority
- controls to which queue observer
will be added. Higher values correspond to higher priorities.observer
- an instance of interface ServiceLifecycleObserver
to be registered.interface ServiceLifecycleObserver
,
enum ServiceLifecycleEvent