本文整理汇总了Java中org.jboss.as.server.deployment.module.ModuleSpecification类的典型用法代码示例。如果您正苦于以下问题:Java ModuleSpecification类的具体用法?Java ModuleSpecification怎么用?Java ModuleSpecification使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleSpecification类属于org.jboss.as.server.deployment.module包,在下文中一共展示了ModuleSpecification类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
/**
* Add dependencies for modules required for NoSQL deployments
*/
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final Map<String, String> nosqlDriverModuleNameMap = DriverScanDependencyProcessor.getPerDeploymentDeploymentModuleName(deploymentUnit);
if (nosqlDriverModuleNameMap == null) {
return;
}
for (String nosqlDriverModuleName : nosqlDriverModuleNameMap.values()) {
if (nosqlDriverModuleName != null) {
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
addDependency(moduleSpecification, moduleLoader, ModuleIdentifier.fromString(nosqlDriverModuleName));
addMongoCDIDependency(moduleSpecification, moduleLoader, nosqlDriverModuleName);
addCassandraCDIDependency(moduleSpecification, moduleLoader, nosqlDriverModuleName);
addNeo4jCDIDependency(moduleSpecification, moduleLoader, nosqlDriverModuleName);
addOrientCDIDependency(moduleSpecification, moduleLoader, nosqlDriverModuleName);
}
}
}
示例2: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null) {
return;
}
final String deploymentName = deploymentUnit.getName();
final VirtualFile deploymentContents = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS);
// internal deployments do not have any contents, so there is nothing to mount
if (deploymentContents == null)
return;
if (deploymentName.endsWith(DYNAMIC_VDB_STRUCTURE)) {
// use the contents directly
// nothing was mounted
final ResourceRoot resourceRoot = new ResourceRoot(deploymentContents, null);
ModuleRootMarker.mark(resourceRoot);
deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, resourceRoot);
deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification());
}
}
示例3: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的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);
}
}
}
示例4: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
final ServiceModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS);
//List<VirtualFile> jars = getJarList(deploymentRoot.getRoot());
try {
processBlackList(resourceRoots);
} catch (IOException e) {
SDDLogger.ROOT_LOGGER.couldNotProcessBlacklist(e);
}
}
示例5: addDependencies
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的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));
}
}
示例6: addDependencies
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的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));
}
}
示例7: addMongoCDIDependency
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
private void addMongoCDIDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, String nosqlDriverModuleName) {
try {
moduleLoader.loadModule(ModuleIdentifier.fromString(nosqlDriverModuleName)).getClassLoader().loadClass(NoSQLConstants.MONGOCLIENTCLASS);
} catch (ClassNotFoundException expected) {
// ignore CNFE which just means that module is not a MongoDB module
return;
} catch (ModuleLoadException e) {
throw new RuntimeException("could not load NoSQL driver module " + nosqlDriverModuleName, e);
}
// only reach this point if module is a MongoDB driver
ModuleIdentifier mongoCDIExtensionModule = ModuleIdentifier.create(NoSQLConstants.MONGOCDIEXTENSIONMODULE);
addDependency(moduleSpecification, moduleLoader, mongoCDIExtensionModule);
}
示例8: addNeo4jCDIDependency
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
private void addNeo4jCDIDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, String nosqlDriverModuleName) {
try {
moduleLoader.loadModule(ModuleIdentifier.fromString(nosqlDriverModuleName)).getClassLoader().loadClass(NoSQLConstants.NEO4JDRIVERCLASS);
} catch (ClassNotFoundException expected) {
// ignore CNFE which just means that module is not a Neo4j module
return;
} catch (ModuleLoadException e) {
throw new RuntimeException("could not load NoSQL driver module " + nosqlDriverModuleName, e);
}
// only reach this point if module is a Neo4j driver
ModuleIdentifier mongoCDIExtensionModule = ModuleIdentifier.create(NoSQLConstants.NEO4JCDIEXTENSIONMODULE);
addDependency(moduleSpecification, moduleLoader, mongoCDIExtensionModule);
}
示例9: addCassandraCDIDependency
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
private void addCassandraCDIDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, String nosqlDriverModuleName) {
try {
moduleLoader.loadModule(ModuleIdentifier.fromString(nosqlDriverModuleName)).getClassLoader().loadClass(NoSQLConstants.CASSANDRACLUSTERCLASS);
} catch (ClassNotFoundException expected) {
// ignore CNFE which just means that module is not a Cassandra module
return;
} catch (ModuleLoadException e) {
throw new RuntimeException("could not load NoSQL driver module " + nosqlDriverModuleName, e);
}
// only reach this point if module is a Cassandra driver
ModuleIdentifier mongoCDIExtensionModule = ModuleIdentifier.create(NoSQLConstants.CASSANDRACDIEXTENSIONMODULE);
addDependency(moduleSpecification, moduleLoader, mongoCDIExtensionModule);
}
示例10: addOrientCDIDependency
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
private void addOrientCDIDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, String nosqlDriverModuleName) {
try {
moduleLoader.loadModule(ModuleIdentifier.fromString(nosqlDriverModuleName)).getClassLoader().loadClass(NoSQLConstants.ORIENTDBPARTIONEDDBPOOLCLASS);
} catch (ClassNotFoundException expected) {
// ignore CNFE which just means that module is not a OrientDB module
return;
} catch (ModuleLoadException e) {
throw new RuntimeException("could not load NoSQL driver module " + nosqlDriverModuleName, e);
}
// only reach this point if module is a OrientDB driver
ModuleIdentifier mongoCDIExtensionModule = ModuleIdentifier.create(NoSQLConstants.ORIENTDBCDIEXTENSIONMODULE);
addDependency(moduleSpecification, moduleLoader, mongoCDIExtensionModule);
}
示例11: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的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);
}
}
示例12: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的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));
}
示例13: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的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;
}
}
}
}
示例14: handleDeployment
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
private void handleDeployment(final DeploymentPhaseContext phaseContext, final DeploymentUnit deploymentUnit, final ModuleSpecification moduleSpec, final ModuleStructureSpec rootDeploymentSpecification, Set<ModuleIdentifier> additionalModules) throws DeploymentUnitProcessingException {
final Map<VirtualFile, ResourceRoot> resourceRoots = resourceRoots(deploymentUnit);
moduleSpec.addUserDependencies(rootDeploymentSpecification.getModuleDependencies());
moduleSpec.addExclusions(rootDeploymentSpecification.getExclusions());
moduleSpec.addAliases(rootDeploymentSpecification.getAliases());
moduleSpec.addModuleSystemDependencies(rootDeploymentSpecification.getSystemDependencies());
for (final ResourceRoot additionalResourceRoot : rootDeploymentSpecification.getResourceRoots()) {
final ResourceRoot existingRoot = resourceRoots.get(additionalResourceRoot.getRoot());
if (existingRoot != null) {
//we already have to the resource root
//so now we want to merge it
existingRoot.merge(additionalResourceRoot);
} else if (!additionalResourceRoot.getRoot().exists()) {
ServerLogger.DEPLOYMENT_LOGGER.additionalResourceRootDoesNotExist(additionalResourceRoot.getRoot().getPathName());
} else {
deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, additionalResourceRoot);
//compute the annotation index for the root
ResourceRootIndexer.indexResourceRoot(additionalResourceRoot);
ModuleRootMarker.mark(additionalResourceRoot);
}
}
for (final String classFileTransformer : rootDeploymentSpecification.getClassFileTransformers()) {
moduleSpec.addClassFileTransformer(classFileTransformer);
}
//handle annotations
for (final ModuleIdentifier dependency : rootDeploymentSpecification.getAnnotationModules()) {
deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_ANNOTATION_INDEXES, dependency);
//additional modules will not be created till much later, a dep on them would fail
if(dependency.getName().startsWith(ServiceModuleLoader.MODULE_PREFIX) && !additionalModules.contains(dependency)) {
phaseContext.addToAttachmentList(Attachments.NEXT_PHASE_DEPS, ServiceModuleLoader.moduleServiceName(dependency));
}
}
moduleSpec.setLocalLast(rootDeploymentSpecification.isLocalLast());
if(rootDeploymentSpecification.getExcludedSubsystems() != null) {
deploymentUnit.putAttachment(Attachments.EXCLUDED_SUBSYSTEMS, rootDeploymentSpecification.getExcludedSubsystems());
}
}
示例15: deploy
import org.jboss.as.server.deployment.module.ModuleSpecification; //导入依赖的package包/类
/**
* Add the dependencies if the deployment contains a service activator loader entry.
* @param phaseContext the deployment unit context
* @throws DeploymentUnitProcessingException
*/
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final ResourceRoot deploymentRoot = phaseContext.getDeploymentUnit().getAttachment(Attachments.DEPLOYMENT_ROOT);
final ModuleSpecification moduleSpecification = phaseContext.getDeploymentUnit().getAttachment(
Attachments.MODULE_SPECIFICATION);
if(deploymentRoot == null)
return;
final ServicesAttachment servicesAttachments = phaseContext.getDeploymentUnit().getAttachment(Attachments.SERVICES);
if(servicesAttachments != null && !servicesAttachments.getServiceImplementations(ServiceActivator.class.getName()).isEmpty()) {
moduleSpecification.addSystemDependency(MSC_DEP);
}
}