public abstract class ExtensionKey<T extends Extension> extends java.lang.Object implements ExtensionId<T>, ExtensionIdProvider
object MyExt extends ExtensionKey[Ext]
class Ext(system: ExtendedActorSystem) extends Extension {
...
}
Java API:
public class MyExt extends Extension {
public static final ExtensionKey<MyExt> key = new ExtensionKey<MyExt>(MyExt.class);
public MyExt(ExtendedActorSystem system) {
...
}
}
Note: Don't use this class if the extension is written in Scala and consumed in
Eclipse Java projects. JDT has problems resolving correct type for the
get
method.
Constructor and Description |
---|
ExtensionKey(java.lang.Class<T> clazz) |
ExtensionKey(scala.reflect.ClassTag<T> m) |
Modifier and Type | Method and Description |
---|---|
T |
createExtension(ExtendedActorSystem system)
Is used by Akka to instantiate the Extension identified by this ExtensionId,
internal use only.
|
ExtensionId<T> |
lookup()
Returns the canonical ExtensionId for this Extension
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
apply, equals, get, hashCode
public ExtensionKey(scala.reflect.ClassTag<T> m)
public ExtensionKey(java.lang.Class<T> clazz)
public ExtensionId<T> lookup()
ExtensionIdProvider
lookup
in interface ExtensionIdProvider
public T createExtension(ExtendedActorSystem system)
ExtensionId
createExtension
in interface ExtensionId<T extends Extension>
system
- (undocumented)