public DefaultDependencyResolver()
        {
            var traceManager = new Lazy<TraceManager>(() => new TraceManager());

            var assemblyLocator = new Lazy<DefaultAssemblyLocator>(() => new DefaultAssemblyLocator());
            Register(typeof(IAssemblyLocator), () => assemblyLocator.Value);

            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();
            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy<IServerCommandHandler>(() => new ServerCommandHandler(this));
            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var messageBus = new Lazy<InProcessMessageBus>(() => new InProcessMessageBus(this));

            Register(typeof(IMessageBus), () => messageBus.Value);

            var serializer = new JsonConvertAdapter();

            Register(typeof(IJsonSerializer), () => serializer);

            // Hubs
            var methodDescriptorProvider = new Lazy<ReflectedMethodDescriptorProvider>();
            Register(typeof(IMethodDescriptorProvider), () => methodDescriptorProvider.Value);

            var hubDescriptorProvider = new Lazy<ReflectedHubDescriptorProvider>(() => new ReflectedHubDescriptorProvider(this));
            Register(typeof(IHubDescriptorProvider), () => hubDescriptorProvider.Value);

            var parameterBinder = new Lazy<DefaultParameterResolver>();
            Register(typeof(IParameterResolver), () => parameterBinder.Value);

            var activator = new Lazy<DefaultHubActivator>(() => new DefaultHubActivator(this));
            Register(typeof(IHubActivator), () => activator.Value);

            var hubManager = new Lazy<DefaultHubManager>(() => new DefaultHubManager(this));
            Register(typeof(IHubManager), () => hubManager.Value);

            var proxyGenerator = new Lazy<DefaultJavaScriptProxyGenerator>(() => new DefaultJavaScriptProxyGenerator(this));
            Register(typeof(IJavaScriptProxyGenerator), () => proxyGenerator.Value);

            var connectionIdGenerator = new GuidConnectionIdGenerator();
            Register(typeof(IConnectionIdGenerator), () => connectionIdGenerator);

            var transportManager = new Lazy<TransportManager>(() => new TransportManager(this));
            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();
            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy<TransportHeartBeat>(() => new TransportHeartBeat(this));
            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy<ConnectionManager>(() => new ConnectionManager(this));
            Register(typeof(IConnectionManager), () => connectionManager.Value);
        }
Esempio n. 2
0
        private void RegisterDefaultServices()
        {
            var traceManager = new Lazy <TraceManager>(() => new TraceManager());

            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();

            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy <IServerCommandHandler>(() => new ServerCommandHandler(this));

            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var newMessageBus = new Lazy <IMessageBus>(() => new MessageBus(this));

            Register(typeof(IMessageBus), () => newMessageBus.Value);

            var serializer = new Lazy <JsonNetSerializer>();

            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdPrefixGenerator = new EmptyConnectionIdPrefixGenerator();

            Register(typeof(IConnectionIdPrefixGenerator), () => connectionIdPrefixGenerator);

            var transportManager = new Lazy <TransportManager>(() => new TransportManager(this));

            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();

            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy <TransportHeartBeat>(() => new TransportHeartBeat(this));

            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy <ConnectionManager>(() => new ConnectionManager(this));

            Register(typeof(IConnectionManager), () => connectionManager.Value);

            var ackHandler = new Lazy <AckHandler>();

            Register(typeof(IAckHandler), () => ackHandler.Value);

            var perfCounterWriter = new Lazy <PerformanceCounterManager>(() => new PerformanceCounterManager());

            Register(typeof(IPerformanceCounterManager), () => perfCounterWriter.Value);
        }
        public DefaultDependencyResolver()
        {
            var traceManager = new Lazy<TraceManager>(() => new TraceManager());

            Register(typeof(ITraceManager), () => traceManager.Value);

            var messageBus = new Lazy<InProcessMessageBus>(() => new InProcessMessageBus(this));

            Register(typeof(IMessageBus), () => messageBus.Value);

            var serializer = new JsonConvertAdapter();

            Register(typeof(IJsonSerializer), () => serializer);

            // Hubs
            var hubLocator = new Lazy<DefaultHubLocator>();
            Register(typeof(IHubLocator), () => hubLocator.Value);

            var hubTypeResolver = new Lazy<DefaultHubTypeResolver>(() => new DefaultHubTypeResolver(this));
            Register(typeof(IHubTypeResolver), () => hubTypeResolver.Value);

            var actionResolver = new Lazy<DefaultActionResolver>(() => new DefaultActionResolver());
            Register(typeof(IActionResolver), () => actionResolver.Value);

            var activator = new Lazy<DefaultHubActivator>(() => new DefaultHubActivator(this));
            Register(typeof(IHubActivator), () => activator.Value);

            var hubFactory = new Lazy<DefaultHubFactory>(() => new DefaultHubFactory(this));
            Register(typeof(IHubFactory), () => hubFactory.Value);

            var proxyGenerator = new Lazy<DefaultJavaScriptProxyGenerator>(() => new DefaultJavaScriptProxyGenerator(this));
            Register(typeof(IJavaScriptProxyGenerator), () => proxyGenerator.Value);

            var connectionIdFactory = new GuidConnectionIdFactory();
            Register(typeof(IConnectionIdFactory), () => connectionIdFactory);

            var transportManager = new Lazy<TransportManager>(() => new TransportManager(this));
            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();
            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy<TransportHeartBeat>(() => new TransportHeartBeat(this));
            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy<ConnectionManager>(() => new ConnectionManager(this));
            Register(typeof(IConnectionManager), () => connectionManager.Value);
        }
