当前位置: 首页>>代码示例>>Java>>正文


Java ModuleDependency类代码示例

本文整理汇总了Java中org.jboss.as.server.deployment.module.ModuleDependency的典型用法代码示例。如果您正苦于以下问题:Java ModuleDependency类的具体用法?Java ModuleDependency怎么用?Java ModuleDependency使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ModuleDependency类属于org.jboss.as.server.deployment.module包,在下文中一共展示了ModuleDependency类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deploy

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    // Add the logging modules
    for (ModuleIdentifier moduleId : LOGGING_MODULES) {
        try {
            LoggingLogger.ROOT_LOGGER.tracef("Adding module '%s' to deployment '%s'", moduleId, deploymentUnit.getName());
            moduleLoader.loadModule(moduleId);
            moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleId, false, false, false, false));
        } catch (ModuleLoadException ex) {
            LoggingLogger.ROOT_LOGGER.debugf("Module not found: %s", moduleId);
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:LoggingDependencyDeploymentProcessor.java

示例2: install

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
public static ServiceName install(final ServiceTarget target, final ModuleIdentifier identifier, final List<ModuleDependency> dependencies) {
    final ModuleLoadService service = new ModuleLoadService(dependencies);
    final ServiceName serviceName = ServiceModuleLoader.moduleServiceName(identifier);
    final ServiceBuilder<Module> builder = target.addService(serviceName, service);
    builder.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ServiceModuleLoader.class, service.getServiceModuleLoader());
    builder.addDependency(ServiceModuleLoader.moduleSpecServiceName(identifier), ModuleDefinition.class, service.getModuleDefinitionInjectedValue());
    builder.addDependency(ServiceModuleLoader.moduleResolvedServiceName(identifier)); //don't attempt to load until all dependent module specs are up, even transitive ones

    for (ModuleDependency dependency : dependencies) {
        final ModuleIdentifier moduleIdentifier = dependency.getIdentifier();
        if (moduleIdentifier.getName().startsWith(ServiceModuleLoader.MODULE_PREFIX)) {
            builder.addDependency(dependency.isOptional() ? OPTIONAL : REQUIRED, ServiceModuleLoader.moduleSpecServiceName(moduleIdentifier));
        }
    }
    builder.setInitialMode(Mode.ON_DEMAND);
    builder.install();
    return serviceName;
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:ModuleLoadService.java

示例3: start

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
@Override
public synchronized void start(StartContext context) throws StartException {
    try {
        this.jarFile = new JarFile(file);
    } catch (IOException e) {
        throw new StartException(e);
    }
    final ModuleSpec.Builder specBuilder = ModuleSpec.build(moduleIdentifier);
    addResourceRoot(specBuilder, jarFile);
    //TODO: We need some way of configuring module dependencies for external archives
    ModuleIdentifier javaee = ModuleIdentifier.create("javaee.api");
    specBuilder.addDependency(DependencySpec.createModuleDependencySpec(javaee));
    specBuilder.addDependency(DependencySpec.createLocalDependencySpec());
    // TODO: external resource need some kind of dependency mechanism
    ModuleSpec moduleSpec = specBuilder.create();
    this.moduleDefinition = new ModuleDefinition(moduleIdentifier, Collections.<ModuleDependency>emptySet(), moduleSpec);


    ServiceModuleLoader.installModuleResolvedService(context.getChildTarget(), moduleIdentifier);

}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:ExternalModuleSpecService.java

示例4: start

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
@Override
public void start(final StartContext startContext) throws StartException {
    Set<ModuleDependency> nextPhaseIdentifiers = new HashSet<>();
    final Set<ModuleIdentifier> nextAlreadySeen = new HashSet<>(alreadyResolvedModules);
    for (final ModuleDefinition spec : moduleSpecs) {
        if (spec != null) { //this can happen for optional dependencies
            for (ModuleDependency dep : spec.getDependencies()) {
                if (ServiceModuleLoader.isDynamicModule(dep.getIdentifier())) {
                    if (!alreadyResolvedModules.contains(dep.getIdentifier())) {
                        nextAlreadySeen.add(dep.getIdentifier());
                        nextPhaseIdentifiers.add(dep);
                    }
                }
            }
        }
    }
    if (nextPhaseIdentifiers.isEmpty()) {
        ServiceModuleLoader.installModuleResolvedService(startContext.getChildTarget(), moduleIdentifier);
    } else {
        installService(startContext.getChildTarget(), moduleIdentifier, phaseNumber + 1, nextPhaseIdentifiers, nextAlreadySeen);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:23,代码来源:ModuleResolvePhaseService.java

示例5: installService

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
private static void installService(final ServiceTarget serviceTarget, final ModuleIdentifier moduleIdentifier, int phaseNumber, final Set<ModuleDependency> nextPhaseIdentifiers, final Set<ModuleIdentifier> nextAlreadySeen) {
    final ModuleResolvePhaseService nextPhaseService = new ModuleResolvePhaseService(moduleIdentifier, nextAlreadySeen, phaseNumber);
    ServiceBuilder<ModuleResolvePhaseService> builder = serviceTarget.addService(moduleSpecServiceName(moduleIdentifier, phaseNumber), nextPhaseService);
    for (ModuleDependency module : nextPhaseIdentifiers) {
        builder.addDependency(module.isOptional() ? OPTIONAL : REQUIRED, ServiceModuleLoader.moduleSpecServiceName(module.getIdentifier()), ModuleDefinition.class, new Injector<ModuleDefinition>() {

            ModuleDefinition definition;

            @Override
            public synchronized void inject(final ModuleDefinition o) throws InjectionException {
                nextPhaseService.getModuleSpecs().add(o);
                this.definition = o;
            }

            @Override
            public synchronized void uninject() {
                nextPhaseService.getModuleSpecs().remove(definition);
                this.definition = null;
            }
        });
    }
    builder.install();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:ModuleResolvePhaseService.java

示例6: addDependencies

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
private void addDependencies(DeploymentUnit deploymentUnit) {
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();

    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MICROPROFILE_CONFIG_API, false, false, true, false));

    if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MICROPROFILE_CONFIG_EXTENSION, false, false, true, false));
    }
}
 
