@SuppressWarnings("deprecation") public UnifiedVirtualFile findChild(String child) throws IOException { VirtualFile vf = getFile().findChild(child); return new VirtualFileAdaptor(vf); }
private UnifiedVirtualFile getWebservicesFile(DeploymentUnit unit) { VirtualFile vf = ((VFSDeploymentUnit)unit).getMetaDataFile("webservices.xml"); return (vf != null ? new VirtualFileAdaptor(vf) : null); } }
public URL toURL() { try { return getFile().toURL(); } catch (Exception e) { return null; } }
private void linkServiceRefs(DeploymentUnit unit, ServiceReferencesMetaData serviceRefs, Context envCtx) throws NamingException { if (unit instanceof VFSDeploymentUnit) { VFSDeploymentUnit vfsUnit = (VFSDeploymentUnit)unit; ClassLoader loader = unit.getClassLoader(); UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(vfsUnit.getRoot()); for (ServiceReferenceMetaData sref : serviceRefs) { String refName = sref.getServiceRefName(); new ServiceReferenceHandler().bindServiceRef(envCtx, refName, vfsRoot, loader, sref); } } }
public void inject(InjectionContainer container) { try { Context envCtx = container.getEnc(); ClassLoader loader = container.getClassloader(); UnifiedVirtualFile vfsRoot = UnifiedVirtualFileFactory.getInstance().create(container.getRootFile()); new ServiceReferenceHandler().bindServiceRef(envCtx, name, vfsRoot, loader, sref); } catch (Exception e) { throw new WebServiceException("Unable to bind ServiceRef [enc=" + name + "]", e); } }
public void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot, ClassLoader loader, ServiceReferenceMetaData sref) throws NamingException { if (delegate != null) { if (sref.isProcessed() == false) { ServiceRefMetaData spiRef = getUnifiedServiceRefMetaData(vfsRoot, sref); delegate.bindServiceRef(encCtx, encName, vfsRoot, loader, spiRef); sref.setProcessed(true); } } }
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; } }
public List<UnifiedVirtualFile> getChildren() throws IOException { List<VirtualFile> vfList = getFile().getChildren(); if (vfList == null) return null; List<UnifiedVirtualFile> uvfList = new LinkedList<UnifiedVirtualFile>(); for (VirtualFile vf : vfList) { uvfList.add(new VirtualFileAdaptor(vf)); } return uvfList; }
public void bindServiceRef(Context encCtx, String encName, UnifiedVirtualFile vfsRoot, ClassLoader loader, ServiceReferenceMetaData sref) throws NamingException { if (!sref.isProcessed()) { final UnifiedServiceRefMetaData spiRef = getUnifiedServiceRefMetaData(vfsRoot, sref); final Referenceable jndiReferenceable = delegate.createReferenceable(spiRef); final String jndiFullName = encCtx.getNameInNamespace() + "/" + encName; log.info("Binding service reference to [jndi=" + jndiFullName + "]"); Util.bind(encCtx, encName, jndiReferenceable); sref.setProcessed(true); } }
public String getName() { try { return getFile().getName(); } catch (Exception e) { throw new RuntimeException(e); } } }
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 void writeObject(ObjectOutputStream out) throws IOException, URISyntaxException { URL url = rootUrl; if (url == null) { VFS vfs = getFile().getVFS(); url = vfs.getRoot().toURL(); } String pathName = path; if (pathName == null) pathName = getFile().getPathName(); ObjectOutputStream.PutField fields = out.putFields(); fields.put("rootUrl", url); fields.put("path", pathName); out.writeFields(); }
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; } }
public UnifiedVirtualFile findChild(String child) throws IOException { VirtualFile vf = root; while (child.startsWith("./")) { child = child.substring(2); } while (child.startsWith("../")) { child = child.substring(3); vf = vf.getParent(); } vf = vf.findChild(child); return new VirtualFileAdaptor(vf); }
@Override public Deployment createDeployment(DeploymentUnit unit) { ArchiveDeployment dep = newDeployment(unit); dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot())); dep.setType(getDeploymentType()); Service service = dep.getService(); JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class); if (webMetaData == null) throw new IllegalStateException("Deployment unit does not contain web meta data"); // Copy the attachments dep.addAttachment(JBossWebMetaData.class, webMetaData); List<ServletMetaData> servlets = getRelevantServlets(webMetaData, unit.getClassLoader()); for (ServletMetaData servlet : servlets) { String servletName = servlet.getName(); String targetBean = getTargetBean(servlet); // Create the endpoint Endpoint ep = newEndpoint(targetBean); ep.setShortName(servletName); service.addEndpoint(ep); } return dep; }
dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit) unit).getRoot()));
@Override public Deployment createDeployment(DeploymentUnit unit) { ArchiveDeployment dep = newDeployment(unit); dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot())); dep.setType(getDeploymentType()); Service service = dep.getService(); JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class); if (webMetaData == null) throw new IllegalStateException("Deployment unit does not contain web meta data"); // Copy the attachments dep.addAttachment(JBossWebMetaData.class, webMetaData); List<ServletMetaData> servlets = getRelevantServlets(webMetaData, unit.getClassLoader()); for (ServletMetaData servlet : servlets) { String servletName = servlet.getName(); String targetBean = getTargetBean(servlet); // Create the endpoint Endpoint ep = newEndpoint(targetBean); ep.setShortName(servletName); service.addEndpoint(ep); } return dep; }
@Override public Deployment createDeployment(DeploymentUnit unit) { ArchiveDeployment dep = newDeployment(unit); dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot())); dep.setType(getDeploymentType()); Service service = dep.getService(); JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class); if (webMetaData == null) throw new IllegalStateException("Deployment unit does not contain web meta data"); // Copy the attachments dep.addAttachment(JBossWebMetaData.class, webMetaData); List<ServletMetaData> servlets = getRelevantServlets(webMetaData, unit.getClassLoader()); for (ServletMetaData servlet : servlets) { String servletName = servlet.getName(); String targetBean = getTargetBean(servlet); // Create the endpoint Endpoint ep = newEndpoint(targetBean); ep.setShortName(servletName); service.addEndpoint(ep); } return dep; }
@Override public Deployment createDeployment(DeploymentUnit unit) { ArchiveDeployment dep = newDeployment(unit); dep.setRootFile(new VirtualFileAdaptor(((VFSDeploymentUnit)unit).getRoot())); dep.setType(getDeploymentType()); Service service = dep.getService(); JBossWebMetaData webMetaData = unit.getAttachment(JBossWebMetaData.class); if (webMetaData == null) throw new IllegalStateException("Deployment unit does not contain web meta data"); // Copy the attachments dep.addAttachment(JBossWebMetaData.class, webMetaData); List<ServletMetaData> servlets = getRelevantServlets(webMetaData, unit.getClassLoader()); for (ServletMetaData servlet : servlets) { String servletName = servlet.getName(); String targetBean = getTargetBean(servlet); // Create the endpoint Endpoint ep = newEndpoint(targetBean); ep.setShortName(servletName); service.addEndpoint(ep); } return dep; }