class ContractStore[T, L] extends BaseContractObserver[T] with NamedLogging with NoTracing
A in-memory contract store with trivial indexing and query capabilities
The contract store takes an index function which maps an instance to an index object L (a case class), which allows to query the store using find(arg: L): Seq[Contract[T]].
The store find / all commands will only return contracts for which no command has yet been submitted that will consume the contract.
- T
the contract template (scala code-gen)
- L
the index expression
- Alphabetic
- By Inheritance
- ContractStore
- NoTracing
- NamedLogging
- BaseContractObserver
- ContractObserver
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ContractStore(name: String, companion: TemplateCompanion[T], index: (Contract[T]) => L, filter: (Contract[T]) => Boolean, loggerFactory: NamedLoggerFactory)(implicit arg0: Pretty[T])
- name
a name which we'll be using for logging
- companion
the template companion of the template we are watching
- index
the indexing function which takes an instance of a contract and returns some index object (query arguments)
- filter
filter to limit what is stored in the contract store
- loggerFactory
the logger factory
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def allAvailable: Iterable[Contract[T]]
return all contracts which are not pending
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def contractArchived(archive: Contract[T], index: L): Unit
- Attributes
- protected
- def contractCreated(create: Contract[T], index: L): Unit
- Attributes
- protected
- def entirelyEmpty: Boolean
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def find(item: L): Seq[Contract[T]]
find all contracts that are not pending and match the query argument
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hasPending: Boolean
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Definition Classes
- ContractStore → NamedLogging
- implicit def loggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noTracingLogger: Logger
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def num(item: L): Int
return number of contracts matching the query argument excluding pending contracts
- def one(item: L): Option[Contract[T]]
return one contract that is not pending and that matches the query argument
- def processArchive(archive: ArchivedEvent): Boolean
- Definition Classes
- BaseContractObserver → ContractObserver
- def processArchive_(archive: ContractId[T]): Unit
- Attributes
- protected
- Definition Classes
- ContractStore → BaseContractObserver
- def processCreate(create: CreatedEvent): Boolean
- Definition Classes
- BaseContractObserver → ContractObserver
- def processCreate_(create: Contract[T]): Unit
- Attributes
- protected
- Definition Classes
- ContractStore → BaseContractObserver
- def reset(): Unit
- Definition Classes
- ContractStore → ContractObserver
- def setPending(cid: ContractId[T], isPending: Boolean): Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def totalNum: Int
return total number of contracts in store, pending and non-pending
- implicit def traceContext: TraceContext
- Attributes
- protected
- Definition Classes
- NoTracing
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])