Beispiel #1
0
        private ServiceHost(IList <IListener> listeners, ISerializer serializer,
                            Type callbackType, ILoggerFactory loggerFactory)
        {
            TypeDescription <TService> .ValidateAsService(callbackType);

            _listeners    = new ReadOnlyCollection <IListener>(listeners);
            _serializer   = serializer;
            _msgBuilder   = new MessageBuilder(_serializer);
            _callbackType = callbackType;
            _logger       = loggerFactory.CreateLogger("ServiceHost");
        }
Beispiel #2
0
        internal ServiceHost(IList <IListener> listeners, InstanceMode instanceMode, ISerializer serializer,
                             Type callbackType, ILoggerFactory loggerFactory)
        {
            TypeDescription <TService> .ValidateAsService(callbackType);

            _listeners    = new ReadOnlyCollection <IListener>(listeners);
            _serializer   = serializer;
            _msgBuilder   = new MessageBuilder(_serializer);
            _callbackType = callbackType;
            _logger       = loggerFactory.CreateLogger("ServiceHost");

            _instanceContextFactory = new InstanceContextFactory <TService>(instanceMode, _msgBuilder, loggerFactory);
            _instanceContextFactory.InstanceCreated        += OnInstanceFactoryInstanceCreate;
            _instanceContextFactory.SessionInstanceRemoved += OnInstanceFactorySessionInstanceRemoved;
        }