mirror of
https://github.com/corda/corda.git
synced 2025-01-22 20:38:05 +00:00
Cordapps now have a name field (#1645)
* Cordapps now have a name field.
This commit is contained in:
parent
35924ba737
commit
24ff7efd5f
@ -13,6 +13,7 @@ import java.net.URL
|
|||||||
*
|
*
|
||||||
* This will only need to be constructed manually for certain kinds of tests.
|
* This will only need to be constructed manually for certain kinds of tests.
|
||||||
*
|
*
|
||||||
|
* @property name Cordapp name - derived from the base name of the Cordapp JAR (therefore may not be unique)
|
||||||
* @property contractClassNames List of contracts
|
* @property contractClassNames List of contracts
|
||||||
* @property initiatedFlows List of initiatable flow classes
|
* @property initiatedFlows List of initiatable flow classes
|
||||||
* @property rpcFlows List of RPC initiable flows classes
|
* @property rpcFlows List of RPC initiable flows classes
|
||||||
@ -22,6 +23,7 @@ import java.net.URL
|
|||||||
* @property jarPath The path to the JAR for this CorDapp
|
* @property jarPath The path to the JAR for this CorDapp
|
||||||
*/
|
*/
|
||||||
interface Cordapp {
|
interface Cordapp {
|
||||||
|
val name: String
|
||||||
val contractClassNames: List<String>
|
val contractClassNames: List<String>
|
||||||
val initiatedFlows: List<Class<out FlowLogic<*>>>
|
val initiatedFlows: List<Class<out FlowLogic<*>>>
|
||||||
val rpcFlows: List<Class<out FlowLogic<*>>>
|
val rpcFlows: List<Class<out FlowLogic<*>>>
|
||||||
|
@ -5,6 +5,7 @@ import net.corda.core.flows.FlowLogic
|
|||||||
import net.corda.core.node.CordaPluginRegistry
|
import net.corda.core.node.CordaPluginRegistry
|
||||||
import net.corda.core.schemas.MappedSchema
|
import net.corda.core.schemas.MappedSchema
|
||||||
import net.corda.core.serialization.SerializeAsToken
|
import net.corda.core.serialization.SerializeAsToken
|
||||||
|
import java.io.File
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
|
|
||||||
data class CordappImpl(
|
data class CordappImpl(
|
||||||
@ -15,6 +16,8 @@ data class CordappImpl(
|
|||||||
override val plugins: List<CordaPluginRegistry>,
|
override val plugins: List<CordaPluginRegistry>,
|
||||||
override val customSchemas: Set<MappedSchema>,
|
override val customSchemas: Set<MappedSchema>,
|
||||||
override val jarPath: URL) : Cordapp {
|
override val jarPath: URL) : Cordapp {
|
||||||
|
override val name: String = File(jarPath.toURI()).name.removeSuffix(".jar")
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An exhaustive list of all classes relevant to the node within this CorDapp
|
* An exhaustive list of all classes relevant to the node within this CorDapp
|
||||||
*
|
*
|
||||||
|
@ -7,6 +7,8 @@ from the previous milestone release.
|
|||||||
UNRELEASED
|
UNRELEASED
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* ``Cordapp`` now has a name field for identifying CorDapps and all CorDapp names are printed to console at startup.
|
||||||
|
|
||||||
Release 1.0
|
Release 1.0
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
@ -263,6 +263,7 @@ open class NodeStartup(val args: Array<String>) {
|
|||||||
node.configuration.extraAdvertisedServiceIds.let {
|
node.configuration.extraAdvertisedServiceIds.let {
|
||||||
if (it.isNotEmpty()) Node.printBasicNodeInfo("Providing network services", it.joinToString())
|
if (it.isNotEmpty()) Node.printBasicNodeInfo("Providing network services", it.joinToString())
|
||||||
}
|
}
|
||||||
|
Node.printBasicNodeInfo("Loaded CorDapps", node.cordappProvider.cordapps.map { it.name }.joinToString())
|
||||||
val plugins = node.pluginRegistries
|
val plugins = node.pluginRegistries
|
||||||
.map { it.javaClass.name }
|
.map { it.javaClass.name }
|
||||||
.filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") || it.startsWith("net.corda.nodeapi.") }
|
.filterNot { it.startsWith("net.corda.node.") || it.startsWith("net.corda.core.") || it.startsWith("net.corda.nodeapi.") }
|
||||||
|
Loading…
Reference in New Issue
Block a user