| ActorSystemWithExtensionsWithExtensionT Method (ActorSystem, Type) |
Retrieves the extension specified by a given type, T, from a given actor system.
If the extension does not exist within the actor system, then the extension specified by extensionId
is registered to the actor system.
Namespace:
Akka.Actor
Assembly:
Akka (in Akka.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax public static T WithExtension<T>(
this ActorSystem system,
Type extensionId
)
where T : class, IExtension
[<ExtensionAttribute>]
static member WithExtension :
system : ActorSystem *
extensionId : Type -> 'T when 'T : not struct and IExtension
Parameters
- system
- Type: Akka.ActorActorSystem
The actor system from which to retrieve the extension or to register with if it does not exist. - extensionId
- Type: SystemType
The type of the extension to register if it does not exist in the given actor system.
Type Parameters
- T
- The type associated with the extension to retrieve.
Return Value
Type:
TThe extension retrieved from the given actor system.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
ActorSystem. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also