本文整理汇总了Java中org.eclipse.sisu.space.BeanScanning类的典型用法代码示例。如果您正苦于以下问题:Java BeanScanning类的具体用法?Java BeanScanning怎么用?Java BeanScanning使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BeanScanning类属于org.eclipse.sisu.space包,在下文中一共展示了BeanScanning类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doSetUp
import org.eclipse.sisu.space.BeanScanning; //导入依赖的package包/类
@Before
public final void doSetUp() throws Exception {
List<Module> modules = new ArrayList<>();
customizeModules(modules);
modules.add(new SpaceModule(new URLClassSpace(getClass().getClassLoader()), BeanScanning.INDEX));
Guice.createInjector(new WireModule(modules));
setUp();
}
示例2: injectorFor
import org.eclipse.sisu.space.BeanScanning; //导入依赖的package包/类
@Override
public Injector injectorFor(final ClassLoader classLoader, final Iterable<Module> modules)
{
return Guice.createInjector(
Stage.DEVELOPMENT,
new WireModule(
new AbstractModule() // params
{
@Override
protected void configure() {
bind(Vertx.class).toInstance(vertx);
bind(EventBus.class).toInstance(vertx.eventBus());
if (parameters != null) {
bind(ParameterKeys.PROPERTIES).toInstance(parameters);
}
if (bootstrapModules != null) {
for (Module bootstrapModule : bootstrapModules) {
install(bootstrapModule);
}
}
for (Module module : modules) {
install(module);
}
}
},
new SpaceModule( // space module
new URLClassSpace(classLoader), BeanScanning.INDEX
)
)
);
}
示例3: scanning
import org.eclipse.sisu.space.BeanScanning; //导入依赖的package包/类
@Override
public BeanScanning scanning() {
return BeanScanning.INDEX;
}
示例4: spaceModule
import org.eclipse.sisu.space.BeanScanning; //导入依赖的package包/类
@Override
protected Module spaceModule() {
return new SpaceModule(space, BeanScanning.GLOBAL_INDEX);
}
示例5: init
import org.eclipse.sisu.space.BeanScanning; //导入依赖的package包/类
public void init(@Nullable final Integer poolSize, @Nullable final JobFactory factory) throws Exception {
eventManager = new SimpleEventManager();
applicationDirectories = mock(ApplicationDirectories.class);
baseUrlManager = mock(BaseUrlManager.class);
nodeAccess = mock(NodeAccess.class);
Module module = binder -> {
Properties properties = new Properties();
properties.put("basedir", util.getBaseDir());
if (poolSize != null) {
properties.put("nexus.quartz.poolSize", poolSize);
}
binder.bind(ParameterKeys.PROPERTIES)
.toInstance(properties);
binder.bind(EventManager.class).toInstance(eventManager);
File workDir = util.createTempDir(util.getTargetDir(), "workdir");
when(applicationDirectories.getWorkDirectory(anyString())).thenReturn(workDir);
binder.bind(ApplicationDirectories.class)
.toInstance(applicationDirectories);
binder.bind(BaseUrlManager.class)
.toInstance(baseUrlManager);
binder.bind(DatabaseInstance.class)
.annotatedWith(Names.named("config"))
.toInstance(databaseInstance);
when(nodeAccess.getId()).thenReturn("test-12345");
when(nodeAccess.getMemberIds()).thenReturn(ImmutableSet.of("test-12345"));
binder.bind(NodeAccess.class)
.toInstance(nodeAccess);
if (factory != null) {
binder.bind(JobFactory.class).toInstance(factory);
}
};
this.injector = Guice.createInjector(new WireModule(
module, new StateGuardModule(),
new SpaceModule(new URLClassSpace(TaskSchedulerHelper.class.getClassLoader()), BeanScanning.INDEX)
));
injector.injectMembers(this);
}