/** * visit the descriptor and all sub descriptors with a DOL visitor implementation * * @param aVisitor visitor to traverse the descriptors */ public void visit(DescriptorVisitor aVisitor) { if (aVisitor instanceof ApplicationVisitor) { visit((ComponentVisitor) aVisitor); } else { super.visit(aVisitor); } }
/** * visit the descriptor and all sub descriptors with a DOL visitor implementation * * @param aVisitor visitor to traverse the descriptors */ public void visit(DescriptorVisitor aVisitor) { if (aVisitor instanceof ApplicationVisitor) { visit((ApplicationVisitor) aVisitor); } else { super.visit(aVisitor); } }
/** * validates the DOL Objects associated with this archivist, usually * it requires that a class loader being set on this archivist or passed * as a parameter */ @Override public void validate(ClassLoader aClassLoader) { ClassLoader cl = aClassLoader; if (cl==null) { cl = classLoader; } if (cl==null) { return; } descriptor.setClassLoader(cl); descriptor.visit((ApplicationVisitor) new ApplicationValidator()); }
/** * validates the DOL Objects associated with this archivist, usually * it requires that a class loader being set on this archivist or passed * as a parameter */ @Override public void validate(ClassLoader aClassLoader) { ClassLoader cl = aClassLoader; if (cl==null) { cl = classLoader; } if (cl==null) { return; } descriptor.setClassLoader(cl); descriptor.visit((ApplicationVisitor) new ApplicationValidator()); }
/** * This method populates the rest of the Application object from the * previous standard deployment descriptor reading * @param archive the archive for the application */ public Application openWith(Application application, ReadableArchive archive, Archivist archivist) throws IOException, SAXException { archivist.openWith(application, archive); // validate if (application.isVirtual()) { application.setClassLoader(archivist.getClassLoader()); application.visit((ApplicationVisitor) new ApplicationValidator()); } return application; }
/** * This method populates the rest of the Application object from the * previous standard deployment descriptor reading * @param archive the archive for the application */ public Application openWith(Application application, ReadableArchive archive, Archivist archivist) throws IOException, SAXParseException { archivist.openWith(application, archive); // validate if (application.isVirtual()) { application.setClassLoader(archivist.getClassLoader()); application.visit((ApplicationVisitor) new ApplicationValidator()); } return application; }
@Override public void run(Habitat habitat, DeploymentContext context, String cp) throws Exception { rootLocation_ = new FileArchive(); BundleDescriptor bundle = DOLUtils.getCurrentBundleForContext(context); if (bundle.hasWebServiceClients() && (bundle instanceof ApplicationClientDescriptor)) { hasWebServiceClients = true; } if(bundle.isStandalone()) { rootLocation_.open(context.getSourceDir().toURI()); } else { rootLocation_.open(context.getSource().getParentArchive().getURI()); } this.context = context; this.habitat = habitat; this.moduleClassPath = cp; Application application = context.getModuleMetaData(Application.class); application.visit((ApplicationVisitor) this); }
application.visit(new ApplicationValidator());
application.visit((ApplicationVisitor) new ApplicationValidator());