Exemplo n.º 1
0
        public void Create()
        {
            try
            {
                _log.DebugFormat("[Shelf:{0}] Create", _name);

                _reference = new ShelfReference(_name, _shelfType, _publish);

                if (_assemblyNames != null)
                {
                    _assemblyNames.Each(_reference.LoadAssembly);
                }

                if (_bootstrapperType != null)
                {
                    _reference.Create(_bootstrapperType);
                }
                else
                {
                    _reference.Create();
                }
            }
            catch (Exception ex)
            {
                _publish.Send(new ServiceFault(_name, new BuildServiceException(_name, _bootstrapperType, ex)));
            }
        }
Exemplo n.º 2
0
        void ShelfUnloaded(ServiceUnloaded message)
        {
            _reference.Dispose();
            _reference = null;

            _log.DebugFormat("[Shelf:{0}] {1}", _name, "Unloaded");

            _publish.Send(message);
        }
Exemplo n.º 3
0
        void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                if (_reference != null)
                {
                    _reference.Dispose();
                    _reference = null;
                }
            }

            _disposed = true;
        }
Exemplo n.º 4
0
        public void Create()
        {
            try
            {
                _log.DebugFormat("[Shelf:{0}] Create", _name);

                _reference = new ShelfReference(_name, _shelfType, _publish);

                if (_assemblyNames != null)
                {
                    _assemblyNames.Each(_reference.LoadAssembly);
                }

                if (_bootstrapperType != null)
                {
                    _reference.Create(_bootstrapperType);
                }
                else
                {
                    _reference.Create();
                }
            }
            catch (Exception ex)
            {
                // Henrik: remove this line in favor of the other exception handling mechanism
                // handling the faulted state, but right now I want the binding information.
                _log.Error("cannot create shelf", ex);

                var buildServiceException =
                    _bootstrapperType == null
                                        ? new BuildServiceException(_name, ex)
                                        : new BuildServiceException(_name, _bootstrapperType, ex);

                _publish.Send(new ServiceFault(_name, buildServiceException));
            }
        }