org.jboss.weld.environment.se.Weld.addPackage()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中org.jboss.weld.environment.se.Weld.addPackage()方法的一些代码示例,展示了Weld.addPackage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Weld.addPackage()方法的具体详情如下:
包路径:org.jboss.weld.environment.se.Weld
类名称:Weld
方法名:addPackage

Weld.addPackage介绍

[英]A package of the specified class will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive.
[中]将扫描指定类的包,找到的类将添加到合成bean归档的bean类集中。

代码示例

代码示例来源:origin: weld/core

/**
 * Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive.
 *
 * @param scanRecursively
 * @param packageClasses
 * @return self
 */
public Weld addPackages(boolean scanRecursively, Class<?>... packageClasses) {
  for (Class<?> packageClass : packageClasses) {
    addPackage(scanRecursively, packageClass);
  }
  return this;
}

代码示例来源:origin: org.jboss.weld.se/weld-se

/**
 * Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive.
 *
 * @param scanRecursively
 * @param packageClasses
 * @return self
 */
public Weld addPackages(boolean scanRecursively, Class<?>... packageClasses) {
  for (Class<?> packageClass : packageClasses) {
    addPackage(scanRecursively, packageClass);
  }
  return this;
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

/**
 * Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive.
 *
 * @param scanRecursively
 * @param packageClasses
 * @return self
 */
public Weld addPackages(boolean scanRecursively, Class<?>... packageClasses) {
  for (Class<?> packageClass : packageClasses) {
    addPackage(scanRecursively, packageClass);
  }
  return this;
}

代码示例来源:origin: weld/core

/**
 * Packages of the specified classes will be scanned and found classes will be added to the set of bean classes for the synthetic bean archive.
 *
 * @param scanRecursively
 * @param packageClasses
 * @return self
 */
public Weld addPackages(boolean scanRecursively, Class<?>... packageClasses) {
  for (Class<?> packageClass : packageClasses) {
    addPackage(scanRecursively, packageClass);
  }
  return this;
}

代码示例来源:origin: weld/weld-junit

protected void weldInit(Object testInstance, ExtensionContext context, Weld weld, WeldInitiator.Builder weldInitiatorBuilder) {
  weld.addPackage(false, testInstance.getClass());
}

代码示例来源:origin: org.jboss.weld/weld-junit5

protected void weldInit(Object testInstance, ExtensionContext context, Weld weld, WeldInitiator.Builder weldInitiatorBuilder) {
  weld.addPackage(false, testInstance.getClass());
}

代码示例来源:origin: org.jboss.weld/weld-junit5

WeldContainer initWeld(Object testInstance) {
    Weld weld = WeldInitiator.this.weld;
    if (weld == null) {
      weld = createWeld().addPackage(false, testInstance.getClass());
    }
    // this ensures the test instance is always an InjectionTarget
    instancesToInject.add(createToInject(testInstance));

    return initWeldContainer(weld);
  }
}

代码示例来源:origin: weld/weld-junit

WeldContainer initWeld(Object testInstance) {
    Weld weld = WeldInitiator.this.weld;
    if (weld == null) {
      weld = createWeld().addPackage(false, testInstance.getClass());
    }
    // this ensures the test instance is always an InjectionTarget
    instancesToInject.add(createToInject(testInstance));

    return initWeldContainer(weld);
  }
}

代码示例来源:origin: weld/weld-junit

@Override
  public void evaluate() throws Throwable {
    Weld weld = WeldInitiator.this.weld;
    if (weld == null) {
      // Null in case of fromTestPackage() is used
      weld = createWeld().addPackage(false, description.getTestClass());
    }
    initWeldContainer(weld);
    try {
      base.evaluate();
    } finally {
      shutdownWeldContainer();
    }
  }
};

代码示例来源:origin: org.jboss.weld/weld-junit5

stream(ann.value())
    .distinct()
    .forEach(cls -> weld.addPackage(ann.recursively(), cls)));

代码示例来源:origin: weld/weld-junit

stream(ann.value())
    .distinct()
    .forEach(cls -> weld.addPackage(ann.recursively(), cls)));

代码示例来源:origin: weld/weld-vertx

@Test
public void testConsumers() throws InterruptedException {
  try (WeldContainer weld = new Weld().disableDiscovery().addExtension(new VertxExtension()).addPackage(false, RegisterConsumersAfterBootstrapTest.class)
      .initialize()) {
    Vertx vertx = Vertx.vertx();
    try {
      weld.select(VertxExtension.class).get().registerConsumers(vertx, weld.event());
      vertx.eventBus().send(HelloObserver.HELLO_ADDRESS, "hello");
      assertEquals("hello", SYNCHRONIZER.poll(Timeouts.DEFAULT_TIMEOUT, TimeUnit.MILLISECONDS));
    } finally {
      vertx.close();
    }
  }
}

相关文章