开发者ID:wildfly-extras,项目名称:wildfly-microprofile-config,代码行数:11,代码来源:DependencyProcessor.java

示例7: addDependencies

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
private void addDependencies(DeploymentUnit deploymentUnit) {
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();

    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MICROPROFILE_HEALTH_API, false, false, true, false));

    if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MICROPROFILE_HEALTH_EXTENSION, false, false, true, false));
    }
}
 
开发者ID:jmesnil,项目名称:wildfly-microprofile-health,代码行数:11,代码来源:DependencyProcessor.java

示例8: deploy

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
	DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
       try {
		final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
		final ModuleLoader moduleLoader = Module.getCallerModule().getModule(ModuleIdentifier.create("org.jboss.teiid")).getModuleLoader(); //$NON-NLS-1$
		moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.api"), false, false, false, false)); //$NON-NLS-1$
		moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.common-core"), false, false, false, false)); //$NON-NLS-1$
		moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("javax.api"), false, false, false, false)); //$NON-NLS-1$
		moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("javax.resource.api"), false, false, false, false)); //$NON-NLS-1$
	} catch (ModuleLoadException e) {
		throw new DeploymentUnitProcessingException(e);
	}	
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:15,代码来源:TranslatorDependencyDeployer.java

示例9: deploy

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = context.getDeploymentUnit();
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();

    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, elytronIdentifier, false, false, true, false));
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:9,代码来源:DependencyProcessor.java