Esempio n. 4
0
        private void RegisterDefaultServices()
        {
            var traceManager = new Lazy <TraceManager>(() => new TraceManager());

            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();

            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy <IServerCommandHandler>(() => new ServerCommandHandler(this));

            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var messageBus = new Lazy <InProcessMessageBus>(() => new InProcessMessageBus(this));

            Register(typeof(IMessageBus), () => messageBus.Value);

            var serializer = new Lazy <JsonNetSerializer>();

            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdGenerator = new GuidConnectionIdGenerator();

            Register(typeof(IConnectionIdGenerator), () => connectionIdGenerator);

            var transportManager = new Lazy <TransportManager>(() => new TransportManager(this));

            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();

            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy <TransportHeartBeat>(() => new TransportHeartBeat(this));

            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy <ConnectionManager>(() => new ConnectionManager(this));

            Register(typeof(IConnectionManager), () => connectionManager.Value);
        }
        public DefaultDependencyResolver()
        {
            var traceManager = new Lazy<TraceManager>(() => new TraceManager());

            var assemblyLocator = new Lazy<DefaultAssemblyLocator>(() => new DefaultAssemblyLocator());
            Register(typeof(IAssemblyLocator), () => assemblyLocator.Value);

            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();
            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy<IServerCommandHandler>(() => new ServerCommandHandler(this));
            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var messageBus = new Lazy<InProcessMessageBus>(() => new InProcessMessageBus(this));

            Register(typeof(IMessageBus), () => messageBus.Value);

            var serializer = new Lazy<JsonConvertAdapter>();

            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdGenerator = new GuidConnectionIdGenerator();
            Register(typeof(IConnectionIdGenerator), () => connectionIdGenerator);

            var transportManager = new Lazy<TransportManager>(() => new TransportManager(this));
            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();
            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy<TransportHeartBeat>(() => new TransportHeartBeat(this));
            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy<ConnectionManager>(() => new ConnectionManager(this));
            Register(typeof(IConnectionManager), () => connectionManager.Value);

            // Hubs
            RegisterHubExtensions();
        }
Esempio n. 6
0
        private void RegisterDefaultServices()
        {
            var traceManager = new Lazy<TraceManager>(() => new TraceManager());
            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();
            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy<IServerCommandHandler>(() => new ServerCommandHandler(this));
            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var newMessageBus = new Lazy<IMessageBus>(() => new MessageBus(this));
            Register(typeof(IMessageBus), () => newMessageBus.Value);

            var serializer = new Lazy<JsonNetSerializer>();
            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdPrefixGenerator = new EmptyConnectionIdPrefixGenerator();
            Register(typeof(IConnectionIdPrefixGenerator), () => connectionIdPrefixGenerator);

            var transportManager = new Lazy<TransportManager>(() => new TransportManager(this));
            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();
            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy<TransportHeartBeat>(() => new TransportHeartBeat(this));
            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy<ConnectionManager>(() => new ConnectionManager(this));
            Register(typeof(IConnectionManager), () => connectionManager.Value);

            var ackHandler = new Lazy<AckHandler>();
            Register(typeof(IAckHandler), () => ackHandler.Value);

            var perfCounterWriter = new Lazy<PerformanceCounterManager>(() => new PerformanceCounterManager());
            Register(typeof(IPerformanceCounterManager), () => perfCounterWriter.Value);
        }
        private void RegisterDefaultServices()
        {
            var traceManager = new Lazy<TraceManager>(() => new TraceManager());
            Register(typeof(ITraceManager), () => traceManager.Value);

            var serverIdManager = new ServerIdManager();
            Register(typeof(IServerIdManager), () => serverIdManager);

            var serverMessageHandler = new Lazy<IServerCommandHandler>(() => new ServerCommandHandler(this));
            Register(typeof(IServerCommandHandler), () => serverMessageHandler.Value);

            var messageBus = new Lazy<InProcessMessageBus>(() => new InProcessMessageBus(this));
            Register(typeof(IMessageBus), () => messageBus.Value);

            var serializer = new Lazy<JsonNetSerializer>();
            Register(typeof(IJsonSerializer), () => serializer.Value);

            var connectionIdGenerator = new GuidConnectionIdGenerator();
            Register(typeof(IConnectionIdGenerator), () => connectionIdGenerator);

            var transportManager = new Lazy<TransportManager>(() => new TransportManager(this));
            Register(typeof(ITransportManager), () => transportManager.Value);

            var configurationManager = new DefaultConfigurationManager();
            Register(typeof(IConfigurationManager), () => configurationManager);

            var transportHeartbeat = new Lazy<TransportHeartBeat>(() => new TransportHeartBeat(this));
            Register(typeof(ITransportHeartBeat), () => transportHeartbeat.Value);

            var connectionManager = new Lazy<ConnectionManager>(() => new ConnectionManager(this));
            Register(typeof(IConnectionManager), () => connectionManager.Value);
        }