Example #1
0
        public IGrainMethodInvoker GetInvoker(GrainTypeManager typeManager, int interfaceId, string genericGrainType = null)
        {
            if (lastInvoker != null && interfaceId == lastInvoker.InterfaceId)
                return lastInvoker;

            var invoker = typeManager.GetInvoker(interfaceId);
            lastInvoker = invoker;
            
            return lastInvoker;
        }
Example #2
0
        public IGrainMethodInvoker GetInvoker(GrainTypeManager typeManager, int interfaceId, string genericGrainType = null)
        {
            if (lastInvoker != null && interfaceId == lastInvoker.InterfaceId)
            {
                return(lastInvoker);
            }

            var invoker = typeManager.GetInvoker(interfaceId);

            lastInvoker = invoker;

            return(lastInvoker);
        }
Example #3
0
        internal static IGrainExtensionMethodInvoker TryGetExtensionInvoker(GrainTypeManager typeManager, Type handlerType)
        {
            var interfaces = GrainInterfaceUtils.GetRemoteInterfaces(handlerType).Values;

            if (interfaces.Count != 1)
            {
                throw new InvalidOperationException($"Extension type {handlerType.FullName} implements more than one grain interface.");
            }

            var interfaceId = GrainInterfaceUtils.GetGrainInterfaceId(interfaces.First());
            var invoker     = typeManager.GetInvoker(interfaceId);

            if (invoker != null)
            {
                return((IGrainExtensionMethodInvoker)invoker);
            }

            throw new ArgumentException(
                      $"Provider extension handler type {handlerType} was not found in the type manager",
                      nameof(handlerType));
        }
        public IGrainMethodInvoker GetInvoker(GrainTypeManager typeManager, int interfaceId, string genericGrainType = null)
        {
            // Return previous cached invoker, if applicable
            if (lastInvoker != null && interfaceId == lastInvoker.InterfaceId) // extension invoker returns InterfaceId==0, so this condition will never be true if an extension is installed
            {
                return(lastInvoker);
            }

            if (extensionInvoker != null && extensionInvoker.IsExtensionInstalled(interfaceId))
            {
                // Shared invoker for all extensions installed on this grain
                lastInvoker = extensionInvoker;
            }
            else
            {
                // Find the specific invoker for this interface / grain type
                lastInvoker = typeManager.GetInvoker(interfaceId, genericGrainType);
            }

            return(lastInvoker);
        }
 public IGrainMethodInvoker GetInvoker(int interfaceId, string genericGrainType = null)
 {
     return(typeManager.GetInvoker(interfaceId, genericGrainType));
 }
Example #6
0
        public IGrainMethodInvoker GetInvoker(GrainTypeManager typeManager, int interfaceId, string genericGrainType = null)
        {
            // Return previous cached invoker, if applicable
            if (lastInvoker != null && interfaceId == lastInvoker.InterfaceId) // extension invoker returns InterfaceId==0, so this condition will never be true if an extension is installed
                return lastInvoker;

            if (extensionInvoker != null && extensionInvoker.IsExtensionInstalled(interfaceId))
            {
                // Shared invoker for all extensions installed on this grain
                lastInvoker = extensionInvoker;
            }
            else
            {
                // Find the specific invoker for this interface / grain type
                lastInvoker = typeManager.GetInvoker(interfaceId, genericGrainType);
            }

            return lastInvoker;
        }