示例10: deploy

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    if (deploymentUnit.getParent() != null) {
        return;
    }

    final List<DeploymentUnit> deploymentUnits = new ArrayList<DeploymentUnit>();
    deploymentUnits.add(deploymentUnit);
    deploymentUnits.addAll(deploymentUnit.getAttachmentList(Attachments.SUB_DEPLOYMENTS));

    for (DeploymentUnit unit : deploymentUnits) {

        final ResourceRoot mainRoot = unit.getAttachment(Attachments.DEPLOYMENT_ROOT);
        if (mainRoot == null)
            continue;

        VirtualFile root = mainRoot.getRoot();
        for (String path : SEAM_FILES) {
            if (root.getChild(path).exists()) {
                final ModuleSpecification moduleSpecification = deploymentUnit
                        .getAttachment(Attachments.MODULE_SPECIFICATION);
                final ModuleLoader moduleLoader = Module.getBootModuleLoader();
                moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, VFS_MODULE, false, false, false,
                        false)); // for VFS scanner

                try {
                    ResourceLoader resourceLoader = ResourceLoaders.createJarResourceLoader(SEAM_INT_JAR, new JarFile(
                            getSeamIntResourceRoot().getRoot().getPathName()));
                    moduleSpecification.addResourceLoader(ResourceLoaderSpec.createResourceLoaderSpec(resourceLoader));
                } catch (Exception e) {
                    throw new DeploymentUnitProcessingException(e);
                }

                unit.addToAttachmentList(Attachments.RESOURCE_ROOTS, getSeamIntResourceRoot());
                return;
            }
        }
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:40,代码来源:Seam2Processor.java

示例11: start

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
@Override
public synchronized void start(StartContext context) throws StartException {
    try {
        final ServiceModuleLoader moduleLoader = serviceModuleLoader.getValue();
        final Module module = moduleLoader.loadModule(moduleDefinitionInjectedValue.getValue().getModuleIdentifier());
        moduleLoader.relinkModule(module);
        for (ModuleDependency dependency : dependencies) {
            if (dependency.isUserSpecified()) {
                final ModuleIdentifier id = dependency.getIdentifier();
                try {
                    String val = moduleLoader.loadModule(id).getProperty("jboss.api");
                    if (val != null) {
                        if (val.equals("private")) {
                            ServerLogger.PRIVATE_DEP_LOGGER.privateApiUsed(moduleDefinitionInjectedValue.getValue().getModuleIdentifier().getName(), id);
                        } else if (val.equals("unsupported")) {
                            ServerLogger.UNSUPPORTED_DEP_LOGGER.unsupportedApiUsed(moduleDefinitionInjectedValue.getValue().getModuleIdentifier().getName(), id);
                        } else if (val.equals("deprecated")) {
                            ServerLogger.DEPRECATED_DEP_LOGGER.deprecatedApiUsed(moduleDefinitionInjectedValue.getValue().getModuleIdentifier().getName(), id);
                        }
                    }
                } catch (ModuleNotFoundException ignore) {
                    //can happen with optional dependencies
                }
            }
        }
        this.module = module;
    } catch (ModuleLoadException e) {
        throw ServerLogger.ROOT_LOGGER.failedToLoadModule(moduleDefinitionInjectedValue.getValue().getModuleIdentifier(), e);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:31,代码来源:ModuleLoadService.java

示例12: installService

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
public static ServiceName installService(final ServiceTarget target, final ModuleIdentifier identifier, final List<ModuleIdentifier> identifiers) {
    final ArrayList<ModuleDependency> dependencies = new ArrayList<ModuleDependency>(identifiers.size());
    for (final ModuleIdentifier i : identifiers) {
        dependencies.add(new ModuleDependency(null, i, false, false, false, false));
    }
    return install(target, identifier, dependencies);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:ModuleLoadService.java

示例13: addDependency

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
private void addDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader,
                           ModuleIdentifier... moduleIdentifiers) {
    for (ModuleIdentifier moduleIdentifier : moduleIdentifiers) {
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, false, false, true, false));
    }
}
 
开发者ID:wildfly,项目名称:wildfly-nosql,代码行数:7,代码来源:DriverDependencyProcessor.java

示例14: deploy

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
/**
 * Add dependencies for modules required for metric deployments
 *
 */
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();

