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


Java DeploymentUnit.getName方法代码示例

本文整理汇总了Java中org.jboss.as.server.deployment.DeploymentUnit.getName方法的典型用法代码示例。如果您正苦于以下问题:Java DeploymentUnit.getName方法的具体用法?Java DeploymentUnit.getName怎么用?Java DeploymentUnit.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jboss.as.server.deployment.DeploymentUnit的用法示例。


在下文中一共展示了DeploymentUnit.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deploy

import org.jboss.as.server.deployment.DeploymentUnit; //导入方法依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    String deploymentName = deploymentUnit.getName();

    if (deploymentUnit.getParent() != null) {
        deploymentName = deploymentUnit.getParent().getName();
    }

    if (deploymentName.equals(filename)) {
        long before = System.currentTimeMillis();
        try {
            processAnnotationIndex(deploymentUnit);
        } catch (Exception e) {
            throw new DeploymentUnitProcessingException(e);
        }
        long duration = System.currentTimeMillis() - before;
        DbBootstrapLogger.ROOT_LOGGER.infof("Database bootstrapping took [%s] ms", duration);
    } else {
        DbBootstrapLogger.ROOT_LOGGER.tracef("%s did not match %s", filename, deploymentName);
    }
}
 
开发者ID:wildfly-extras,项目名称:db-bootstrap,代码行数:23,代码来源:DbBootstrapScanDetectorProcessor.java

示例2: deploy

import org.jboss.as.server.deployment.DeploymentUnit; //导入方法依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext)  throws DeploymentUnitProcessingException {
	
       DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
       
       String deploymentName = deploymentUnit.getName();
       VirtualFile file = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
       if (file == null) {
       	return;
       }
       
       if(deploymentName.endsWith(VDB_EXTENSION)) {
		VirtualFile metainf = file.getChild("META-INF"); //$NON-NLS-1$
		if (metainf == null) {
			return;
		}
		
		if (metainf.getChild(VDBResources.DEPLOYMENT_FILE) == null) {
			return;
		}
		// adds a TYPE attachment.
		TeiidAttachments.setAsVDBDeployment(deploymentUnit);
       }
       else if (deploymentName.endsWith(DYNAMIC_VDB_STRUCTURE)) {
        TeiidAttachments.setAsVDBXMLDeployment(deploymentUnit);			        	
       }
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:28,代码来源:VDBStructureDeployer.java

示例3: deploy

import org.jboss.as.server.deployment.DeploymentUnit; //导入方法依赖的package包/类
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ServiceTarget target = phaseContext.getServiceTarget();
    
    if (!TeiidAttachments.isTranslator(deploymentUnit)) {
    	return;
    }
    
    String moduleName = deploymentUnit.getName();
    final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
    ClassLoader translatorLoader =  module.getClassLoader();
    
    final ServiceLoader<ExecutionFactory> serviceLoader =  ServiceLoader.load(ExecutionFactory.class, translatorLoader);
    if (serviceLoader != null) {
    	for (ExecutionFactory ef:serviceLoader) {
    		VDBTranslatorMetaData metadata = TranslatorUtil.buildTranslatorMetadata(ef, moduleName);        		
    		if (metadata == null) {
    			throw new DeploymentUnitProcessingException(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50070, moduleName)); 
    		}
    		deploymentUnit.putAttachment(TeiidAttachments.TRANSLATOR_METADATA, metadata);
    		metadata.addProperty(TranslatorUtil.DEPLOYMENT_NAME, moduleName);
    		metadata.addAttchment(ClassLoader.class, translatorLoader);
    		
    		LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50006, metadata.getName()));
    		
    		buildService(target, metadata);
    	}
    }
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:31,代码来源:TranslatorDeployer.java

示例4: deploy

import org.jboss.as.server.deployment.DeploymentUnit; //导入方法依赖的package包/类
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
    final VirtualFile switchyardXml;
    
    if (DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) {
        // switchyard.xml file located in /WEB-INF
        final VirtualFile warSwitchYardXml = deploymentRoot.getRoot().getChild(SWITCHYARD_XML_WAR);
        if (warSwitchYardXml.exists()) {
            switchyardXml = warSwitchYardXml;
        } else {
            // fall back to original location
            switchyardXml = deploymentRoot.getRoot().getChild(SWITCHYARD_XML);
        }
    } else {
        switchyardXml = deploymentRoot.getRoot().getChild(SWITCHYARD_XML);
    }

    if (!switchyardXml.exists()) {
        return;
    }
    final String archiveName = deploymentUnit.getName();
    final String deploymentName = archiveName.substring(0, archiveName.lastIndexOf('.'));
    final SwitchYardMetaData switchYardMetaData = new SwitchYardMetaData(archiveName, deploymentName);
    switchYardMetaData.setSwitchYardFile(switchyardXml);

    deploymentUnit.putAttachment(SwitchYardMetaData.ATTACHMENT_KEY, switchYardMetaData);
    SwitchYardDeploymentMarker.mark(deploymentUnit);
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:31,代码来源:SwitchYardConfigDeploymentProcessor.java

示例5: createDeploymentUnitName

import org.jboss.as.server.deployment.DeploymentUnit; //导入方法依赖的package包/类
private static String createDeploymentUnitName(DeploymentUnit depUnit) {
    String depUnitName = depUnit.getName();
    DeploymentUnit parent;
    if((parent = depUnit.getParent()) != null) {
        depUnitName = parent.getName() + "." + depUnitName;
    }
    return depUnitName;
}
 
开发者ID:wildfly,项目名称:wildfly-arquillian,代码行数:9,代码来源:ArquillianConfigBuilder.java

示例6: deploy

import org.jboss.as.server.deployment.DeploymentUnit; //导入方法依赖的package包/类
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    if(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null) {
        return;
    }
    final DeploymentMountProvider deploymentMountProvider = deploymentUnit.getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
    if(deploymentMountProvider == null) {
        throw ServerLogger.ROOT_LOGGER.noDeploymentRepositoryAvailable();
    }

    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;

    final VirtualFile deploymentRoot;
    final MountHandle mountHandle;
    if (deploymentContents.isDirectory()) {
        // use the contents directly
        deploymentRoot = deploymentContents;
        // nothing was mounted
        mountHandle = null;
        ExplodedDeploymentMarker.markAsExplodedDeployment(deploymentUnit);

    } else {
        // The mount point we will use for the repository file
        deploymentRoot = VFS.getChild("content/" + deploymentName);

        boolean failed = false;
        Closeable handle = null;
        try {
            final boolean mountExploded = MountExplodedMarker.isMountExploded(deploymentUnit);
            final MountType type;
            if(mountExploded) {
                type = MountType.EXPANDED;
            } else if (deploymentName.endsWith(".xml")) {
                type = MountType.REAL;
            } else {
                type = MountType.ZIP;
            }
            handle = deploymentMountProvider.mountDeploymentContent(deploymentContents, deploymentRoot, type);
            mountHandle = new MountHandle(handle);
        } catch (IOException e) {
            failed = true;
            throw ServerLogger.ROOT_LOGGER.deploymentMountFailed(e);
        } finally {
            if(failed) {
                VFSUtils.safeClose(handle);
            }
        }
    }
    final ResourceRoot resourceRoot = new ResourceRoot(deploymentRoot, mountHandle);
    ModuleRootMarker.mark(resourceRoot);
    deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, resourceRoot);
    deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification());
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:59,代码来源:DeploymentRootMountProcessor.java


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