示例#1
0
        internal async Task <HandlerCall[]> FindCalls(JasperRegistry registry)
        {
            if (_conventionalDiscoveryDisabled)
            {
                return(_explicitTypes.SelectMany(actionsFromType).ToArray());
            }

            if (registry.ApplicationAssembly == null)
            {
                return(new HandlerCall[0]);
            }


            // TODO -- need to expose the module assemblies off of this

            var types = await TypeRepository.FindTypes(registry.ApplicationAssembly,
                                                       TypeClassification.Concretes | TypeClassification.Closed, type => _typeFilters.Matches(type))
                        .ConfigureAwait(false);


            return(types
                   .Where(x => !x.HasAttribute <JasperIgnoreAttribute>())
                   .Concat(_explicitTypes)
                   .Distinct()
                   .SelectMany(actionsFromType).ToArray());
        }
示例#2
0
        public async Task <ServiceCapabilities> Compile(HandlerGraph handlers, SerializationGraph serialization, IChannelGraph channels, JasperRuntime runtime, ITransport[] transports, UriAliasLookup lookups)
        {
            if (runtime.ApplicationAssembly != null)
            {
                var publishedTypes = await TypeRepository.FindTypes(runtime.ApplicationAssembly,
                                                                    TypeClassification.Concretes | TypeClassification.Closed, type => _publishFilters.Any(x => x(type)));

                foreach (var type in publishedTypes)
                {
                    Publish(type);
                }
            }



            var capabilities = await compile(handlers, serialization, channels, transports, lookups, runtime);


            capabilities.ServiceName = runtime.ServiceName;

            return(capabilities);
        }