return this;
}
@Override
public InjectionContext<?, ?> create(Handler<Class<?>, Boolean> filter) throws Exception {
final Container container = new WeldContainer(classLoader, scopeController, scopes);
for (ReadFileSystem<?> fs : fileSystems) {
container.addFileSystem(fs);
}
CDIContext cdiContext = new CDIContext(this, filter) {
@Override
public ClassLoader getClassLoader() {
return container.getClassLoader();
}
@Override
public BeanManager getBeanManager() {
return container.getManager();
}
@Override
public void close() {
container.stop();
}
@Override
public InjectorProvider getProvider() {
return InjectorProvider.WELD;
}
};
// Do the real boot
CDIContext.boot.set(cdiContext);
try {
container.start();
}
finally {
CDIContext.boot.set(cdiContext);
}