//    ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
    //   final VirtualFile rootBeansXml = deploymentRoot.getRoot().getChild("META-INF/beans.xml");
    //   final boolean rootBeansXmlPresent = rootBeansXml.exists() && rootBeansXml.isFile();
    //   System.out.println("rootBeansXmlPresent " + rootBeansXmlPresent);
/*    Map<ResourceRoot, ExplicitBeanArchiveMetadata> beanArchiveMetadata = new HashMap<>();
     PropertyReplacingBeansXmlParser parser = new PropertyReplacingBeansXmlParser(deploymentUnit);

     ResourceRoot classesRoot = null;
     List<ResourceRoot> structure = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS);
     for (ResourceRoot resourceRoot : structure) {
     if (ModuleRootMarker.isModuleRoot(resourceRoot) && !SubDeploymentMarker.isSubDeployment(resourceRoot)) {
     if (resourceRoot.getRootName().equals("classes")) {
     // hack for dealing with war modules
     classesRoot = resourceRoot;
     deploymentUnit.putAttachment(WeldAttachments.CLASSES_RESOURCE_ROOT, resourceRoot);
     } else {
     VirtualFile beansXml = resourceRoot.getRoot().getChild("META-INF/beans.xml");
     if (beansXml.exists() && beansXml.isFile()) {
     System.out.println("rootBeansXmlPresent found");
     beanArchiveMetadata.put(resourceRoot, new ExplicitBeanArchiveMetadata(beansXml, resourceRoot, parseBeansXml(beansXml, parser, deploymentUnit), false));
     }
     }
     }
     }
     */
    //   BeansXml beansXml = deployment.getBeanDeploymentArchive().getBeansXml();
    if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
        return; // Skip if there are no beans.xml files in the deployment
    }

    ModuleDependency dep = new ModuleDependency(moduleLoader, ORG_JAM_METRICS, false, false, true, false);
    dep.addImportFilter(PathFilters.getMetaInfFilter(), true);
    dep.addExportFilter(PathFilters.getMetaInfFilter(), true);
    moduleSpecification.addSystemDependency(dep);

    ModuleDependency dep2 = new ModuleDependency(moduleLoader, ORG_JAM_METRICS_API, false, false, true, false);
    dep2.addImportFilter(PathFilters.getMetaInfFilter(), true);
    dep2.addExportFilter(PathFilters.getMetaInfFilter(), true);
    moduleSpecification.addSystemDependency(dep2);

    ModuleDependency dep3 = new ModuleDependency(moduleLoader, ORG_JAM_METRICS_PROPERTIES, false, false, true, false);
    dep3.addImportFilter(PathFilters.getMetaInfFilter(), true);
    dep3.addExportFilter(PathFilters.getMetaInfFilter(), true);
    moduleSpecification.addSystemDependency(dep3);

    ModuleDependency dep4 = new ModuleDependency(moduleLoader, ORG_JAM_METRICS_LIBRARY, false, false, true, false);
    dep4.addImportFilter(PathFilters.getMetaInfFilter(), true);
    dep4.addExportFilter(PathFilters.getMetaInfFilter(), true);
    moduleSpecification.addSystemDependency(dep4);

    ModuleDependency dep5 = new ModuleDependency(moduleLoader, ORG_JAM_METRICS_LIBRARY2, false, false, true, false);
    dep5.addImportFilter(PathFilters.getMetaInfFilter(), true);
    dep5.addExportFilter(PathFilters.getMetaInfFilter(), true);
    moduleSpecification.addSystemDependency(dep5);
}
 
开发者ID:panossot,项目名称:jam-metrics,代码行数:66,代码来源:JamMetricsDependencyProcessor.java

示例15: addDependency

import org.jboss.as.server.deployment.module.ModuleDependency; //导入依赖的package包/类
private void addDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader,
        ModuleIdentifier moduleIdentifier) {
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, false, false, true, false));
}
 
开发者ID:panossot,项目名称:jam-metrics,代码行数:5,代码来源:JamMetricsDependencyProcessor.java


注:本文中的org.jboss.as.server.deployment.module.ModuleDependency类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。