Exemplo n.º 1
0
 internal static GrainClassData GetImplementation(IGrainTypeResolver grainTypeResolver, Type interfaceType, string grainClassNamePrefix = null)
 {
     GrainClassData implementation;
     if (!grainTypeResolver.TryGetGrainClassData(interfaceType, out implementation, grainClassNamePrefix))
     {
         var loadedAssemblies = grainTypeResolver.GetLoadedGrainAssemblies();
         throw new ArgumentException(
             String.Format("Cannot find an implementation class for grain interface: {0}{2}. Make sure the grain assembly was correctly deployed and loaded in the silo.{1}",
                           interfaceType,
                           String.IsNullOrEmpty(loadedAssemblies) ? String.Empty : String.Format(" Loaded grain assemblies: {0}", loadedAssemblies),
                           String.IsNullOrEmpty(grainClassNamePrefix) ? String.Empty : ", grainClassNamePrefix=" + grainClassNamePrefix));
     }
     return implementation;
 }
Exemplo n.º 2
0
        internal static GrainClassData GetImplementation(IGrainTypeResolver grainTypeResolver, Type interfaceType, string grainClassNamePrefix = null)
        {
            GrainClassData implementation;

            if (!grainTypeResolver.TryGetGrainClassData(interfaceType, out implementation, grainClassNamePrefix))
            {
                var loadedAssemblies = grainTypeResolver.GetLoadedGrainAssemblies();
                throw new ArgumentException(
                          String.Format("Cannot find an implementation class for grain interface: {0}{2}. Make sure the grain assembly was correctly deployed and loaded in the silo.{1}",
                                        interfaceType,
                                        String.IsNullOrEmpty(loadedAssemblies) ? String.Empty : String.Format(" Loaded grain assemblies: {0}", loadedAssemblies),
                                        String.IsNullOrEmpty(grainClassNamePrefix) ? String.Empty : ", grainClassNamePrefix=" + grainClassNamePrefix));
            }
            return(implementation);
        }
Exemplo n.º 3
0
        internal static int GetImplementationTypeCode(Type interfaceType, string grainClassNamePrefix = null)
        {
            int typeCode;
            IGrainTypeResolver grainTypeResolver = RuntimeClient.Current.GrainTypeResolver;

            if (!grainTypeResolver.TryGetGrainTypeCode(interfaceType, out typeCode, grainClassNamePrefix))
            {
                var loadedAssemblies = grainTypeResolver.GetLoadedGrainAssemblies();
                throw new ArgumentException(
                          String.Format("Cannot find a type code for an implementation class for grain interface: {0}{2}. Make sure the grain assembly was correctly deployed and loaded in the silo.{1}",
                                        interfaceType,
                                        String.IsNullOrEmpty(loadedAssemblies) ? String.Empty : String.Format(" Loaded grain assemblies: {0}", loadedAssemblies),
                                        String.IsNullOrEmpty(grainClassNamePrefix) ? String.Empty : ", grainClassNamePrefix=" + grainClassNamePrefix));
            }
            return(typeCode);
        }