Example #1
0
        /// <summary>
        /// Returns an extension registered to this ActorSystem
        /// </summary>
        public object GetExtension(IExtensionId extensionId)
        {
            object extension;

            _extensions.TryGetValue(extensionId.ExtensionType, out extension);
            return(extension);
        }
Example #2
0
        /// <summary>
        /// Retrieves the specified extension that is registered to this actor system.
        /// </summary>
        /// <param name="extensionId">The extension to retrieve</param>
        /// <returns>The specified extension registered to this actor system</returns>
        public override object GetExtension(IExtensionId extensionId)
        {
            object extension;

            TryGetExtension(extensionId.ExtensionType, out extension);
            return(extension);
        }
Example #3
0
        /// <summary>
        /// Registers the specified extension with this actor system.
        /// </summary>
        /// <param name="extension">The extension to register with this actor system</param>
        /// <returns>The extension registered with this actor system</returns>
        public override object RegisterExtension(IExtensionId extension)
        {
            if (extension == null)
            {
                return(null);
            }

            _extensions.GetOrAdd(extension.ExtensionType, t => new Lazy <object>(() => extension.CreateExtension(this), LazyThreadSafetyMode.ExecutionAndPublication));

            return(extension.Get(this));
        }
Example #4
0
        public override object RegisterExtension(IExtensionId extension)
        {
            if (extension == null)
            {
                return(null);
            }
            if (!_extensions.ContainsKey(extension.ExtensionType))
            {
                _extensions.TryAdd(extension.ExtensionType, new Lazy <object>(() => extension.CreateExtension(this)));
            }

            return(extension.Get(this));
        }
Example #5
0
        /// <summary>
        /// Registers a new extensionBase to the ActorSystem
        /// </summary>
        /// <param name="extensionBase">The extensionBase to register</param>
        public object RegisterExtension(IExtensionId extensionBase)
        {
            if (extensionBase == null)
            {
                return(null);
            }
            if (!_extensions.ContainsKey(extensionBase.ExtensionType))
            {
                _extensions.TryAdd(extensionBase.ExtensionType, extensionBase.CreateExtension(this));
            }

            return(extensionBase.Get(this));
        }
Example #6
0
 /// <summary>
 /// Registers the specified extension with this actor system.
 /// </summary>
 /// <param name="extension">The extension to register with this actor system</param>
 /// <returns>The extension registered with this actor system</returns>
 public abstract object RegisterExtension(IExtensionId extension);
Example #7
0
 /// <summary>
 /// Retrieves the specified extension that is registered to this actor system.
 /// </summary>
 /// <param name="extensionId">The extension to retrieve</param>
 /// <returns>The specified extension registered to this actor system</returns>
 public abstract object GetExtension(IExtensionId extensionId);
Example #8
0
 /// <summary>
 /// Returns an extension registered to this ActorSystem
 /// </summary>
 public object GetExtension(IExtensionId extensionId)
 {
     return(_actorSystem.GetExtension(extensionId));
 }
Example #9
0
 public object RegisterExtension(IExtensionId extension)
 {
     return(_actorSystem.RegisterExtension(extension));
 }