If this is for an Akka Extension, you''ll also want something like this:


object AkkaSerializer extends ExtensionId[AkkaSerializer] with ExtensionIdProvider {
  
  override def apply(system: ActorSystem): AkkaSerializer = super.apply(system)
 
  override def lookup: ExtensionId[_ <: Extension] = AkkaSerializer

  override def createExtension(system: ExtendedActorSystem): AkkaSerializer = new AkkaSerializer(system)
}