public BottleServiceRunner Bootstrap(string bootstrapperType = null) { if (bootstrapperType.IsNotEmpty()) { var type = Type.GetType(bootstrapperType); var bootstrapper = Activator.CreateInstance(type).As<IBootstrapper>(); var wrapped = new WrappedBootstrapper(bootstrapper); PackageRegistry.LoadPackages(x => x.Bootstrapper(wrapped)); PackageRegistry.AssertNoFailures(); return new BottleServiceRunner(wrapped.BottleServices()); } var facility = new BottlesServicePackageFacility(); PackageRegistry.LoadPackages(x => x.Facility(facility)); PackageRegistry.AssertNoFailures(); return facility.Aggregator.ServiceRunner(); }
public void Dispose() { _wrappedBootstrapper.BottleServices().Each(x => x.Stop()); }