public void deploy(VFSDeploymentUnit unit, JBossWebMetaData deployment) throws DeploymentException { VirtualFile facesConfigXml = unit.getMetaDataFile("faces-config.xml"); if (facesConfigXml != null) { // TODO - Pete or Stan } } }
public VirtualFile getMetaDataFile(String name, MetaDataTypeFilter filter) { return delegate.getMetaDataFile(name, filter); }
public static boolean isEJBDeployment(VFSDeploymentUnit du) { // TODO: this is temporary EJB3 logic Boolean ignoreMe = du.getAttachment(IGNORE_ME_NAME, Boolean.class); if(ignoreMe != null && ignoreMe) return false; boolean ejbxml = du.getMetaDataFile("ejb-jar.xml") != null; boolean jbossxml = du.getMetaDataFile("jboss.xml") != null; return ejbxml || jbossxml; }
private UnifiedVirtualFile getWebservicesFile(DeploymentUnit unit) { VirtualFile vf = ((VFSDeploymentUnit)unit).getMetaDataFile("webservices.xml"); return (vf != null ? new VirtualFileAdaptor(vf) : null); } }
private UnifiedVirtualFile getWebservicesFile(DeploymentUnit unit) { UnifiedVirtualFile wsFile = null; if (unit instanceof VFSDeploymentUnit) { VirtualFile vf = ((VFSDeploymentUnit)unit).getMetaDataFile("webservices.xml"); wsFile = vf != null ? new VirtualFileAdaptor(vf) : null; } return wsFile; } }
private UnifiedVirtualFile getWebservicesFile(DeploymentUnit unit) { UnifiedVirtualFile wsFile = null; if (unit instanceof VFSDeploymentUnit) { VirtualFile vf = ((VFSDeploymentUnit)unit).getMetaDataFile("webservices.xml"); wsFile = vf != null ? new VirtualFileAdaptor(vf) : null; } return wsFile; } }
private UnifiedVirtualFile getWebservicesFile(DeploymentUnit unit) { UnifiedVirtualFile wsFile = null; if (unit instanceof VFSDeploymentUnit) { VirtualFile vf = ((VFSDeploymentUnit)unit).getMetaDataFile("webservices.xml"); wsFile = vf != null ? new VirtualFileAdaptor(vf) : null; } return wsFile; } }
URL extractDescriptorUrl(String resource) { try { VirtualFile vf = unit.getMetaDataFile(resource); if (vf == null) return null; return vf.toURL(); } catch (Exception e) { throw new RuntimeException(e); } }
private String getMainClassName(VFSDeploymentUnit unit) throws IOException { VirtualFile file = unit.getMetaDataFile("MANIFEST.MF"); log.trace("parsing " + file); if(file == null) { return null; } Manifest mf = VFSUtils.readManifest(file); Attributes attrs = mf.getMainAttributes(); String className = attrs.getValue(Attributes.Name.MAIN_CLASS); return className; }
public org.jboss.ejb3.vfs.spi.VirtualFile getMetaDataFile(String name) { return new VirtualFileWrapper(unit.getMetaDataFile(name)); }
private UnifiedVirtualFile getWebservicesFile(DeploymentUnit unit) { UnifiedVirtualFile wsFile = null; if (unit instanceof VFSDeploymentUnit) { VirtualFile vf = ((VFSDeploymentUnit)unit).getMetaDataFile("webservices.xml"); wsFile = vf != null ? new VirtualFileAdaptor(vf) : null; } return wsFile; } }
protected boolean isIntegrationDeployment(VFSDeploymentUnit unit) { String[] files = getFiles(); if (files == null || files.length == 0) return false; for(String file : files) { VirtualFile vf = unit.getMetaDataFile(file); if (vf != null) return true; } return false; } }
protected String getMainClassName(VFSDeploymentUnit unit, boolean fail) throws Exception { VirtualFile file = unit.getMetaDataFile("MANIFEST.MF"); log.trace("parsing " + file); // Default to the jboss client main String mainClassName = "org.jboss.client.AppClientMain"; if (file != null) { Manifest mf = VFSUtils.readManifest(file); Attributes attrs = mf.getMainAttributes(); String className = attrs.getValue(Attributes.Name.MAIN_CLASS); if (className != null) { mainClassName = className; } } return mainClassName; }
/** * Get main class from manifest. * * @param unit the deployment unit * @return main class name * @throws IOException for any error */ protected String getMainClassName(VFSDeploymentUnit unit) throws IOException { VirtualFile file = unit.getMetaDataFile("MANIFEST.MF"); if (log.isTraceEnabled()) log.trace("parsing " + file); if(file == null) { return null; } Manifest mf = VFSUtils.readManifest(file); Attributes attrs = mf.getMainAttributes(); return attrs.getValue(Attributes.Name.MAIN_CLASS); } }
VirtualFile mfFile = unit.getMetaDataFile("MANIFEST.MF"); VirtualFile clientXml = unit.getMetaDataFile("application-client.xml"); VirtualFile ejbXml = unit.getMetaDataFile("ejb-jar.xml"); VirtualFile jbossXml = unit.getMetaDataFile("jboss.xml");
@Override protected T parse(DeploymentUnit unit, String name, T root) throws Exception { // Try to find the metadata VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit; VirtualFile file = vfsDeploymentUnit.getMetaDataFile(name); if (file == null) return null; T result = parse(vfsDeploymentUnit, file, root); if (result != null) init(vfsDeploymentUnit, result, file); return result; }
if (((VFSDeploymentUnit) du).getMetaDataFile("beans.xml") != null) return;
/** * Get metadata file. * First try altDD, then fallback to original name. * * @param unit the vfs deployment unit * @param altExpectedClass the expected class of altDD * @param originalName the original file name * @param checkMetaDataFile should we fall back to metadata file * @return metadata file or null if it doesn't exist */ protected VirtualFile getMetadataFile(VFSDeploymentUnit unit, Class<?> altExpectedClass, String originalName, boolean checkMetaDataFile) { String altPrefix = (altExpectedClass != null ? altExpectedClass.getName() : originalName); VirtualFile file = unit.getAttachment(altPrefix + ".altDD", VirtualFile.class); if (file != null && altExpectedClass != null) { Map<String, Class<?>> altMappingsMap = getAltMappings(unit); if (altMappingsMap == null) { altMappingsMap = new HashMap<String, Class<?>>(); unit.addAttachment(ALT_MAPPINGS_MAP_KEY, altMappingsMap, Map.class); } altMappingsMap.put(file.getName(), altExpectedClass); } if(checkMetaDataFile && file == null) file = unit.getMetaDataFile(originalName, getMetaDataTypeFilter(unit)); return file; }
VirtualFile dd = container.getDeploymentUnit().getMetaDataFile("jbosscmp-jdbc.xml"); if(dd != null)
protected RARDeploymentMetaData mergeMetaData(VFSDeploymentUnit unit, Map<Class<?>, List<Object>> metadata) throws Exception { RARDeploymentMetaData deployment = new RARDeploymentMetaData(); ConnectorMetaData cmd = getInstance(metadata, ConnectorMetaData.class); if (cmd != null) deployment.setConnectorMetaData(cmd); JBossRAMetaData jrmd = getInstance(metadata, JBossRAMetaData.class); if (jrmd != null) deployment.setRaXmlMetaData(jrmd); VFSDeploymentUnit parent = unit.getParent(); String name = unit.getSimpleName(); if (parent != null) name = parent.getSimpleName() + "#" + name; VirtualFile file = unit.getMetaDataFile(jeeSpecRarDD); deployment.getConnectorMetaData().setURL(file.toURL()); metaDataRepository.addConnectorMetaData(name, deployment.getConnectorMetaData()); return deployment; }