trait Extension extends AnyRef
The basic ActorSystem covers all that is needed for locally running actors,
using futures and so on. In addition, more features can hook into it and
thus become visible to actors et al by registering themselves as extensions.
This is accomplished by providing an extension—which is an object
implementing this trait—to ActorSystem.registerExtension(...)
or by
specifying the corresponding option in the configuration passed to
ActorSystem, which will then instantiate (without arguments) each FQCN and
register the result.
The extension itself can be created in any way desired and has full access to the ActorSystem implementation.
This trait is only a marker interface to signify an Akka Extension. This is how an extension is normally constructed.
Scala API:
object MyExt extends ExtensionId[Ext] with ExtensionIdProvider { override def lookup = MyExt override def createExtension(system: ExtendedActorSystem): Ext = new Ext(system) // Java API: retrieve the extension for the given system. override def get(system: ActorSystem): UdpExt = super.get(system) override def get(system: ClassicActorSystemProvider): UdpExt = super.get(system) } class Ext(system: ExtendedActorSystem) extends Extension { ... }
Java API:
public class MyExt extends AbstractExtensionId<MyExtImpl> implements ExtensionIdProvider { public final static MyExt MyExtProvider = new MyExt(); private MyExt() {} public MyExt lookup() { return MyExt.MyExtProvider; } public MyExtImpl createExtension(ExtendedActorSystem system) { return new MyExtImpl(); } } public class MyExtImpl implements Extension { ... }
- Source
- Extension.scala
- Alphabetic
- By Inheritance
- Extension
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Extension, B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
- def ensuring(cond: (Extension) => Boolean, msg: => Any): Extension
- def ensuring(cond: (Extension) => Boolean): Extension
- def ensuring(cond: Boolean, msg: => Any): Extension
- def ensuring(cond: Boolean): Extension
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Extension toStringFormat[Extension] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (Extension, B)
- Implicit
- This member is added by an implicit conversion from Extension toArrowAssoc[Extension] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.