[jboss-cvs] JBossAS SVN: r59152 - in trunk/server/src/main/org/jboss: deployment metadata webservice/metadata/serviceref
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Dec 19 11:42:07 EST 2006
Author: thomas.diesler at jboss.com
Date: 2006-12-19 11:42:01 -0500 (Tue, 19 Dec 2006)
New Revision: 59152
Modified:
trunk/server/src/main/org/jboss/deployment/ClientDeployer.java
trunk/server/src/main/org/jboss/metadata/ApplicationMetaData.java
trunk/server/src/main/org/jboss/metadata/BeanMetaData.java
trunk/server/src/main/org/jboss/metadata/ClientMetaData.java
trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
trunk/server/src/main/org/jboss/metadata/MetaData.java
trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java
trunk/server/src/main/org/jboss/webservice/metadata/serviceref/HandlerMetaData.java
trunk/server/src/main/org/jboss/webservice/metadata/serviceref/PortComponentRefMetaData.java
trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java
Log:
Remove dependency on resourceLoader
Remove dependency on deprecated DeploymentException
[JBCTS-481] Fix jaxrpc/api/javax_xml_rpc/Stub
Modified: trunk/server/src/main/org/jboss/deployment/ClientDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/ClientDeployer.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/deployment/ClientDeployer.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -171,7 +171,6 @@
Element appClient = xfl.getDocument(in, "application-client.xml").getDocumentElement();
in.close();
metaData = new ClientMetaData();
- metaData.setResourceClassLoader((URLClassLoader)unit.getClassLoader());
metaData.importClientXml(appClient);
// Look for a jboss-client.xml descriptor
Modified: trunk/server/src/main/org/jboss/metadata/ApplicationMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/ApplicationMetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/metadata/ApplicationMetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -1,35 +1,27 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.metadata;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.w3c.dom.DocumentType;
-import org.w3c.dom.Element;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
import java.net.URL;
-import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -37,6 +29,14 @@
import java.util.Map;
import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.Element;
+
/**
* The top level meta data from the jboss.xml and ejb-jar.xml descriptor.
*
@@ -49,8 +49,7 @@
*
* @version $Revision$
*/
-public class ApplicationMetaData
- extends MetaData
+public class ApplicationMetaData extends MetaData
{
public static final int EJB_1x = 1;
public static final int EJB_2x = 2;
@@ -100,26 +99,10 @@
/** The JACC context id for the container */
private String jaccContextID;
-
- /** The ClassLoader to load additional resources */
- private URLClassLoader resourceCl;
-
public ApplicationMetaData()
{
}
- /** Get the ClassLoader to load additional resources */
- public URLClassLoader getResourceCl()
- {
- return resourceCl;
- }
-
- /** Set the ClassLoader to load additional resources */
- public void setResourceClassLoader(URLClassLoader resourceCl)
- {
- this.resourceCl = resourceCl;
- }
-
public String getDescription()
{
return description;
@@ -283,6 +266,7 @@
{
relationships.add(rmd);
}
+
/**
* Get the container managed relations in this application.
* Items are instance of RelationMetaData.
@@ -311,6 +295,7 @@
{
invokerBindings.put(md.getName(), md);
}
+
public Iterator getInvokerProxyBindings()
{
return invokerBindings.values().iterator();
@@ -346,6 +331,7 @@
{
return jmxName;
}
+
public void setJmxName(String name)
{
this.jmxName = name;
@@ -355,6 +341,7 @@
{
return jaccContextID;
}
+
public void setJaccContextID(String jaccContextID)
{
this.jaccContextID = jaccContextID;
@@ -412,6 +399,7 @@
{
return exceptionRollback;
}
+
public void setExceptionRollback(boolean flag)
{
this.exceptionRollback = flag;
@@ -428,8 +416,7 @@
* @throws DeploymentException When there was an error encountered
* while parsing ejb-jar.xml
*/
- public void importEjbJarXml(Element element)
- throws DeploymentException
+ public void importEjbJarXml(Element element) throws DeploymentException
{
// EJB version is determined by the doc type that was used to
// verify the ejb-jar.xml.
@@ -446,8 +433,7 @@
else
{
// No good, EJB 1.1/2.1 requires a DOCTYPE declaration
- throw new DeploymentException("ejb-jar.xml must either obey " +
- "the right xml schema or define a valid DOCTYPE!");
+ throw new DeploymentException("ejb-jar.xml must either obey " + "the right xml schema or define a valid DOCTYPE!");
}
}
else
@@ -456,8 +442,7 @@
if (publicId == null)
{
// We need a public Id
- throw new DeploymentException("The DOCTYPE declaration in " +
- "ejb-jar.xml must define a PUBLIC id");
+ throw new DeploymentException("The DOCTYPE declaration in " + "ejb-jar.xml must define a PUBLIC id");
}
// Check for a known public Id
@@ -472,8 +457,7 @@
else
{
// Unknown
- throw new DeploymentException("Unknown PUBLIC id in " +
- "ejb-jar.xml: " + publicId);
+ throw new DeploymentException("Unknown PUBLIC id in " + "ejb-jar.xml: " + publicId);
}
}
@@ -493,9 +477,7 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in ejb-jar.xml " +
- "for Entity Bean " + entityMetaData.getEjbName() + ": " +
- e.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml " + "for Entity Bean " + entityMetaData.getEjbName() + ": " + e.getMessage());
}
// Ensure unique-ness of <abstract-schema-name>
@@ -505,10 +487,8 @@
if (schemaNameMap.containsKey(abstractSchemaName))
{
//
- throw new DeploymentException(entityMetaData.getEjbName() +
- ": Duplicate abstract-schema name '" + abstractSchemaName +
- "'. Already defined for Entity '" +
- ((EntityMetaData)schemaNameMap.get(abstractSchemaName)).getEjbName() + "'.");
+ throw new DeploymentException(entityMetaData.getEjbName() + ": Duplicate abstract-schema name '" + abstractSchemaName
+ + "'. Already defined for Entity '" + ((EntityMetaData)schemaNameMap.get(abstractSchemaName)).getEjbName() + "'.");
}
schemaNameMap.put(abstractSchemaName, entityMetaData);
}
@@ -528,9 +508,7 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in ejb-jar.xml for " +
- "Session Bean " + sessionMetaData.getEjbName() + ": " +
- e.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml for " + "Session Bean " + sessionMetaData.getEjbName() + ": " + e.getMessage());
}
beans.add(sessionMetaData);
}
@@ -540,8 +518,7 @@
while (iterator.hasNext())
{
Element currentMessageDriven = (Element)iterator.next();
- MessageDrivenMetaData messageDrivenMetaData =
- new MessageDrivenMetaData(this);
+ MessageDrivenMetaData messageDrivenMetaData = new MessageDrivenMetaData(this);
try
{
@@ -549,9 +526,7 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in ejb-jar.xml for " +
- "Message Driven Bean " +
- messageDrivenMetaData.getEjbName() + ": " + e.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml for " + "Message Driven Bean " + messageDrivenMetaData.getEjbName() + ": " + e.getMessage());
}
beans.add(messageDrivenMetaData);
}
@@ -566,23 +541,20 @@
String beanName = bmd.getEjbName();
if (ejbNames.contains(beanName))
{
- throw new DeploymentException("Duplicate definition of an " +
- "EJB with name '" + beanName + "'.");
+ throw new DeploymentException("Duplicate definition of an " + "EJB with name '" + beanName + "'.");
}
ejbNames.add(beanName);
}
// Relationships
- Element relationshipsElement = getOptionalChild(element,
- "relationships");
+ Element relationshipsElement = getOptionalChild(element, "relationships");
if (relationshipsElement != null)
{
// used to assure that a relationship name is not reused
Set relationNames = new HashSet();
- iterator = getChildrenByTagName(relationshipsElement,
- "ejb-relation");
+ iterator = getChildrenByTagName(relationshipsElement, "ejb-relation");
while (iterator.hasNext())
{
Element relationElement = (Element)iterator.next();
@@ -593,9 +565,7 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in ejb-jar.xml " +
- "for relation " + relationMetaData.getRelationName() +
- ": " + e.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml " + "for relation " + relationMetaData.getRelationName() + ": " + e.getMessage());
}
// if the relationship has a name, assure that it has not
@@ -605,9 +575,7 @@
{
if (relationNames.contains(relationName))
{
- throw new DeploymentException("ejb-relation-name must " +
- "be unique in ejb-jar.xml file: ejb-relation-name is " +
- relationName);
+ throw new DeploymentException("ejb-relation-name must " + "be unique in ejb-jar.xml file: ejb-relation-name is " + relationName);
}
relationNames.add(relationName);
}
@@ -625,30 +593,20 @@
while (iterator.hasNext())
{
Element securityRole = (Element)iterator.next();
- try
- {
- String roleName = getElementContent(getUniqueChild(securityRole, "role-name"));
- SecurityRoleMetaData srMetaData = new SecurityRoleMetaData(roleName);
- assemblyDescriptor.addSecurityRoleMetaData(srMetaData);
- }
- catch (DeploymentException e)
- {
- throw new DeploymentException("Error in ejb-jar.xml " +
- "for security-role: " + e.getMessage());
- }
+ String roleName = getElementContent(getUniqueChild(securityRole, "role-name"));
+ SecurityRoleMetaData srMetaData = new SecurityRoleMetaData(roleName);
+ assemblyDescriptor.addSecurityRoleMetaData(srMetaData);
}
// set the method permissions (optional)
- iterator = getChildrenByTagName(descrElement,
- "method-permission");
+ iterator = getChildrenByTagName(descrElement, "method-permission");
try
{
while (iterator.hasNext())
{
Element methodPermission = (Element)iterator.next();
// Look for the unchecked element
- Element unchecked = getOptionalChild(methodPermission,
- "unchecked");
+ Element unchecked = getOptionalChild(methodPermission, "unchecked");
boolean isUnchecked = false;
Set roles = null;
@@ -666,14 +624,11 @@
roles.add(getElementContent((Element)rolesIterator.next()));
}
if (roles.size() == 0)
- throw new DeploymentException("An unchecked " +
- "element or one or more role-name elements " +
- "must be specified in method-permission");
+ throw new DeploymentException("An unchecked " + "element or one or more role-name elements " + "must be specified in method-permission");
}
// find the methods
- Iterator methods = getChildrenByTagName(methodPermission,
- "method");
+ Iterator methods = getChildrenByTagName(methodPermission, "method");
while (methods.hasNext())
{
// load the method
@@ -692,8 +647,7 @@
BeanMetaData bean = getBeanByEjbName(method.getEjbName());
if (bean == null)
{
- throw new DeploymentException(method.getEjbName() +
- " doesn't exist");
+ throw new DeploymentException(method.getEjbName() + " doesn't exist");
}
bean.addPermissionMethod(method);
}
@@ -701,13 +655,11 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in ejb-jar.xml, " +
- "in method-permission: " + e.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml, " + "in method-permission: " + e.getMessage());
}
// set the container transactions (optional)
- iterator = getChildrenByTagName(descrElement,
- "container-transaction");
+ iterator = getChildrenByTagName(descrElement, "container-transaction");
try
{
while (iterator.hasNext())
@@ -731,8 +683,7 @@
BeanMetaData bean = getBeanByEjbName(method.getEjbName());
if (bean == null)
{
- throw new DeploymentException("bean " +
- method.getEjbName() + " doesn't exist");
+ throw new DeploymentException("bean " + method.getEjbName() + " doesn't exist");
}
bean.addTransactionMethod(method);
}
@@ -740,13 +691,11 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in ejb-jar.xml, " +
- "in <container-transaction>: " + e.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml, " + "in <container-transaction>: " + e.getMessage());
}
// Get the exclude-list methods
- Element excludeList = getOptionalChild(descrElement,
- "exclude-list");
+ Element excludeList = getOptionalChild(descrElement, "exclude-list");
if (excludeList != null)
{
iterator = getChildrenByTagName(excludeList, "method");
@@ -762,8 +711,7 @@
BeanMetaData bean = getBeanByEjbName(method.getEjbName());
if (bean == null)
{
- throw new DeploymentException("bean " +
- method.getEjbName() + " doesn't exist");
+ throw new DeploymentException("bean " + method.getEjbName() + " doesn't exist");
}
bean.addExcludedMethod(method);
}
@@ -782,15 +730,13 @@
}
catch (Throwable t)
{
- throw new DeploymentException("Error in ejb-jar.xml " +
- "for message destination: " + t.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml " + "for message destination: " + t.getMessage());
}
}
}
}
- public void importJbossXml(Element element)
- throws DeploymentException
+ public void importJbossXml(Element element) throws DeploymentException
{
Iterator iterator;
@@ -805,8 +751,7 @@
}
// Get any user defined JMX name
- Element jmxNameElement = getOptionalChild(element,
- "jmx-name");
+ Element jmxNameElement = getOptionalChild(element, "jmx-name");
if (jmxNameElement != null)
{
jmxName = getElementContent(jmxNameElement);
@@ -816,20 +761,17 @@
exceptionRollback = MetaData.getOptionalChildBooleanContent(element, "exception-on-rollback", false);
// Get the security domain name
- Element securityDomainElement = getOptionalChild(element,
- "security-domain");
+ Element securityDomainElement = getOptionalChild(element, "security-domain");
if (securityDomainElement != null)
{
securityDomain = getElementContent(securityDomainElement);
}
// Get the missing-method-permissions-excluded-mode flag
- excludeMissingMethods = MetaData.getOptionalChildBooleanContent(element,
- "missing-method-permissions-excluded-mode", true);
+ excludeMissingMethods = MetaData.getOptionalChildBooleanContent(element, "missing-method-permissions-excluded-mode", true);
// Get the unauthenticated-principal name
- Element unauth = getOptionalChild(element,
- "unauthenticated-principal");
+ Element unauth = getOptionalChild(element, "unauthenticated-principal");
if (unauth != null)
{
unauthenticatedPrincipal = getElementContent(unauth);
@@ -840,12 +782,10 @@
}
// find the invoker configurations
- Element invokerConfs = getOptionalChild(element,
- "invoker-proxy-bindings");
+ Element invokerConfs = getOptionalChild(element, "invoker-proxy-bindings");
if (invokerConfs != null)
{
- iterator = getChildrenByTagName(invokerConfs,
- "invoker-proxy-binding");
+ iterator = getChildrenByTagName(invokerConfs, "invoker-proxy-binding");
while (iterator.hasNext())
{
@@ -854,8 +794,7 @@
// find the configuration if it has already been defined
// (allow jboss.xml to modify a standard conf)
- InvokerProxyBindingMetaData invokerMetaData =
- getInvokerProxyBindingMetaDataByName(invokerName);
+ InvokerProxyBindingMetaData invokerMetaData = getInvokerProxyBindingMetaDataByName(invokerName);
// create it if necessary
if (invokerMetaData == null)
@@ -870,9 +809,7 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in jboss.xml " +
- "for invoker-proxy-binding " + invokerMetaData.getName() +
- ": " + e.getMessage());
+ throw new DeploymentException("Error in jboss.xml " + "for invoker-proxy-binding " + invokerMetaData.getName() + ": " + e.getMessage());
}
}
}
@@ -887,8 +824,7 @@
while (iterator.hasNext())
{
Element conf = (Element)iterator.next();
- String confName = getElementContent(getUniqueChild(conf,
- "container-name"));
+ String confName = getElementContent(getUniqueChild(conf, "container-name"));
String parentConfName = conf.getAttribute("extends");
if (parentConfName != null && parentConfName.trim().length() == 0)
{
@@ -906,20 +842,17 @@
configurationMetaData = getConfigurationMetaDataByName(parentConfName);
if (configurationMetaData == null)
{
- throw new DeploymentException("Failed to find " +
- "parent config=" + parentConfName);
+ throw new DeploymentException("Failed to find " + "parent config=" + parentConfName);
}
// Make a copy of the existing configuration
- configurationMetaData =
- (ConfigurationMetaData)configurationMetaData.clone();
+ configurationMetaData = (ConfigurationMetaData)configurationMetaData.clone();
configurations.put(confName, configurationMetaData);
}
if (configurationMetaData == null)
{
- configurationMetaData =
- getConfigurationMetaDataByName(confName);
+ configurationMetaData = getConfigurationMetaDataByName(confName);
}
// Create a new configuration if none was found
@@ -935,9 +868,7 @@
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in jboss.xml " +
- "for container-configuration " +
- configurationMetaData.getName() + ": " + e.getMessage());
+ throw new DeploymentException("Error in jboss.xml " + "for container-configuration " + configurationMetaData.getName() + ": " + e.getMessage());
}
}
}
@@ -979,8 +910,7 @@
BeanMetaData beanMetaData = getBeanByEjbName(ejbName);
if (beanMetaData == null)
{
- throw new DeploymentException("found in jboss.xml " +
- "but not in ejb-jar.xml");
+ throw new DeploymentException("found in jboss.xml " + "but not in ejb-jar.xml");
}
beanMetaData.importJbossXml(bean);
}
@@ -994,8 +924,7 @@
BeanMetaData beanMetaData = getBeanByEjbName(ejbName);
if (beanMetaData == null)
{
- throw new DeploymentException("found in jboss.xml " +
- "but not in ejb-jar.xml");
+ throw new DeploymentException("found in jboss.xml " + "but not in ejb-jar.xml");
}
beanMetaData.importJbossXml(bean);
}
@@ -1009,16 +938,14 @@
BeanMetaData beanMetaData = getBeanByEjbName(ejbName);
if (beanMetaData == null)
{
- throw new DeploymentException("found in jboss.xml " +
- "but not in ejb-jar.xml");
+ throw new DeploymentException("found in jboss.xml " + "but not in ejb-jar.xml");
}
beanMetaData.importJbossXml(bean);
}
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in jboss.xml for " +
- "Bean " + ejbName + ": " + e.getMessage());
+ throw new DeploymentException("Error in jboss.xml for " + "Bean " + ejbName + ": " + e.getMessage());
// WebserviceDescriptions
}
@@ -1065,8 +992,7 @@
}
catch (Throwable t)
{
- throw new DeploymentException("Error in ejb-jar.xml " +
- "for message destination: " + t.getMessage());
+ throw new DeploymentException("Error in ejb-jar.xml " + "for message destination: " + t.getMessage());
}
}
}
@@ -1097,15 +1023,13 @@
}
else
{
- throw new DeploymentException(resName +
- " : expected res-url or res-jndi-name tag");
+ throw new DeploymentException(resName + " : expected res-url or res-jndi-name tag");
}
}
}
catch (DeploymentException e)
{
- throw new DeploymentException("Error in jboss.xml, in " +
- "resource-manager: " + e.getMessage());
+ throw new DeploymentException("Error in jboss.xml, in " + "resource-manager: " + e.getMessage());
}
}
}
@@ -1127,13 +1051,13 @@
public void addContainerConfiguration(ConfigurationMetaData container)
{
String name = container.getName();
- if(name == null)
+ if (name == null)
{
throw new IllegalStateException("Container configuration must have a non-null name!");
}
configurations.put(name, container);
- }
-
+ }
+
/**
* Merge the security role/principal mapping defined in jboss.xml
* with the one defined at jboss-app.xml.
@@ -1145,5 +1069,5 @@
}
/*
-vim:ts=3:sw=3:et
-*/
+ vim:ts=3:sw=3:et
+ */
Modified: trunk/server/src/main/org/jboss/metadata/BeanMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/BeanMetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/metadata/BeanMetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -1112,7 +1112,7 @@
Element serviceRef = (Element)iterator.next();
if (ServiceRefMetaData.isValidDoctype(serviceRef))
{
- ServiceRefMetaData refMetaData = new ServiceRefMetaData(application.getResourceCl());
+ ServiceRefMetaData refMetaData = new ServiceRefMetaData();
refMetaData.importStandardXml(serviceRef);
serviceReferences.put(refMetaData.getServiceRefName(), refMetaData);
}
Modified: trunk/server/src/main/org/jboss/metadata/ClientMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/ClientMetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/metadata/ClientMetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -23,16 +23,15 @@
// $Id$
-import org.jboss.logging.Logger;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
-import org.w3c.dom.Element;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.net.URLClassLoader;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.logging.Logger;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.w3c.dom.Element;
+
/** The metdata data from a j2ee application-client.xml descriptor
*
* @author Scott.Stark at jboss.org
@@ -66,15 +65,6 @@
/** The JAAS callback handler */
private String callbackHandler;
- /** The ClassLoader to load additional resources */
- private URLClassLoader resourceCl;
-
- /** Set the ClassLoader to load additional resources */
- public void setResourceClassLoader(URLClassLoader resourceCl)
- {
- this.resourceCl = resourceCl;
- }
-
/** The application-client/display-name
* @return application-client/display-name value
*/
@@ -177,7 +167,7 @@
Element serviceRef = (Element) iterator.next();
if (ServiceRefMetaData.isValidDoctype(serviceRef))
{
- ServiceRefMetaData refMetaData = new ServiceRefMetaData(resourceCl);
+ ServiceRefMetaData refMetaData = new ServiceRefMetaData();
refMetaData.importStandardXml(serviceRef);
serviceReferences.put(refMetaData.getServiceRefName(), refMetaData);
}
Modified: trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -396,7 +396,7 @@
}
else if (localName.equals("jaxrpc-mapping-file"))
{
- ref.setJaxrpcMappingFile(getValue(localName, value));
+ ref.setMappingFile(getValue(localName, value));
}
else if (localName.equals("mapped-name"))
{
Modified: trunk/server/src/main/org/jboss/metadata/MetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/MetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/metadata/MetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -1,59 +1,56 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.metadata;
import java.util.ArrayList;
import java.util.Iterator;
+import org.jboss.logging.Logger;
+import org.jboss.util.StringPropertyReplacer;
import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.logging.Logger;
-import org.jboss.util.StringPropertyReplacer;
-
/**
* An abstract base class for metadata containers.
*
* @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
* @version $Revision$
*/
-public abstract class MetaData
- implements Cloneable, XmlLoadable
+public abstract class MetaData implements Cloneable, XmlLoadable
{
// Constants -----------------------------------------------------
protected static Logger log = Logger.getLogger(MetaData.class);
-
+
// These do not really belong here
- public static final byte TX_NOT_SUPPORTED = 0;
- public static final byte TX_REQUIRED = 1;
- public static final byte TX_SUPPORTS = 2;
- public static final byte TX_REQUIRES_NEW = 3;
- public static final byte TX_MANDATORY = 4;
- public static final byte TX_NEVER = 5;
- public static final byte TX_UNKNOWN = 6;
+ public static final byte TX_NOT_SUPPORTED = 0;
+ public static final byte TX_REQUIRED = 1;
+ public static final byte TX_SUPPORTS = 2;
+ public static final byte TX_REQUIRES_NEW = 3;
+ public static final byte TX_MANDATORY = 4;
+ public static final byte TX_NEVER = 5;
+ public static final byte TX_UNKNOWN = 6;
// Attributes ----------------------------------------------------
@@ -67,19 +64,20 @@
* @param tagName The name of the desired child
* @return An interator of children or null if element is null.
*/
- public static Iterator getChildrenByTagName(Element element,
- String tagName)
+ public static Iterator getChildrenByTagName(Element element, String tagName)
{
- if (element == null) return null;
+ if (element == null)
+ return null;
// getElementsByTagName gives the corresponding elements in the whole
// descendance. We want only children
NodeList children = element.getChildNodes();
ArrayList goodChildren = new ArrayList();
- for (int i=0; i<children.getLength(); i++) {
+ for (int i = 0; i < children.getLength(); i++)
+ {
Node currentChild = children.item(i);
- if (currentChild.getNodeType() == Node.ELEMENT_NODE &&
- ((Element)currentChild).getTagName().equals(tagName)) {
+ if (currentChild.getNodeType() == Node.ELEMENT_NODE && ((Element)currentChild).getTagName().equals(tagName))
+ {
goodChildren.add(currentChild);
}
}
@@ -98,21 +96,22 @@
* @throws DeploymentException Child was not found or was not unique.
*/
public static Element getUniqueChild(Element element, String tagName)
- throws DeploymentException
{
Iterator goodChildren = getChildrenByTagName(element, tagName);
- if (goodChildren != null && goodChildren.hasNext()) {
+ if (goodChildren != null && goodChildren.hasNext())
+ {
Element child = (Element)goodChildren.next();
- if (goodChildren.hasNext()) {
- throw new DeploymentException
- ("expected only one " + tagName + " tag");
+ if (goodChildren.hasNext())
+ {
+ throw new IllegalStateException("expected only one " + tagName + " tag");
}
return child;
- } else {
- throw new DeploymentException
- ("expected one " + tagName + " tag");
}
+ else
+ {
+ throw new IllegalStateException("expected one " + tagName + " tag");
+ }
}
/**
@@ -125,7 +124,6 @@
* @return either the named child or null
*/
public static Element getOptionalChild(Element element, String tagName)
- throws DeploymentException
{
return getOptionalChild(element, tagName, null);
}
@@ -141,21 +139,21 @@
* doesn't exist
* @return either the named child or the supplied default
*/
- public static Element getOptionalChild(Element element,
- String tagName,
- Element defaultElement)
- throws DeploymentException
+ public static Element getOptionalChild(Element element, String tagName, Element defaultElement)
{
Iterator goodChildren = getChildrenByTagName(element, tagName);
- if (goodChildren != null && goodChildren.hasNext()) {
+ if (goodChildren != null && goodChildren.hasNext())
+ {
Element child = (Element)goodChildren.next();
- if (goodChildren.hasNext()) {
- throw new DeploymentException
- ("expected only one " + tagName + " tag");
+ if (goodChildren.hasNext())
+ {
+ throw new IllegalStateException("expected only one " + tagName + " tag");
}
return child;
- } else {
+ }
+ else
+ {
return defaultElement;
}
}
@@ -191,8 +189,7 @@
String result = element.getAttribute(attrName);
if (replace)
return StringPropertyReplacer.replaceProperties(result.trim());
- else
- return result.trim();
+ else return result.trim();
}
/**
@@ -235,12 +232,11 @@
String result = "";
for (int i = 0; i < children.getLength(); i++)
{
- if (children.item(i).getNodeType() == Node.TEXT_NODE ||
- children.item(i).getNodeType() == Node.CDATA_SECTION_NODE)
+ if (children.item(i).getNodeType() == Node.TEXT_NODE || children.item(i).getNodeType() == Node.CDATA_SECTION_NODE)
{
result += children.item(i).getNodeValue();
}
- else if( children.item(i).getNodeType() == Node.COMMENT_NODE )
+ else if (children.item(i).getNodeType() == Node.COMMENT_NODE)
{
// Ignore comment nodes
}
@@ -251,8 +247,7 @@
}
if (replace)
return StringPropertyReplacer.replaceProperties(result.trim());
- else
- return result.trim();
+ else return result.trim();
}
public static String getFirstElementContent(Element element, String defaultStr)
@@ -269,27 +264,25 @@
String result = "";
for (int i = 0; i < children.getLength(); i++)
{
- if (children.item(i).getNodeType() == Node.TEXT_NODE ||
- children.item(i).getNodeType() == Node.CDATA_SECTION_NODE)
+ if (children.item(i).getNodeType() == Node.TEXT_NODE || children.item(i).getNodeType() == Node.CDATA_SECTION_NODE)
{
String val = children.item(i).getNodeValue();
result += val;
}
- else if( children.item(i).getNodeType() == Node.COMMENT_NODE )
+ else if (children.item(i).getNodeType() == Node.COMMENT_NODE)
{
// Ignore comment nodes
}
/* For some reason, the original version gets the text of the first child
- else
- {
- result += children.item(i).getFirstChild();
- }
- */
+ else
+ {
+ result += children.item(i).getFirstChild();
+ }
+ */
}
if (replace)
return StringPropertyReplacer.replaceProperties(result.trim());
- else
- return result.trim();
+ else return result.trim();
}
/**
@@ -299,9 +292,7 @@
* @param tagName The name of the desired child.
* @return The element content or null.
*/
- public static String getUniqueChildContent(Element element,
- String tagName)
- throws DeploymentException
+ public static String getUniqueChildContent(Element element, String tagName)
{
return getElementContent(getUniqueChild(element, tagName));
}
@@ -313,9 +304,7 @@
* @param tagName The name of the desired child.
* @return The element content or null.
*/
- public static String getOptionalChildContent(Element element,
- String tagName)
- throws DeploymentException
+ public static String getOptionalChildContent(Element element, String tagName)
{
return getElementContent(getOptionalChild(element, tagName));
}
@@ -328,16 +317,14 @@
* @return The element content or null.
*/
public static String getOptionalChildContent(Element element, String tagName, String defaultValue)
- throws DeploymentException
{
return getElementContent(getOptionalChild(element, tagName), defaultValue);
}
public static boolean getOptionalChildBooleanContent(Element element, String name)
- throws DeploymentException
{
Element child = getOptionalChild(element, name);
- if(child != null)
+ if (child != null)
{
String value = getElementContent(child).toLowerCase();
return value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes");
@@ -346,13 +333,11 @@
return false;
}
- public static boolean getOptionalChildBooleanContent(Element element,
- String name, boolean defaultValue)
- throws DeploymentException
+ public static boolean getOptionalChildBooleanContent(Element element, String name, boolean defaultValue)
{
Element child = getOptionalChild(element, name);
boolean flag = defaultValue;
- if(child != null)
+ if (child != null)
{
String value = getElementContent(child).toLowerCase();
flag = value.equalsIgnoreCase("true") || value.equalsIgnoreCase("yes");
@@ -366,7 +351,7 @@
// Public --------------------------------------------------------
/** Create a field wise copy of the object.
- */
+ */
public Object clone()
{
Object clone = null;
@@ -374,7 +359,7 @@
{
clone = super.clone();
}
- catch(CloneNotSupportedException ignore)
+ catch (CloneNotSupportedException ignore)
{
}
return clone;
@@ -382,45 +367,41 @@
/**
* Imports either the jboss or ejb-jar from the given element.
- *
* @param element The element to import.
- *
- * @throws DeploymentException Unrecognized root tag.
*/
- public void importXml(Element element) throws DeploymentException {
- String rootTag = element.getOwnerDocument().
- getDocumentElement().getTagName();
+ public void importXml(Element element) throws Exception
+ {
+ String rootTag = element.getOwnerDocument().getDocumentElement().getTagName();
- if (rootTag.equals("jboss")) {
+ if (rootTag.equals("jboss"))
+ {
// import jboss.xml
importJbossXml(element);
- } else if (rootTag.equals("ejb-jar")) {
+ }
+ else if (rootTag.equals("ejb-jar"))
+ {
// import ejb-jar.xml
importEjbJarXml(element);
- } else {
- throw new DeploymentException("Unrecognized root tag : "+ rootTag);
}
+ else
+ {
+ throw new IllegalStateException("Unrecognized root tag : " + rootTag);
+ }
}
/**
* Non-operation.
- *
- * @param element
- *
- * @throws DeploymentException
*/
- public void importEjbJarXml(Element element) throws DeploymentException {
+ public void importEjbJarXml(Element element) throws Exception
+ {
// empty
}
/**
* Non-operation.
- *
- * @param element
- *
- * @throws DeploymentException
*/
- public void importJbossXml(Element element) throws DeploymentException {
+ public void importJbossXml(Element element) throws Exception
+ {
// empty
}
@@ -433,7 +414,8 @@
*
* @return True if the virtual machine is v1.3 or better.
*/
- protected boolean jdk13Enabled() {
+ protected boolean jdk13Enabled()
+ {
// should use "java.version" ?
String javaVersion = System.getProperty("java.vm.version");
return javaVersion.compareTo("1.3") >= 0;
@@ -444,5 +426,5 @@
// Inner classes -------------------------------------------------
}
/*
-vim:ts=3:sw=3:et
-*/
+ vim:ts=3:sw=3:et
+ */
Modified: trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/metadata/XmlFileLoader.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -157,7 +157,6 @@
// create the metadata
metaData = new ApplicationMetaData();
- metaData.setResourceClassLoader(classLoader);
Document ejbjarDocument = getDocumentFromURL(ejbjarUrl);
Modified: trunk/server/src/main/org/jboss/webservice/metadata/serviceref/HandlerMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/webservice/metadata/serviceref/HandlerMetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/webservice/metadata/serviceref/HandlerMetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -1,29 +1,28 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.webservice.metadata.serviceref;
// $Id$
-import org.jboss.deployment.DeploymentException;
import org.jboss.metadata.MetaData;
import org.jboss.xb.QNameBuilder;
import org.w3c.dom.Element;
@@ -41,7 +40,7 @@
public class HandlerMetaData implements Serializable
{
static final long serialVersionUID = 8749727542255024909L;
-
+
// The required <handler-name> element
private String handlerName;
// The required <handler-class> element
@@ -119,17 +118,16 @@
}
public void importStandardXml(Element element)
- throws DeploymentException
{
handlerName = MetaData.getUniqueChildContent(element, "handler-name");
-
+
handlerClass = MetaData.getUniqueChildContent(element, "handler-class");
-
+
// Parse the init-param elements
Iterator iterator = MetaData.getChildrenByTagName(element, "init-param");
while (iterator.hasNext())
{
- Element paramElement = (Element) iterator.next();
+ Element paramElement = (Element)iterator.next();
InitParamMetaData param = new InitParamMetaData();
param.setParamName(MetaData.getUniqueChildContent(paramElement, "param-name"));
param.setParamValue(MetaData.getUniqueChildContent(paramElement, "param-value"));
@@ -140,7 +138,7 @@
iterator = MetaData.getChildrenByTagName(element, "soap-header");
while (iterator.hasNext())
{
- Element headerElement = (Element) iterator.next();
+ Element headerElement = (Element)iterator.next();
String content = MetaData.getElementContent(headerElement);
QName qname = QNameBuilder.buildQName(headerElement, content);
soapHeaders.add(qname);
@@ -150,7 +148,7 @@
iterator = MetaData.getChildrenByTagName(element, "soap-role");
while (iterator.hasNext())
{
- Element roleElement = (Element) iterator.next();
+ Element roleElement = (Element)iterator.next();
String content = MetaData.getElementContent(roleElement);
soapRoles.add(content);
}
@@ -159,13 +157,14 @@
iterator = MetaData.getChildrenByTagName(element, "port-name");
while (iterator.hasNext())
{
- Element portElement = (Element) iterator.next();
+ Element portElement = (Element)iterator.next();
String content = MetaData.getElementContent(portElement);
portNames.add(content);
}
}
-
- public String toString() {
+
+ public String toString()
+ {
StringBuffer buffer = new StringBuffer("\nHandlerMetaData:");
buffer.append("\n name=" + handlerName);
buffer.append("\n class=" + handlerClass);
Modified: trunk/server/src/main/org/jboss/webservice/metadata/serviceref/PortComponentRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/webservice/metadata/serviceref/PortComponentRefMetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/webservice/metadata/serviceref/PortComponentRefMetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -1,37 +1,35 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.webservice.metadata.serviceref;
// $Id$
-import org.jboss.deployment.DeploymentException;
-import org.jboss.metadata.MetaData;
-import org.w3c.dom.Element;
-
-import javax.xml.rpc.JAXRPCException;
import java.io.Serializable;
-import java.util.Properties;
import java.util.Iterator;
+import java.util.Properties;
+import org.jboss.metadata.MetaData;
+import org.w3c.dom.Element;
+
/** The metdata data from service-ref/port-component-ref element in web.xml, ejb-jar.xml, and application-client.xml.
*
* @author Thomas.Diesler at jboss.org
@@ -82,42 +80,28 @@
return serviceEndpointInterface;
}
- public Class getServiceEndpointInterfaceClass()
- {
- try
- {
- ClassLoader cl = serviceRefMetaData.getResourceCL();
- return cl.loadClass(serviceEndpointInterface);
- }
- catch (ClassNotFoundException e)
- {
- throw new JAXRPCException("Cannot load service endpoint interface: " + serviceEndpointInterface);
- }
- }
-
public Properties getCallProperties()
{
return callProperties;
}
public void importStandardXml(Element element)
- throws DeploymentException
{
serviceEndpointInterface = MetaData.getUniqueChildContent(element, "service-endpoint-interface");
portComponentLink = MetaData.getOptionalChildContent(element, "port-component-link");
}
- public void importJBossXml(Element element) throws DeploymentException
+ public void importJBossXml(Element element)
{
// Look for call-property elements
Iterator iterator = MetaData.getChildrenByTagName(element, "call-property");
while (iterator.hasNext())
{
- Element propElement = (Element) iterator.next();
+ Element propElement = (Element)iterator.next();
String name = MetaData.getUniqueChildContent(propElement, "prop-name");
String value = MetaData.getUniqueChildContent(propElement, "prop-value");
- if( callProperties == null )
+ if (callProperties == null)
callProperties = new Properties();
callProperties.setProperty(name, value);
}
Modified: trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java 2006-12-19 16:19:17 UTC (rev 59151)
+++ trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java 2006-12-19 16:42:01 UTC (rev 59152)
@@ -26,7 +26,6 @@
import java.io.Serializable;
import java.net.MalformedURLException;
import java.net.URL;
-import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -34,7 +33,6 @@
import javax.xml.namespace.QName;
-import org.jboss.deployment.DeploymentException;
import org.jboss.logging.Logger;
import org.jboss.metadata.MetaData;
import org.jboss.metadata.Ref;
@@ -48,14 +46,13 @@
* @author Thomas.Diesler at jboss.org
* @version $Revision$
*/
-public class ServiceRefMetaData extends Ref
- implements Serializable
+public class ServiceRefMetaData extends Ref implements Serializable
{
private static final long serialVersionUID = -3723577995017108437L;
// provide logging
private static Logger log = Logger.getLogger(ServiceRefMetaData.class);
-
+
// The required <service-ref-name> element
private String serviceRefName;
// The required <service-interface> element
@@ -65,7 +62,7 @@
// The optional <wsdl-file> element
private String wsdlFile;
// The optional <jaxrpc-mapping-file> element
- private String jaxrpcMappingFile;
+ private String mappingFile;
// The optional <service-qname> element
private QName serviceQName;
// The LinkedHashMap<String, PortComponentRefMetaData> for <port-component-ref> elements
@@ -83,9 +80,6 @@
private Properties callProperties;
private String mappedName;
- /** The ClassLoader to load additional resources */
- private transient URLClassLoader resourceCL;
-
/** Default constructor, used when unmarshalling on the client side
*/
public ServiceRefMetaData()
@@ -99,53 +93,16 @@
this.serviceRefName = serviceRefName;
}
- /** Constructor with a given resource classloader, used on the server side
- */
- public ServiceRefMetaData(URLClassLoader resourceCl)
+ public String getMappingFile()
{
- setResourceCL(resourceCl);
+ return mappingFile;
}
- /** Set the resource classloader that can load the wsdl file
- * On the client side this is set expicitly after unmarshalling.
- */
- public void setResourceCL(URLClassLoader resourceCL)
+ public void setMappingFile(String mappingFile)
{
- if (resourceCL == null)
- throw new IllegalArgumentException("ResourceClassLoader cannot be null");
-
- this.resourceCL = resourceCL;
+ this.mappingFile = mappingFile;
}
- public URLClassLoader getResourceCL()
- {
- if (resourceCL == null)
- resourceCL = new URLClassLoader(new URL[] {}, Thread.currentThread().getContextClassLoader());
-
- return resourceCL;
- }
-
- public String getJaxrpcMappingFile()
- {
- return jaxrpcMappingFile;
- }
- public void setJaxrpcMappingFile(String file)
- {
- this.jaxrpcMappingFile = jaxrpcMappingFile;
- }
-
- public URL getJavaWsdlMappingURL()
- {
- URL mappingURL = null;
- if (jaxrpcMappingFile != null)
- {
- mappingURL = getResourceCL().findResource(jaxrpcMappingFile);
- if (mappingURL == null)
- throw new IllegalStateException("Cannot find resource: " + jaxrpcMappingFile);
- }
- return mappingURL;
- }
-
public PortComponentRefMetaData[] getPortComponentRefs()
{
PortComponentRefMetaData[] array = new PortComponentRefMetaData[portComponentRefs.size()];
@@ -164,6 +121,7 @@
{
return serviceInterface;
}
+
public void setServiceInterface(String serviceInterface)
{
this.serviceInterface = serviceInterface;
@@ -173,6 +131,7 @@
{
return serviceQName;
}
+
public void setServiceQName(QName serviceQName)
{
this.serviceQName = serviceQName;
@@ -182,6 +141,7 @@
{
return serviceRefName;
}
+
public void setServiceRefName(String serviceRefName)
{
this.serviceRefName = serviceRefName;
@@ -191,6 +151,7 @@
{
return serviceResType;
}
+
public void setServiceResType(String serviceResType)
{
this.serviceResType = serviceResType;
@@ -200,9 +161,10 @@
{
return wsdlFile;
}
- public void setWsdlFile(String file)
+
+ public void setWsdlFile(String wsdlFile)
{
- this.wsdlFile = file;
+ this.wsdlFile = wsdlFile;
}
public String getConfigFile()
@@ -234,23 +196,12 @@
{
this.configName = configName;
}
+
public URL getWsdlOverride()
{
return wsdlOverride;
}
- public URL getWsdlURL()
- {
- URL wsdlURL = wsdlOverride;
- if (wsdlURL == null && wsdlFile != null)
- {
- wsdlURL = getResourceCL().findResource(wsdlFile);
- if (wsdlURL == null)
- throw new IllegalStateException("Cannot find resource: " + wsdlFile);
- }
- return wsdlURL;
- }
-
public Properties getCallProperties()
{
return callProperties;
@@ -271,7 +222,7 @@
isValid |= "-//JBoss//DTD Web Application 2.4//EN".equals(publicId);
isValid |= "-//JBoss//DTD Application Client 4.0//EN".equals(publicId);
}
-
+
if (isValid == false)
{
String dtstr = (doctype != null ? "[public=" + doctype.getPublicId() + ",system=" + doctype.getSystemId() + "]" : null);
@@ -279,8 +230,8 @@
}
return isValid;
}
-
- public void importStandardXml(Element element) throws DeploymentException
+
+ public void importStandardXml(Element element)
{
serviceRefName = MetaData.getUniqueChildContent(element, "service-ref-name");
@@ -288,7 +239,7 @@
wsdlFile = MetaData.getOptionalChildContent(element, "wsdl-file");
- jaxrpcMappingFile = MetaData.getOptionalChildContent(element, "jaxrpc-mapping-file");
+ mappingFile = MetaData.getOptionalChildContent(element, "jaxrpc-mapping-file");
Element qnameElement = MetaData.getOptionalChild(element, "service-qname");
if (qnameElement != null)
@@ -316,10 +267,8 @@
}
/** Parse jboss specific service-ref child elements
- * @param element
- * @throws DeploymentException
*/
- public void importJBossXml(Element element) throws DeploymentException
+ public void importJBossXml(Element element)
{
configName = MetaData.getOptionalChildContent(element, "config-name");
@@ -332,7 +281,7 @@
}
catch (MalformedURLException e)
{
- throw new DeploymentException("Invalid WSDL override: " + wsdlOverrideOption);
+ throw new IllegalStateException("Invalid WSDL override: " + wsdlOverrideOption);
}
// Parse the port-component-ref elements
More information about the jboss-cvs-commits
mailing list