(Breaking) improvement to SingletonStage

This commit is contained in:
Sarah Gerweck 2016-07-14 02:00:48 -07:00
parent 0660143ae4
commit 58ea91e3a3

View File

@ -10,9 +10,9 @@ abstract class SingletonStage {
type InstanceStage <: ParentStage type InstanceStage <: ParentStage
protected[this] var singletonStage: Option[InstanceStage] = None protected[this] final var singletonStage: Option[InstanceStage] = None
def name = getClass.getSimpleName protected[this] def singletonStageName = getClass.getSimpleName
protected[this] def makeStage(): InstanceStage protected[this] def makeStage(): InstanceStage
@ -28,9 +28,9 @@ abstract class SingletonStage {
} }
} }
protected trait ParentStage extends Stage { protected[this] trait ParentStage extends Stage {
require(singletonStage.isEmpty, s"Cannot have two ${name} stages") require(singletonStage.isEmpty, s"Cannot have two ${singletonStageName} stages")
logger.debug(s"Creating singleton ${name} stage") logger.trace(s"Creating singleton ${singletonStageName} stage")
override def close() = { override def close() = {
singletonStage = None singletonStage = None