Merge pull request #627 from corda/mnesbit-servicehub-cleanup2

Remove scheduler service from ServiceHub
This commit is contained in:
Matthew Nesbit
2017-05-04 14:34:41 +01:00
committed by GitHub
7 changed files with 29 additions and 30 deletions

View File

@ -0,0 +1,26 @@
package net.corda.node.services.api
import net.corda.core.contracts.ScheduledStateRef
import net.corda.core.contracts.StateRef
/**
* Provides access to schedule activity at some point in time. This interface might well be expanded to
* increase the feature set in the future.
*
* If the point in time is in the past, the expectation is that the activity will happen shortly after it is scheduled.
*
* The main consumer initially is an observer of the vault to schedule activities based on transactions as they are
* recorded.
*/
interface SchedulerService {
/**
* Schedule a new activity for a TX output, probably because it was just produced.
*
* Only one activity can be scheduled for a particular [StateRef] at any one time. Scheduling a [ScheduledStateRef]
* replaces any previously scheduled [ScheduledStateRef] for any one [StateRef].
*/
fun scheduleStateActivity(action: ScheduledStateRef)
/** Unschedule all activity for a TX output, probably because it was consumed. */
fun unscheduleStateActivity(ref: StateRef)
}

View File

@ -65,6 +65,7 @@ abstract class ServiceHubInternal : PluginServiceHub {
abstract val flowLogicRefFactory: FlowLogicRefFactory
abstract val schemaService: SchemaService
abstract override val networkMapCache: NetworkMapCacheInternal
abstract val schedulerService: SchedulerService
abstract val networkService: MessagingService

View File

@ -10,15 +10,14 @@ import net.corda.core.contracts.StateRef
import net.corda.core.flows.FlowInitiator
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.FlowLogicRefFactory
import net.corda.core.node.services.SchedulerService
import net.corda.core.serialization.SingletonSerializeAsToken
import net.corda.core.utilities.ProgressTracker
import net.corda.core.utilities.loggerFor
import net.corda.core.utilities.trace
import net.corda.node.services.api.SchedulerService
import net.corda.node.services.api.ServiceHubInternal
import net.corda.node.utilities.*
import org.apache.activemq.artemis.utils.ReusableLatch
import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.ResultRow
import org.jetbrains.exposed.sql.statements.InsertStatement
import java.time.Instant

View File

@ -11,10 +11,7 @@ import net.corda.core.node.services.*
import net.corda.core.transactions.SignedTransaction
import net.corda.node.internal.ServiceFlowInfo
import net.corda.node.serialization.NodeClock
import net.corda.node.services.api.MonitoringService
import net.corda.node.services.api.NetworkMapCacheInternal
import net.corda.node.services.api.SchemaService
import net.corda.node.services.api.ServiceHubInternal
import net.corda.node.services.api.*
import net.corda.node.services.messaging.MessagingService
import net.corda.node.services.schema.NodeSchemaService
import net.corda.node.services.statemachine.StateMachineManager