public class CordaPluginRegistry
Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.
Constructor and Description |
---|
CordaPluginRegistry(java.util.List<? extends java.util.function.Function<net.corda.core.messaging.CordaRPCOps,? extends java.lang.Object>> webApis,
java.util.Map<java.lang.String,java.lang.String> staticServeDirs,
java.util.Map<java.lang.String,? extends java.util.Set<java.lang.String>> requiredFlows,
java.util.List<? extends java.util.function.Function<net.corda.core.node.PluginServiceHub,? extends java.lang.Object>> servicePlugins)
Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file
to extend a Corda node with additional application services.
|
CordaPluginRegistry()
Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file
to extend a Corda node with additional application services.
|
Modifier and Type | Method and Description |
---|---|
boolean |
customizeSerialization(SerializationCustomization custom)
Optionally whitelist types for use in object serialization, as we lock down the types that can be serialized.
|
java.util.Map<java.lang.String,java.util.Set> |
getRequiredFlows()
A Map with an entry for each consumed Flow used by the webAPIs.
|
java.util.List<java.util.function.Function> |
getServicePlugins()
List of lambdas constructing additional long lived services to be hosted within the node.
|
java.util.Map<java.lang.String,java.lang.String> |
getStaticServeDirs()
Map of static serving endpoints to the matching resource directory.
|
java.util.List<java.util.function.Function> |
getWebApis()
List of lambdas returning JAX-RS objects.
|
public CordaPluginRegistry(java.util.List<? extends java.util.function.Function<net.corda.core.messaging.CordaRPCOps,? extends java.lang.Object>> webApis, java.util.Map<java.lang.String,java.lang.String> staticServeDirs, java.util.Map<java.lang.String,? extends java.util.Set<java.lang.String>> requiredFlows, java.util.List<? extends java.util.function.Function<net.corda.core.node.PluginServiceHub,? extends java.lang.Object>> servicePlugins)
Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.
webApis
- List of lambdas returning JAX-RS objects.They may only depend on the RPC interface,as the webserver shouldpotentially be able to live in a process separate from the node itself.staticServeDirs
- Map of static serving endpoints to the matching resource directory.All endpoints will be prefixed with"/web"and postfixed with"\*.Resource directories can be either on disk directories(especially when debugging)in the form"a/b/c".Serving from a JAR canbe specified with:javaClass.getResource("requiredFlows
- A Map with an entry for each consumed Flow used by the webAPIs.The key of each map entry should contain the FlowLogicclass name.The associated map values are the union of all concrete class names passed to the Flow constructor.Standard java.lang.*and kotlin.*types do not need to be included explicitly.This is used to extend the white listed Flows that can be initiated from the ServiceHub invokeFlowAsync method.servicePlugins
- List of lambdas constructing additional long lived services to be hosted within the node.They expect a singleinterface PluginServiceHub
parameter as input.Theinterface PluginServiceHub
will be fully constructed before the plugin service is created and willallow access to the Flow factory and Flow initiation entry points there.public CordaPluginRegistry()
Implement this interface on a class advertised in a META-INF/services/net.corda.core.node.CordaPluginRegistry file to extend a Corda node with additional application services.
public boolean customizeSerialization(SerializationCustomization custom)
Optionally whitelist types for use in object serialization, as we lock down the types that can be serialized.
For example, if you add a new ContractState it needs to be whitelisted. You can do that either by adding the @CordaSerializable annotation or via this method.
public java.util.List<java.util.function.Function> getWebApis()
List of lambdas returning JAX-RS objects.
They may only depend on the RPC interface,as the webserver shouldpotentially be able to live in a process separate from the node itself.
public java.util.Map<java.lang.String,java.lang.String> getStaticServeDirs()
Map of static serving endpoints to the matching resource directory.
All endpoints will be prefixed with"/web"and postfixed with"\*.Resource directories can be either on disk directories(especially when debugging)in the form"a/b/c".Serving from a JAR canbe specified with:javaClass.getResource("
public java.util.Map<java.lang.String,java.util.Set> getRequiredFlows()
A Map with an entry for each consumed Flow used by the webAPIs.
The key of each map entry should contain the FlowLogicclass name.The associated map values are the union of all concrete class names passed to the Flow constructor.Standard java.lang.*and kotlin.*types do not need to be included explicitly.This is used to extend the white listed Flows that can be initiated from the ServiceHub invokeFlowAsync method.
public java.util.List<java.util.function.Function> getServicePlugins()
List of lambdas constructing additional long lived services to be hosted within the node.
They expect a singleinterface PluginServiceHub
parameter as input.Theinterface PluginServiceHub
will be fully constructed before the plugin service is created and willallow access to the Flow factory and Flow initiation entry points there.