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

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

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

Weld.createDeployment介绍

[英]Extensions to Weld SE can subclass and override this method to customize the deployment before weld boots up. For example, to add a custom ResourceLoader, you would subclass Weld like so:

public class MyWeld extends Weld { 
protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) { 
return super.createDeployment(new MyResourceLoader(), bootstrap); 
} 
}

This could then be used as normal:

WeldContainer container = new MyWeld().initialize();

[中]Weld SE的扩展可以子类化并覆盖此方法,以便在Weld启动之前自定义部署。例如,要添加自定义ResourceLoader,您可以像这样子类Weld:

public class MyWeld extends Weld { 
protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) { 
return super.createDeployment(new MyResourceLoader(), bootstrap); 
} 
}

这样就可以正常使用:

WeldContainer container = new MyWeld().initialize();

代码示例

代码示例来源:origin: org.jboss.forge/forge-shell

@Override
  protected Deployment createDeployment(final ResourceLoader resourceLoader, final Bootstrap bootstrap)
  {
   Deployment deployment = super.createDeployment(resourceLoader, bootstrap);

   // Collection<BeanDeploymentArchive> archives = deployment.getBeanDeploymentArchives();

   return deployment;
  }
}

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

@Override
protected Deployment createDeployment(ResourceLoader resourceLoader, Bootstrap bootstrap) {
  Deployment deployment = super.createDeployment(resourceLoader, bootstrap);
  return deployment;
}

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

final Deployment deployment = createDeployment(resourceLoader, bootstrap);

代码示例来源:origin: org.switchyard.components/switchyard-component-test-mixin-cdi

Deployment deployment = super.createDeployment(filterLoader, bootstrap);
if (getTestKit() != null) {
  List<TestMixIn> mixins = getTestKit().getMixIns();

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

final Deployment deployment = createDeployment(resourceLoader, bootstrap);

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

final Deployment deployment = createDeployment(resourceLoader, bootstrap);

代码示例来源:origin: jboss-switchyard/components

Deployment deployment = super.createDeployment(filterLoader, bootstrap);
if (getTestKit() != null) {
  List<TestMixIn> mixins = getTestKit().getMixIns();

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

final Deployment deployment = createDeployment(resourceLoader, bootstrap);

代码示例来源:origin: net.unit8.weld/weld-prescan

@Override
  protected Deployment createDeployment(ResourceLoader resourceLoader, CDI11Bootstrap bootstrap) {
    Deployment deployment = super.createDeployment(resourceLoader, bootstrap);
    BeanDeploymentArchivesModel archivesModel = new BeanDeploymentArchivesModel();
    for (BeanDeploymentArchive bda : deployment.getBeanDeploymentArchives()) {
      BeanDeploymentArchiveModel model = new BeanDeploymentArchiveModel();
      model.setId(bda.getId());
      BeansXml beansXml = bda.getBeansXml();
      model.setDiscoveryMode(beansXml.getBeanDiscoveryMode());
      model.setEnabledAlternatives(StringMetadata.from(beansXml.getEnabledAlternativeClasses()));
      model.setEnabledAlternativeStereotypes(StringMetadata.from(beansXml.getEnabledAlternativeStereotypes()));
      model.setEnabledDecorators(StringMetadata.from(beansXml.getEnabledDecorators()));
      model.setEnabledInterceptors(StringMetadata.from(beansXml.getEnabledInterceptors()));
      //model.setScanning(beansXml.getScanning());
      if (beansXml.getUrl() != null)
        model.setUrl(beansXml.getUrl());
      model.setVersion(beansXml.getVersion());
      model.setBeanClasses(bda.getBeanClasses());
      archivesModel.addBeanDeploymentArchive(model);
    }
    JAXB.marshal(archivesModel, sw);
    return deployment;
  }
}.initialize();

相关文章