本文整理汇总了Java中org.jboss.as.server.deployment.AttachmentKey类的典型用法代码示例。如果您正苦于以下问题:Java AttachmentKey类的具体用法?Java AttachmentKey怎么用?Java AttachmentKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AttachmentKey类属于org.jboss.as.server.deployment包,在下文中一共展示了AttachmentKey类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerLogContext
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
private void registerLogContext(final DeploymentUnit deploymentUnit, final AttachmentKey<LogContext> attachmentKey, final Module module, final LogContext logContext) {
LoggingLogger.ROOT_LOGGER.tracef("Registering LogContext %s for deployment %s", logContext, deploymentUnit.getName());
if (WildFlySecurityManager.isChecking()) {
WildFlySecurityManager.doUnchecked(new PrivilegedAction<Object>() {
@Override
public Object run() {
logContextSelector.registerLogContext(module.getClassLoader(), logContext);
return null;
}
});
} else {
logContextSelector.registerLogContext(module.getClassLoader(), logContext);
}
// Add the log context to the sub-deployment unit for later removal
deploymentUnit.putAttachment(attachmentKey, logContext);
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:17,代码来源:AbstractLoggingDeploymentProcessor.java
示例2: unregisterLogContext
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
private void unregisterLogContext(final DeploymentUnit deploymentUnit, final AttachmentKey<LogContext> attachmentKey, final Module module) {
final LogContext logContext = deploymentUnit.removeAttachment(attachmentKey);
if (logContext != null) {
final boolean success;
if (WildFlySecurityManager.isChecking()) {
success = WildFlySecurityManager.doUnchecked(new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
return logContextSelector.unregisterLogContext(module.getClassLoader(), logContext);
}
});
} else {
success = logContextSelector.unregisterLogContext(module.getClassLoader(), logContext);
}
if (success) {
LoggingLogger.ROOT_LOGGER.tracef("Removed LogContext '%s' from '%s'", logContext, module);
} else {
LoggingLogger.ROOT_LOGGER.logContextNotRemoved(logContext, deploymentUnit.getName());
}
}
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:22,代码来源:AbstractLoggingDeploymentProcessor.java
示例3: deploy
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
VirtualFile descriptor = null;
for (final String loc : DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS) {
final VirtualFile file = root.getRoot().getChild(loc);
if (file.exists()) {
descriptor = file;
break;
}
}
if(descriptor == null) {
return;
}
final XMLMapper mapper = XMLMapper.Factory.create();
final Map<QName, AttachmentKey<?>> namespaceAttachments = new HashMap<QName, AttachmentKey<?>>();
for(final JBossAllXMLParserDescription<?> parser : deploymentUnit.getAttachmentList(JBossAllXMLParserDescription.ATTACHMENT_KEY)) {
namespaceAttachments.put(parser.getRootElement(), parser.getAttachmentKey());
mapper.registerRootElement(parser.getRootElement(), new JBossAllXMLElementReader(parser));
}
mapper.registerRootElement(new QName(Namespace.JBOSS_1_0.getUriString(), JBOSS), Parser.INSTANCE);
mapper.registerRootElement(new QName(Namespace.NONE.getUriString(), JBOSS), Parser.INSTANCE);
final JBossAllXmlParseContext context = new JBossAllXmlParseContext(deploymentUnit);
parse(descriptor, mapper, context);
//we use this map to detect the presence of two different but functionally equivalent namespaces
final Map<AttachmentKey<?>, QName> usedNamespaces = new HashMap<AttachmentKey<?>, QName>();
for(Map.Entry<QName, Object> entry : context.getParseResults().entrySet()) {
final AttachmentKey attachmentKey = namespaceAttachments.get(entry.getKey());
if(usedNamespaces.containsKey(attachmentKey)) {
throw ServerLogger.ROOT_LOGGER.equivalentNamespacesInJBossXml(entry.getKey(), usedNamespaces.get(attachmentKey));
}
usedNamespaces.put(attachmentKey, entry.getKey());
deploymentUnit.putAttachment(attachmentKey, entry.getValue());
}
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:40,代码来源:JBossAllXMLParsingProcessor.java
示例4: JBossAllXmlParserRegisteringProcessor
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
public JBossAllXmlParserRegisteringProcessor(final QName rootElement, final AttachmentKey<T> attachmentKey, final JBossAllXMLParser<T> parser) {
descriptions = Collections.singletonList(new JBossAllXMLParserDescription<T>(attachmentKey, parser, rootElement));
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:4,代码来源:JBossAllXmlParserRegisteringProcessor.java
示例5: addParser
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
public <T> Builder addParser(final QName rootElement, final AttachmentKey<T> attachmentKey, final JBossAllXMLParser<T> parser) {
descriptions.add(new JBossAllXMLParserDescription<T>(attachmentKey, parser, rootElement));
return this;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:5,代码来源:JBossAllXmlParserRegisteringProcessor.java
示例6: JBossAllXMLParserDescription
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
public JBossAllXMLParserDescription(final AttachmentKey<T> attachmentKey, final JBossAllXMLParser<T> parser, final QName rootElement) {
this.attachmentKey = attachmentKey;
this.parser = parser;
this.rootElement = rootElement;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:JBossAllXMLParserDescription.java
示例7: getAttachmentKey
import org.jboss.as.server.deployment.AttachmentKey; //导入依赖的package包/类
public AttachmentKey<T> getAttachmentKey() {
return attachmentKey;
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:4,代码来源:JBossAllXMLParserDescription.java
注:本文中的org.jboss.as.server.deployment.AttachmentKey类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论