public AppServiceHub extends ServiceHub
A interface CordaService
annotated class requires a constructor taking a
single parameter of type interface AppServiceHub
.
With the interface AppServiceHub
parameter a interface CordaService
is able to access to privileged operations.
In particular such a interface CordaService
can initiate and track flows marked
with interface StartableByService
.
Modifier and Type | Interface and Description |
---|---|
static class |
AppServiceHub.Companion |
static class |
AppServiceHub.DefaultImpls
A
interface CordaService annotated class requires a constructor taking a
single parameter of type interface AppServiceHub .
With the interface AppServiceHub parameter a interface CordaService is able to access to privileged operations.
In particular such a interface CordaService can initiate and track flows marked
with interface StartableByService . |
Modifier and Type | Field and Description |
---|---|
static AppServiceHub.Companion |
Companion |
static int |
SERVICE_PRIORITY_HIGH |
static int |
SERVICE_PRIORITY_LOW |
static int |
SERVICE_PRIORITY_NORMAL |
Modifier and Type | Method and Description |
---|---|
CordaTransactionSupport |
getDatabase()
Accessor to
interface CordaTransactionSupport in order to perform sensitive actions within new, independent top level transaction. |
void |
register(int priority,
ServiceLifecycleObserver observer)
Allows to register
interface ServiceLifecycleObserver such that it will start receiving enum ServiceLifecycleEvent s |
<T> void |
register(int priority,
Function1<? super net.corda.core.node.services.ServiceLifecycleEvent,? extends T> func)
Convenience method to be able to add an arbitrary function as a
AppServiceHub.register callback. |
<T> FlowHandle<T> |
startFlow(FlowLogic<? extends T> flow)
Start the given flow with the given arguments. flow must be annotated
with
interface StartableByService .
TODO it is assumed here that the flow object has an appropriate classloader. |
<T> FlowProgressHandle<T> |
startTrackedFlow(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
interface StartableByService .
TODO it is assumed here that the flow object has an appropriate classloader. |
addSignature, addSignature, cordaService, createSignature, createSignature, createSignature, createSignature, getAppContext, getClock, getContractUpgradeService, getDiagnosticsService, getKeyManagementService, getMyInfo, getNetworkMapCache, getValidatedTransactions, getVaultService, jdbcSession, recordTransactions, recordTransactions, recordTransactions, recordTransactions, recordTransactions, registerUnloadHandler, signInitialTransaction, signInitialTransaction, signInitialTransaction, toStateAndRef, withEntityManager, withEntityManager
getAttachments, getCordappProvider, getIdentityService, getNetworkParameters, getNetworkParametersService, loadContractAttachment, loadState, loadStates, specialise
static AppServiceHub.Companion Companion
static int SERVICE_PRIORITY_HIGH
static int SERVICE_PRIORITY_NORMAL
static int SERVICE_PRIORITY_LOW
<T> FlowHandle<T> startFlow(FlowLogic<? extends T> flow)
Start the given flow with the given arguments. flow must be annotated
with interface StartableByService
.
TODO it is assumed here that the flow object has an appropriate classloader.
interface StartableByService
<T> FlowProgressHandle<T> startTrackedFlow(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 interface StartableByService
.
TODO it is assumed here that the flow object has an appropriate classloader.
interface StartableByService
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, 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
<T> void register(int priority, Function1<? super net.corda.core.node.services.ServiceLifecycleEvent,? extends T> func)
Convenience method to be able to add an arbitrary function as a AppServiceHub.register
callback.
AppServiceHub.register