Exemplo n.º 1
0
		public void InstallComposite(ICompositeApp composite)
		{
			this.WriteDebugMessage(string.Format("Installing composite {0}.", composite.GetType().FullName));

			if (Composite != null)
			{
				throw new CompositeAlreadyInstalledException();
			}

			if (composite.State != CompositeApplicationState.Configured)
			{
				throw new CompositeNotConfiguredException();
			}

			Composite = composite;

			Container.Register(
				Component.For(typeof(ISimpleRepository<>)).ImplementedBy(typeof(NhSimpleRepository<>)).LifeStyle.Transient);

			extractProcessorsFromAgents();

			this.WriteInfoMessage(string.Format("Installed composite {0}.", composite.GetType().Name));
		}