本文整理汇总了Java中org.jboss.as.server.deployment.DeploymentUnitProcessingException类的典型用法代码示例。如果您正苦于以下问题:Java DeploymentUnitProcessingException类的具体用法?Java DeploymentUnitProcessingException怎么用?Java DeploymentUnitProcessingException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeploymentUnitProcessingException类属于org.jboss.as.server.deployment包,在下文中一共展示了DeploymentUnitProcessingException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
Module module = deploymentUnit.getAttachment(Attachments.MODULE);
WildFlyConfigBuilder builder = new WildFlyConfigBuilder();
builder.forClassLoader(module.getClassLoader())
.addDefaultSources()
.addDiscoveredSources()
.addDiscoveredConverters();
addConfigSourcesFromServices(builder, phaseContext.getServiceRegistry(), module.getClassLoader());
Config config = builder.build();
WildFlyConfigProviderResolver.INSTANCE.registerConfig(config, module.getClassLoader());
if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
WeldPortableExtensions extensions = WeldPortableExtensions.getPortableExtensions(deploymentUnit);
extensions.registerExtensionInstance(new ConfigExtension(), deploymentUnit);
}
}
开发者ID:wildfly-extras,项目名称:wildfly-microprofile-config,代码行数:22,代码来源:SubsystemDeploymentProcessor.java
示例2: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的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);
}
}
}
示例3: processMethodResource
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
protected void processMethodResource(final DeploymentUnit deploymentUnit, final MethodInfo methodInfo, final String lookup) throws DeploymentUnitProcessingException {
SubsystemService service = getService();
String moduleName = getService().moduleNameFromJndi(lookup);
if (moduleName != null) {
savePerDeploymentModuleName(deploymentUnit, moduleName, service.vendorKey());
ROOT_LOGGER.scannedResourceLookup(lookup, moduleName);
} else {
ROOT_LOGGER.ignoringResourceLookup(lookup, getService().jndiNames());
}
}
示例4: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (TeiidAttachments.isTranslator(deploymentUnit)) {
return;
}
List<ResourceRoot> resourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit);
for (ResourceRoot resourceRoot : resourceRoots) {
final VirtualFile deploymentRoot = resourceRoot.getRoot();
if (deploymentRoot.getChild("META-INF/services/org.teiid.translator.ExecutionFactory").exists()) { //$NON-NLS-1$
TeiidAttachments.setAsTranslatorDeployment(deploymentUnit);
//deploymentUnit.putAttachment(Attachments.IGNORE_OSGI, Boolean.TRUE);
break;
}
}
}
示例5: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (!SwitchYardDeploymentMarker.isSwitchYardDeployment(deploymentUnit)) {
return;
}
final DeploymentUnit parent = deploymentUnit.getParent();
Boolean initializeInOrder = false;
if (parent != null) {
final EarMetaData earConfig = deploymentUnit.getParent().getAttachment(org.jboss.as.ee.structure.Attachments.EAR_METADATA);
if (earConfig != null) {
initializeInOrder = earConfig.getInitializeInOrder();
}
}
doDeploy(phaseContext, deploymentUnit, initializeInOrder);
}
示例6: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (!SwitchYardDeploymentMarker.isSwitchYardDeployment(deploymentUnit)) {
return;
}
if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
// Add the Weld portable extension
final DeploymentUnit parent = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
synchronized (parent) {
checkExtension(SWITCHYARD_CDI_EXTENSION, deploymentUnit, parent);
checkExtension(DELTASPIKE_CDI_EXTENSION, deploymentUnit, parent);
}
} else {
_logger.debug("SwitchYard Application for deployment unit '" + deploymentUnit.getName() + "' does not appear to contain CDI Beans "
+ "(no META-INF/beans.xml file in unit). Not attaching SwitchYard CDI Discovery Extension to deployment.");
}
}
示例7: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public final void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// If the log context is already defined, skip the rest of the processing
if (!hasRegisteredLogContext(deploymentUnit)) {
if (deploymentUnit.hasAttachment(Attachments.MODULE) && deploymentUnit.hasAttachment(Attachments.DEPLOYMENT_ROOT)) {
// don't process sub-deployments as they are processed by processing methods
final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
if (SubDeploymentMarker.isSubDeployment(root)) return;
processDeployment(phaseContext, deploymentUnit, root);
// If we still don't have a context registered on the root deployment, register the current context.
// This is done to avoid any logging from the root deployment to have access to a sub-deployments log
// context. For example any library logging from a EAR/lib should use the EAR's configured log context,
// not a log context from a WAR or EJB library.
if (!hasRegisteredLogContext(deploymentUnit) && !deploymentUnit.hasAttachment(DEFAULT_LOG_CONTEXT_KEY)) {
// Register the current log context as this could be an embedded server or overridden another way
registerLogContext(deploymentUnit, DEFAULT_LOG_CONTEXT_KEY, deploymentUnit.getAttachment(Attachments.MODULE), LogContext.getLogContext());
}
}
}
}
示例8: findConfigFile
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
/**
* Finds the configuration file to be used and returns the first one found.
* <p/>
* Preference is for {@literal logging.properties} or {@literal jboss-logging.properties}.
*
* @param file the file to check
*
* @return the configuration file if found, otherwise {@code null}
*
* @throws DeploymentUnitProcessingException if an error occurs.
*/
private VirtualFile findConfigFile(final VirtualFile file) throws DeploymentUnitProcessingException {
VirtualFile result = null;
try {
final List<VirtualFile> configFiles = file.getChildren(ConfigFilter.INSTANCE);
for (final VirtualFile configFile : configFiles) {
final String fileName = configFile.getName();
if (DEFAULT_PROPERTIES.equals(fileName) || JBOSS_PROPERTIES.equals(fileName)) {
if (result != null) {
LoggingLogger.ROOT_LOGGER.debugf("The previously found configuration file '%s' is being ignored in favour of '%s'", result, configFile);
}
return configFile;
} else if (LOG4J_PROPERTIES.equals(fileName) || LOG4J_XML.equals(fileName) || JBOSS_LOG4J_XML.equals(fileName)) {
result = configFile;
}
}
} catch (IOException e) {
throw LoggingLogger.ROOT_LOGGER.errorProcessingLoggingConfiguration(e);
}
return result;
}
示例9: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的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);
}
}
}
示例10: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final List<PermissionFactory> permissionFactories = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION).getPermissionFactories();
final StringBuilder failedPermissions = new StringBuilder();
for (PermissionFactory factory : permissionFactories) {
// all permissions granted internally by the container are of type ImmediatePermissionFactory - they should
// not be considered when validating the permissions granted to deployments via subsystem or deployment
// descriptors.
if (!(factory instanceof ImmediatePermissionFactory)) {
Permission permission = factory.construct();
boolean implied = this.maxPermissions.implies(permission);
if (!implied) {
failedPermissions.append("\n\t\t" + permission);
}
}
}
if (failedPermissions.length() > 0) {
throw SecurityManagerLogger.ROOT_LOGGER.invalidDeploymentConfiguration(failedPermissions);
}
}
示例11: handlingExistingClassPathEntry
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
private void handlingExistingClassPathEntry(final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException {
if (existingAccessibleRoots.contains(classPathFile)) {
ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot());
} else if (additionalModules.containsKey(classPathFile)) {
final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile);
//as class path entries are exported, transitive dependencies will also be available
target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier());
} else if (subDeployments.containsKey(classPathFile)) {
//now we need to calculate the sub deployment module identifier
//unfortunately the sub deployment has not been setup yet, so we cannot just
//get it from the sub deployment directly
final ResourceRoot otherRoot = subDeployments.get(classPathFile);
target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false));
} else {
ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots);
target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier);
}
}
示例12: createResourceRoot
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
/**
* Creates a {@link ResourceRoot} for the passed {@link VirtualFile file} and adds it to the list of {@link ResourceRoot}s
* in the {@link DeploymentUnit deploymentUnit}
*
*
* @param file The file for which the resource root will be created
* @return Returns the created {@link ResourceRoot}
* @throws java.io.IOException
*/
private synchronized ResourceRoot createResourceRoot(final VirtualFile file, final DeploymentUnit deploymentUnit, final VirtualFile deploymentRoot) throws DeploymentUnitProcessingException {
try {
Map<String, MountedDeploymentOverlay> overlays = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_OVERLAY_LOCATIONS);
String relativeName = file.getPathNameRelativeTo(deploymentRoot);
MountedDeploymentOverlay overlay = overlays.get(relativeName);
Closeable closable = null;
if(overlay != null) {
overlay.remountAsZip(false);
} else if(file.isFile()) {
closable = VFS.mountZip(file, file, TempFileProviderService.provider());
}
final MountHandle mountHandle = new MountHandle(closable);
final ResourceRoot resourceRoot = new ResourceRoot(file, mountHandle);
ModuleRootMarker.mark(resourceRoot);
ResourceRootIndexer.indexResourceRoot(resourceRoot);
return resourceRoot;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
示例13: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的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();
if (deploymentUnit.hasAttachment(Attachments.RESOURCE_ROOTS)) {
final List<ResourceRoot> resourceRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS);
for (ResourceRoot root : resourceRoots) {
VirtualFile child = root.getRoot().getChild(SERVICE_FILE_NAME);
if (child.exists()) {
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JTA, false, false, false, false));
break;
}
}
}
}
示例14: deploy
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleSpecification moduleSpec = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE_SPECIFICATION);
final Map<ModuleIdentifier, DeploymentUnit> deployments = new HashMap<ModuleIdentifier, DeploymentUnit>();
//local classes are always first
deploymentUnit.addToAttachmentList(Attachments.ACCESSIBLE_SUB_DEPLOYMENTS, deploymentUnit);
buildModuleMap(deploymentUnit, deployments);
for (final ModuleDependency dependency : moduleSpec.getAllDependencies()) {
final DeploymentUnit sub = deployments.get(dependency.getIdentifier());
if (sub != null) {
deploymentUnit.addToAttachmentList(Attachments.ACCESSIBLE_SUB_DEPLOYMENTS, sub);
}
}
}
示例15: parse
import org.jboss.as.server.deployment.DeploymentUnitProcessingException; //导入依赖的package包/类
private ParseResult parse(final InputStream source, final File file, final DeploymentUnit deploymentUnit, final ModuleLoader moduleLoader)
throws DeploymentUnitProcessingException {
try {
final XMLInputFactory inputFactory = INPUT_FACTORY;
setIfSupported(inputFactory, XMLInputFactory.IS_VALIDATING, Boolean.FALSE);
setIfSupported(inputFactory, XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
final XMLStreamReader streamReader = inputFactory.createXMLStreamReader(source);
try {
final ParseResult result = new ParseResult(moduleLoader, deploymentUnit);
mapper.parseDocument(result, streamReader);
return result;
} finally {
safeClose(streamReader);
}
} catch (XMLStreamException e) {
throw ServerLogger.ROOT_LOGGER.errorLoadingDeploymentStructureFile(file.getPath(), e);
}
}