/** * Check if we need to register schema to jbossxb. */ public void create() { if (isRegisterWithJBossXB()) { namespace = JBossXBHelper.findNamespace(getOutput()); if (namespace == null || JBossXmlConstants.DEFAULT.equals(namespace)) throw new IllegalArgumentException( "RegisterWithJBossXB is enabled, but cannot find namespace on class or package: " + getOutput() + ", perhaps missing @JBossXmlSchema or using default namespace attribute." ); JBossXBHelper.addClassBinding(namespace, getOutput()); } }
protected T parse(VFSDeploymentUnit unit, VirtualFile file, T root) throws Exception { return parse(file); }
/** * TODO: the BeanDeployer needs to build up the ManagedObject from the mc metadata. */ @Override public void build(DeploymentUnit unit, Map<String, ManagedObject> managedObjects) throws DeploymentException { super.build(unit, managedObjects); }
@Override protected void createMetaData(DeploymentUnit unit, String name, String suffix) throws DeploymentException { super.createMetaData(unit, name, suffix); JBossWebMetaData metaData = unit.getAttachment(JBossWebMetaData.class); // If there no JBossWebMetaData was created from a jboss-web.xml, create one if (metaData == null) { metaData = new JBossWebMetaData(); } unit.getTransientManagedObjects().addAttachment(JBossWebMetaData.class, metaData); unit.addAttachment("Raw"+JBossWebMetaData.class.getName(), metaData, JBossWebMetaData.class); }
throw new IllegalArgumentException("Null file"); log.debug("Parsing file: "+file+" for deploymentType: " + getOutput()); Unmarshaller unmarshaller = factory.newUnmarshaller(); unmarshaller.setSchemaValidation(isUseSchemaValidation()); unmarshaller.setValidation(isUseValidation()); InputStream is = file.openStream(); Object parsed = null; throw new DeploymentException("The xml " + file.getPathName() + " is not well formed!"); return getOutput().cast(parsed);
/** * Remove registered schema */ public void destroy() { if (isRegisterWithJBossXB()) { // namespace should exist, since we got past create JBossXBHelper.removeClassBinding(namespace); } }
/** * Parse the file. * * @param file the virtual file to parse * @return new metadata instance * @throws Exception for any error */ protected T parse(VirtualFile file) throws Exception { if (file == null) throw new IllegalArgumentException("Null file"); InputSource source = new VFSInputSource(file); return getHelper().parse(source); } }
/** * Make sure we always have a JBossWebMetaData object attached, even if there is no jboss-web.xml * in the deployment */ @Override protected void createMetaData(DeploymentUnit unit, String name, String suffix, String key) throws DeploymentException { super.createMetaData(unit, name, suffix, key); JBossWebMetaData result = unit.getTransientManagedObjects().getAttachment(getOutput()); if (result == null) { result = new JBossWebMetaData(); unit.getTransientManagedObjects().addAttachment(key, result, getOutput()); } } }
@Override protected void createMetaData(DeploymentUnit unit, String name, String suffix) throws DeploymentException super.createMetaData(unit, name, suffix);
protected TldMetaData parse(VirtualFile file) throws Exception { if (file == null) throw new IllegalArgumentException("Null file"); // Implicit TLDs are reserved as the "implicit.tld" name if (file.getName().equals("implicit.tld")) { return new TldMetaData(); } else { return super.parse(file); } } }
@Override protected void createMetaData(DeploymentUnit unit, String name, String suffix) throws DeploymentException { super.createMetaData(unit, name, suffix); JBossMetaData jbossMetaData = unit.getAttachment(getOutput()); EjbJarMetaData ejbJarMetaData = unit.getAttachment(EjbJarMetaData.class); if (ejbJarMetaData != null || jbossMetaData != null) { // Save this as a transient(non-managed) attachment // only for EJB2.x and earlier beans (since standardjboss.xml does not apply for EJB3.x and // later) if (this.isPreEJB3x(ejbJarMetaData, jbossMetaData)) { JBossMetaData stdMetaData = getStandardMetaData(); if(stdMetaData != null) unit.addAttachment("standardjboss.xml", stdMetaData); } if (jbossMetaData != null) { // For legacy - but its totally redundant???? ApplicationMetaData amd = new ApplicationMetaData(jbossMetaData); unit.addAttachment(ApplicationMetaData.class, amd); } } }
standardMetaData = super.parse(stdJBoss);
super.createMetaData(unit, name, suffix);
protected EarMetaData parse(VFSDeploymentUnit unit, VirtualFile file, EarMetaData root) throws Exception EarMetaData ear = super.parse(unit,file, root); List<DeploymentUnit> children = unit.getChildren(); ModulesMetaData modules = ear.getModules();
protected void createMetaData(DeploymentUnit unit, String name, String suffix, String key) throws DeploymentException super.createMetaData(unit, name, suffix, key);