[jboss-svn-commits] JBL Code SVN: r6454 - in labs/jbossesb/trunk/product: core/common/src/org/jboss/soa/esb/common core/common/src/org/jboss/soa/esb/connection core/common/src/org/jboss/soa/esb/helpers core/common/src/org/jboss/soa/esb/parameters core/common/src/org/jboss/soa/esb/util core/common/tests core/common/tests/resources core/common/tests/resources/etc core/common/tests/src/org/jboss/soa/esb/common/tests core/common/tests/src/org/jboss/soa/esb/common/tests/propertymanager core/common/tests/src/org/jboss/soa/esb/parameters core/listeners/src/org/jboss/soa/esb/listeners core/listeners/src/org/jboss/soa/esb/nagios core/services core/services/tests etc
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 27 19:06:55 EDT 2006
Author: mark.little at jboss.com
Date: 2006-09-27 19:06:40 -0400 (Wed, 27 Sep 2006)
New Revision: 6454
Added:
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/ModulePropertyManager.java
labs/jbossesb/trunk/product/core/common/tests/resources/etc/
labs/jbossesb/trunk/product/core/common/tests/resources/etc/jbossesb-test-properties.xml
labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/propertymanager/
labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
Modified:
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Configuration.java
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Environment.java
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/connection/ConnectionProperties.java
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/helpers/DomElement.java
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamFileRepository.java
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java
labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/util/Util.java
labs/jbossesb/trunk/product/core/common/tests/build.xml
labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java
labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/GpListener.java
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/nagios/Runner.java
labs/jbossesb/trunk/product/core/services/build.xml
labs/jbossesb/trunk/product/core/services/tests/build.xml
labs/jbossesb/trunk/product/etc/jbossesb-properties.xml
Log:
Updated PropertyManager to fix run-time bug, and also restructured property file into modules/components.
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Configuration.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Configuration.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -28,7 +28,6 @@
import org.jboss.soa.esb.helpers.KeyValuePair;
-import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
import com.arjuna.common.util.exceptions.LoadPropertiesException;
import com.arjuna.common.util.exceptions.ManagementPluginException;
import com.arjuna.common.util.exceptions.SavePropertiesException;
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Environment.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/Environment.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -22,24 +22,33 @@
package org.jboss.soa.esb.common;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
public class Environment
{
public static final String PROPERTIES_FILE = "org.jboss.soa.esb.propertyFile";
+ /*
+ * Transport specific properties.
+ */
+
public static final String SMTP_HOST = "org.jboss.soa.esb.mail.smtp.host";
public static final String SMTP_USERNAME = "org.jboss.soa.esb.mail.smtp.user";
public static final String SMTP_PASSWORD = "org.jboss.soa.esb.mail.smtp.password";
public static final String SMTP_PORT = "org.jboss.soa.esb.mail.smtp.port";
public static final String SMTP_FROM = "org.jboss.soa.esb.mail.smtp.from";
public static final String SMTP_AUTH = "org.jboss.soa.esb.mail.smtp.auth";
+
+ /*
+ *
+ */
public static final String JNDI_SERVER_TYPE = "org.jboss.soa.esb.jndi.server.type";
public static final String JNDI_SERVER_URL = "org.jboss.soa.esb.jndi.server.url";
public static final String PARAMS_REPOS_IMPL_CLASS = "org.jboss.soa.esb.paramsRepository.class";
public static final String OBJECT_STORE_CONFIG_FILE = "org.jboss.soa.esb.objStore.configfile";
public static final String ENCRYPT_FACTORY_CLASS = "org.jboss.soa.esb.encryption.factory.class";
+ /*
+ * Some default values.
+ */
public static final String DEFAULT_PROPERTY_FILE = "jbossesb-properties.xml";
public static final String DEFAULT_HOST = "localhost";
public static final String DEFAULT_USERNAME = "";
Added: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/ModulePropertyManager.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/ModulePropertyManager.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/common/ModulePropertyManager.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -0,0 +1,141 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002
+ *
+ * Arjuna Solutions Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: arjPropertyManager.java 2342 2006-03-30 13:06:17Z $
+ */
+
+package org.jboss.soa.esb.common;
+
+import java.util.Hashtable;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
+
+/**
+ * The ESB configuration file is split into modules, each concerned with a
+ * specific capability. Each module may also depend upon another module. We use
+ * a PropertyManager per module to manage properties and relationships.
+ *
+ * All properties are grouped within <properties/> sections and individual
+ * properties by <property/>. If you look at some you'll see that they may be
+ * named and may have a depends value, which relates to another section. This
+ * tells the PropertyManager to load the depends section first. A property value
+ * may be overridden by a dependant section, but the PropertyManager remembers
+ * the hierarchy, so if you want to you can inspect and change the lower level
+ * value and the PropertyManager can be used to preserve these changes if the
+ * values are written back out to the source location.
+ *
+ * The way the PropertyManager works means that it builds up a list of dependant
+ * modules in a directed acyclic graph. This means that there is a root, which
+ * can see every property below it, but nodes below cannot see properties above
+ * them: there is a level of isolation.
+ *
+ * When creating PropertyManagers, you need to specify where in the graph it is
+ * to "tie in". This obviously has an affect on what that instance can then see
+ * or do: if it goes in at the wrong level, it won't be able to see properties
+ * it may need (unless they were defined to be "system" properties, and in which
+ * case they are globally accessible.)
+ *
+ * This means that we now have isolated PropertyManagers for each module. It
+ * helps the management side of things a lot, but does mean that we have to
+ * consider where in the graph a property needs to be, or which PropertyManager
+ * we want to use to try to access it.
+ *
+ * @author marklittle
+ *
+ */
+public class ModulePropertyManager
+{
+ /*
+ * The names of the various modules in the property file.
+ */
+
+ public static final String CORE_MODULE = "core";
+
+ public static final String TRANSPORTS_MODULE = "transports";
+
+ public static final String CONNECTION_MODULE = "connection";
+
+ /**
+ * Get the property manager responsible for the module component in the
+ * file.
+ *
+ * @param name
+ * the name of the module.
+ * @return the relevant property manager.
+ */
+
+ public static PropertyManager getPropertyManager(String name)
+ {
+ synchronized (managers)
+ {
+ PropertyManager theManager = managers.get(name);
+
+ if (theManager == null)
+ {
+ theManager = initialise(name);
+
+ if (theManager != null)
+ managers.put(name, theManager);
+ }
+
+ return theManager;
+ }
+ }
+
+ private static final PropertyManager initialise(String name)
+ {
+ /**
+ * Retrieve the property manager from the factory and add the ESB
+ * properties file to it.
+ */
+
+ PropertyManager propertyManager = PropertyManagerFactory
+ .getPropertyManager(
+ "org.jboss.soa.esb.propertymanager." + name, name);
+
+ String propertiesFilename = System.getProperty(
+ Environment.PROPERTIES_FILE, Environment.DEFAULT_PROPERTY_FILE);
+
+ try
+ {
+ propertyManager.load(XMLFilePlugin.class.getName(),
+ propertiesFilename);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+
+ return null;
+ }
+
+ return propertyManager;
+ }
+
+ private static Hashtable<String, PropertyManager> managers = new Hashtable<String, PropertyManager>();
+}
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/connection/ConnectionProperties.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/connection/ConnectionProperties.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/connection/ConnectionProperties.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -23,6 +23,7 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import java.util.Properties;
@@ -126,7 +127,7 @@
.getProperty(DRIVER_CLASSNAME);
if (m_sDriverClassName == null)
{
- m_sDriverClassName = Configuration.getPropertyManager()
+ m_sDriverClassName = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
.getProperty(DRIVER_CLASSNAME);
}
}
@@ -146,7 +147,7 @@
m_sConnectionUrl = m_oConnectionProperties.getProperty(CONNECTION_URL);
if (m_sConnectionUrl == null)
{
- m_sConnectionUrl = Configuration.getPropertyManager().getProperty(
+ m_sConnectionUrl = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(
CONNECTION_URL);
}
}
@@ -167,7 +168,7 @@
.get(ISOLATION_LEVEL);
if (isolation == null)
{
- isolation = Configuration.getPropertyManager().getProperty(
+ isolation = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(
ISOLATION_LEVEL);
}
this.m_iIsolationLvl = (isolation != null) ? new Integer(isolation)
@@ -189,7 +190,7 @@
String strPoolSize = m_oConnectionProperties.getProperty(MIN_POOL_SIZE);
if (strPoolSize == null)
{
- strPoolSize = Configuration.getPropertyManager().getProperty(
+ strPoolSize = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(
MIN_POOL_SIZE, DEFAULT_MIN_POOL_SIZE);
}
this.m_iMinPoolSize = Integer.parseInt(strPoolSize);
@@ -201,7 +202,7 @@
.get(MAX_POOL_SIZE);
if (strPoolSize == null)
{
- strPoolSize = Configuration.getPropertyManager().getProperty(
+ strPoolSize = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(
MAX_POOL_SIZE, DEFAULT_MAX_POOL_SIZE);
}
this.m_iMaxPoolSize = Integer.parseInt(strPoolSize);
@@ -213,7 +214,7 @@
.get(BLOCKING_CONNECTION_TIME);
if (strBlockTimeMillis == null)
{
- strBlockTimeMillis = Configuration.getPropertyManager()
+ strBlockTimeMillis = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
.getProperty(BLOCKING_CONNECTION_TIME,
DEFAULT_CONN_BLOCK_TIME_MILLIS);
}
@@ -243,7 +244,7 @@
.getProperty(CONNECTION_POOL_CLASS);
if (m_sConnectionPoolClass == null)
{
- m_sConnectionPoolClass = Configuration.getPropertyManager()
+ m_sConnectionPoolClass = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
.getProperty(CONNECTION_POOL_CLASS,
DEFAULT_CONNECTION_POOL_CLASS);
}
@@ -259,7 +260,7 @@
this.m_sUser = m_oConnectionProperties.getProperty(USERNAME);
if (m_sUser == null)
{
- m_sUser = Configuration.getPropertyManager().getProperty(USERNAME);
+ m_sUser = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(USERNAME);
}
}
@@ -273,14 +274,14 @@
this.m_sPassword = m_oConnectionProperties.getProperty(PASSWORD);
if (m_sPassword == null)
{
- m_sPassword = Configuration.getPropertyManager().getProperty(
+ m_sPassword = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(
PASSWORD);
}
String strPasswordDecoder = m_oConnectionProperties
.getProperty(PASSWORD_DECODER);
if (strPasswordDecoder == null)
{
- strPasswordDecoder = Configuration.getPropertyManager()
+ strPasswordDecoder = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
.getProperty(PASSWORD_DECODER);
}
if (strPasswordDecoder != null)
@@ -321,7 +322,7 @@
.getProperty(ABANDONED_CONNECTION_TIMEOUT);
if (strAbandonedConnectionTimeout == null)
{
- strAbandonedConnectionTimeout = Configuration.getPropertyManager()
+ strAbandonedConnectionTimeout = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
.getProperty(ABANDONED_CONNECTION_TIMEOUT,
DEFAULT_ABANDONED_CONNECTION_TIMEOUT);
}
@@ -336,8 +337,8 @@
if (strAbandonedConnectionCheckInterval == null
|| strAbandonedConnectionCheckInterval.trim().length() == 0)
{
- strAbandonedConnectionCheckInterval = Configuration
- .getPropertyManager().getProperty(
+ strAbandonedConnectionCheckInterval = ModulePropertyManager
+ .getPropertyManager(ModulePropertyManager.CONNECTION_MODULE).getProperty(
ABANDONED_CONNECTION_CHECK_INTERVAL,
DEFAULT_ABANDONED_CONNECTION_CHECK_INTERVAL);
}
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/helpers/DomElement.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/helpers/DomElement.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/helpers/DomElement.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -26,6 +26,7 @@
import java.util.*;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import org.w3c.dom.*;
import org.xml.sax.SAXException;
@@ -35,23 +36,24 @@
import javax.xml.transform.stream.*;
/**
- * Wrapper class around the W3C DOM API.
- * <p/>
- * This clas attempts to remove some of the complexity of dealing with the W3C
- * DOM API. It's basically a wrapper class around the {@link org.w3c.dom.Element}
- * and {@link org.w3c.dom.Document} classes.
- * <p/>
- * It provides utility methods for constructing a DOM from a stream, adding/removing
- * elements and attributes from the DOM, and methods for serializing the DOM.
+ * Wrapper class around the W3C DOM API. <p/> This clas attempts to remove some
+ * of the complexity of dealing with the W3C DOM API. It's basically a wrapper
+ * class around the {@link org.w3c.dom.Element} and {@link org.w3c.dom.Document}
+ * classes. <p/> It provides utility methods for constructing a DOM from a
+ * stream, adding/removing elements and attributes from the DOM, and methods for
+ * serializing the DOM.
*
* @author <a href="mailto:schifest at gmail.com">Esteban Shifman</a>
*/
-public class DomElement {
- protected static final String LINE_BREAK = Configuration.getPropertyManager().getProperty("line.separator");
+public class DomElement
+{
+ protected static final String LINE_BREAK = ModulePropertyManager
+ .getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty("line.separator");
private static final transient String s_sCharset = "ISO-8859-1";
-// private static final transient String s_sEncoding = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>";
+ // private static final transient String s_sEncoding = "<?xml
+ // version=\"1.0\" encoding=\"ISO-8859-1\"?>";
private transient static DocumentBuilder s_oDocumentBuilder;
@@ -61,35 +63,45 @@
private DomElement m_oParentDomElement;
- public DomElement getDad() {
+ public DomElement getDad()
+ {
return m_oParentDomElement;
}
- static {
- try {
- s_oDocumentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ static
+ {
+ try
+ {
+ s_oDocumentBuilder = DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder();
s_Transformer = TransformerFactory.newInstance().newTransformer();
- s_Transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ s_Transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
+ "yes");
s_Transformer.setOutputProperty(OutputKeys.INDENT, "no");
s_Transformer.setOutputProperty(OutputKeys.ENCODING, s_sCharset);
- } catch (Exception e) {
+ } catch (Exception e)
+ {
}
};
- private DomElement() {
+ private DomElement()
+ {
}
- protected DomElement(Element p_oE) {
+ protected DomElement(Element p_oE)
+ {
this();
Document oDoc = null;
- synchronized (s_oDocumentBuilder) {
+ synchronized (s_oDocumentBuilder)
+ {
oDoc = s_oDocumentBuilder.newDocument();
}
Node oNew = oDoc.importNode(p_oE.cloneNode(true), true);
m_oRootW3CElement = (Element) oDoc.appendChild(oNew);
} // __________________________________
- public DomElement(String p_sName) {
+ public DomElement(String p_sName)
+ {
this(p_sName, null);
}
@@ -104,29 +116,38 @@
* DomElement
* @throws Exception
*/
- protected DomElement(DomElement p_oP) throws Exception {
+ protected DomElement(DomElement p_oP) throws Exception
+ {
m_oRootW3CElement = p_oP.cloneObj().m_oRootW3CElement;
}
- private DomElement(String p_sName, DomElement p_oParentDomElement) {
+ private DomElement(String p_sName, DomElement p_oParentDomElement)
+ {
this();
Document oW3CDoc = null;
- if (null == p_oParentDomElement) {
- synchronized (s_oDocumentBuilder) {
+ if (null == p_oParentDomElement)
+ {
+ synchronized (s_oDocumentBuilder)
+ {
oW3CDoc = s_oDocumentBuilder.newDocument();
}
- m_oRootW3CElement = (Element) oW3CDoc.appendChild(oW3CDoc.createElement(p_sName));
- } else {
+ m_oRootW3CElement = (Element) oW3CDoc.appendChild(oW3CDoc
+ .createElement(p_sName));
+ } else
+ {
m_oParentDomElement = p_oParentDomElement;
oW3CDoc = p_oParentDomElement.m_oRootW3CElement.getOwnerDocument();
- m_oRootW3CElement = (Element) p_oParentDomElement.m_oRootW3CElement.appendChild(oW3CDoc
- .createElement(p_sName));
+ m_oRootW3CElement = (Element) p_oParentDomElement.m_oRootW3CElement
+ .appendChild(oW3CDoc.createElement(p_sName));
}
} // __________________________________
- public static DomElement fromInputStream(InputStream p_oIS) throws SAXException, IOException {
+ public static DomElement fromInputStream(InputStream p_oIS)
+ throws SAXException, IOException
+ {
Document oDoc = null;
- synchronized (s_oDocumentBuilder) {
+ synchronized (s_oDocumentBuilder)
+ {
oDoc = s_oDocumentBuilder.parse(p_oIS);
}
DomElement oRet = new DomElement();
@@ -134,31 +155,40 @@
return oRet;
} // __________________________________
- public static DomElement fromURL(String p_sFname) throws Exception
- { return fromInputStream(new FileInputStream(p_sFname));
- } //__________________________________
+ public static DomElement fromURL(String p_sFname) throws Exception
+ {
+ return fromInputStream(new FileInputStream(p_sFname));
+ } // __________________________________
- public static DomElement fromXml(String p_xmlString) throws SAXException, IOException {
+ public static DomElement fromXml(String p_xmlString) throws SAXException,
+ IOException
+ {
// TF: Modified this constructor to use the fromInputStream method.
- if(p_xmlString == null || p_xmlString.trim().equals("")) {
- throw new IllegalArgumentException("Null or empty 'p_xmlString' arg in call.");
+ if (p_xmlString == null || p_xmlString.trim().equals(""))
+ {
+ throw new IllegalArgumentException(
+ "Null or empty 'p_xmlString' arg in call.");
}
-
- InputStream oIS = new ByteArrayInputStream(p_xmlString.getBytes(s_sCharset));
+ InputStream oIS = new ByteArrayInputStream(p_xmlString
+ .getBytes(s_sCharset));
+
return fromInputStream(oIS);
} // __________________________________
- public String toString() {
- return toXml().toString().replaceAll(LINE_BREAK, " ").replaceAll("\t",
- "")
+ public String toString()
+ {
+ return toXml().toString().replaceAll(LINE_BREAK, " ").replaceAll(
+ "\t", "")
+ LINE_BREAK;
} // ________________________________
- public ByteArrayOutputStream toXml() {
+ public ByteArrayOutputStream toXml()
+ {
Document oDoc = null;
- synchronized (s_oDocumentBuilder) {
+ synchronized (s_oDocumentBuilder)
+ {
oDoc = s_oDocumentBuilder.newDocument();
}
oDoc.appendChild(oDoc.importNode(m_oRootW3CElement, true));
@@ -168,14 +198,19 @@
ByteArrayOutputStream oStrm = new ByteArrayOutputStream(5000);
StreamResult res = new StreamResult(oStrm);
- try {
- synchronized (s_Transformer) {
+ try
+ {
+ synchronized (s_Transformer)
+ {
s_Transformer.transform(src, res);
}
- } catch (Exception e) {
- try {
+ } catch (Exception e)
+ {
+ try
+ {
oStrm.write("ERROR Dom3Element.toXml()".getBytes());
- } catch (Exception e1) {
+ } catch (Exception e1)
+ {
}
}
return oStrm;
@@ -184,15 +219,18 @@
// _________ GETTERS
// ____________________________________________________________
- public Element getDomElement() {
+ public Element getDomElement()
+ {
return m_oRootW3CElement;
}
- public String getName() {
+ public String getName()
+ {
return m_oRootW3CElement.getNodeName();
}
- public String[] getAttrKeys() {
+ public String[] getAttrKeys()
+ {
NamedNodeMap NM = m_oRootW3CElement.getAttributes();
String[] saRet = new String[NM.getLength()];
for (int i1 = 0; i1 < saRet.length; i1++)
@@ -200,16 +238,19 @@
return saRet;
} // __________________________________
- public String getAttr(String p_sAttribName) {
+ public String getAttr(String p_sAttribName)
+ {
if (!m_oRootW3CElement.hasAttribute(p_sAttribName))
return null;
return m_oRootW3CElement.getAttribute(p_sAttribName);
} // __________________________________
- public static String getTextValue(Node p_Node) {
+ public static String getTextValue(Node p_Node)
+ {
StringBuffer sb = new StringBuffer();
Node nCurr = p_Node.getFirstChild();
- while (null != nCurr) {
+ while (null != nCurr)
+ {
if (nCurr instanceof Text)
sb.append(nCurr.getNodeValue());
nCurr = nCurr.getNextSibling();
@@ -217,7 +258,8 @@
return sb.toString();
} // __________________________________
- public String[] getTextChildren(String p_sElementName) {
+ public String[] getTextChildren(String p_sElementName)
+ {
NodeList NL = getElementNodeList(p_sElementName);
List<String> oL = new ArrayList<String>();
for (int i1 = 0; i1 < NL.getLength(); i1++)
@@ -227,15 +269,18 @@
return saRet;
} // __________________________________
- public DomElement[] getElementChildren(String p_sElementName) {
+ public DomElement[] getElementChildren(String p_sElementName)
+ {
DomElement oDE = null;
-
+
NodeList NL = getElementNodeList(p_sElementName);
List<DomElement> oL = new ArrayList<DomElement>();
- for (int i1 = 0; i1 < NL.getLength(); i1++) {
+ for (int i1 = 0; i1 < NL.getLength(); i1++)
+ {
Node nCurr = NL.item(i1);
- if (nCurr instanceof Element) {
+ if (nCurr instanceof Element)
+ {
oL.add(oDE = new DomElement((Element) nCurr));
oDE.m_oParentDomElement = this;
}
@@ -245,33 +290,45 @@
return oaRet;
} // __________________________________
- public DomElement getFirstElementChild(String p_sElementName) {
+ public DomElement getFirstElementChild(String p_sElementName)
+ {
DomElement[] children = getElementChildren(p_sElementName);
- if(children != null && children.length > 0) {
+ if (children != null && children.length > 0)
+ {
return children[0];
- } else {
+ } else
+ {
return null;
}
} // __________________________________
/**
- * Get a nodelist for the specified element name from the associated Document.
- * @param p_sElementName Element tag name.
+ * Get a nodelist for the specified element name from the associated
+ * Document.
+ *
+ * @param p_sElementName
+ * Element tag name.
* @return Nodelist.
*/
- private NodeList getElementNodeList(String p_sElementName) {
- // TF: Modified the following line to allow the document root element be included in the lookup..
- return m_oRootW3CElement.getOwnerDocument().getElementsByTagName(p_sElementName);
+ private NodeList getElementNodeList(String p_sElementName)
+ {
+ // TF: Modified the following line to allow the document root element be
+ // included in the lookup..
+ return m_oRootW3CElement.getOwnerDocument().getElementsByTagName(
+ p_sElementName);
}
- public DomElement[] getAllElemChildren() {
+ public DomElement[] getAllElemChildren()
+ {
DomElement oDE = null;
List<DomElement> oL = new ArrayList<DomElement>();
Node nCurr = m_oRootW3CElement.getFirstChild();
-
- while (null != nCurr) {
- if (nCurr instanceof Element) {
+
+ while (null != nCurr)
+ {
+ if (nCurr instanceof Element)
+ {
oL.add(oDE = new DomElement((Element) nCurr));
oDE.m_oParentDomElement = this;
}
@@ -285,41 +342,53 @@
// _________ SETTERS
// ____________________________________________________________
- public void setAttr(String p_sAttribName, String p_sAttribValue) {
- if (null == p_sAttribName) {
+ public void setAttr(String p_sAttribName, String p_sAttribValue)
+ {
+ if (null == p_sAttribName)
+ {
// REVIEW: Shouldn't this throw an IllegalArgumentException???
return;
}
m_oRootW3CElement.removeAttribute(p_sAttribName);
- if (null != p_sAttribValue) {
+ if (null != p_sAttribValue)
+ {
m_oRootW3CElement.setAttribute(p_sAttribName, p_sAttribValue);
}
} // __________________________________
- public void addTextChild (String p_sKey, String p_sVal)
- { if (null==p_sKey || null==p_sVal) return;
- DomElement oNew = new DomElement(p_sKey,this);
- oNew.m_oRootW3CElement.appendChild(m_oRootW3CElement.getOwnerDocument().createTextNode(p_sVal));
- } //__________________________________
+ public void addTextChild(String p_sKey, String p_sVal)
+ {
+ if (null == p_sKey || null == p_sVal)
+ return;
+ DomElement oNew = new DomElement(p_sKey, this);
+ oNew.m_oRootW3CElement.appendChild(m_oRootW3CElement.getOwnerDocument()
+ .createTextNode(p_sVal));
+ } // __________________________________
- public void addTextChildren (String p_sKey, String[] p_saVal)
- { if (null==p_sKey || null==p_saVal) return;
- for (int i1=0; i1<p_saVal.length;i1++)
- addTextChild(p_sKey,p_saVal[i1]);
- } //__________________________________
+ public void addTextChildren(String p_sKey, String[] p_saVal)
+ {
+ if (null == p_sKey || null == p_saVal)
+ return;
+ for (int i1 = 0; i1 < p_saVal.length; i1++)
+ addTextChild(p_sKey, p_saVal[i1]);
+ } // __________________________________
- public void addElemChild(DomElement p_oElementChild) {
+ public void addElemChild(DomElement p_oElementChild)
+ {
p_oElementChild.m_oParentDomElement = this;
Document oDoc = m_oRootW3CElement.getOwnerDocument();
- // Need to clone the node because the Elements are from different Document - you'll get
+ // Need to clone the node because the Elements are from different
+ // Document - you'll get
// an exception if you simply try to append it.
- Element clonedElement = (Element) oDoc.importNode(p_oElementChild.m_oRootW3CElement, true);
+ Element clonedElement = (Element) oDoc.importNode(
+ p_oElementChild.m_oRootW3CElement, true);
m_oRootW3CElement.appendChild(clonedElement);
// Reset W3C element of the child DomElement to be the cloned element.
p_oElementChild.m_oRootW3CElement = clonedElement;
} // __________________________________
- public void rmvChildsByName(String p_sTagName) {
+ public void rmvChildsByName(String p_sTagName)
+ {
NodeList NL = m_oRootW3CElement.getElementsByTagName(p_sTagName);
for (int i1 = 0; i1 < NL.getLength(); i1++)
m_oRootW3CElement.removeChild(NL.item(i1));
@@ -328,11 +397,12 @@
// _________ UTILITIES /
// HELPERS_________________________________________________
- public DomElement cloneObj() throws SAXException, IOException {
- // REVIEW: This must be a performance killer - surely the
+ public DomElement cloneObj() throws SAXException, IOException
+ {
+ // REVIEW: This must be a performance killer - surely the
// associated DOM can be cloned Vs serialising to a string and parsing
// from scratch again!!!
return DomElement.fromXml(this.toString());
} // __________________________________
-
+
} // ____________________________________________________________________________
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamFileRepository.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamFileRepository.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamFileRepository.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -12,126 +12,164 @@
import org.apache.log4j.Logger;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.util.StreamUtils;
-
/**
* This class provides basic file-based storage/retrieval of parameter trees for
- * the JBoss ESB.
- * <p/>
- * This class creates a hierarchical parameter file structure on the file system.
- * E.g. the value for a parameter named "org/jboss/param1" is stored in a file called
- * "param1" in the folder "<root>/org/jboss", where "root" is either the working
- * directory (default) or the directory specified in the
- * "org.jboss.soa.esb.paramsRepository.file.root" System property.
+ * the JBoss ESB. <p/> This class creates a hierarchical parameter file
+ * structure on the file system. E.g. the value for a parameter named
+ * "org/jboss/param1" is stored in a file called "param1" in the folder "<root>/org/jboss",
+ * where "root" is either the working directory (default) or the directory
+ * specified in the "org.jboss.soa.esb.paramsRepository.file.root" System
+ * property.
*
* @author Esteban
*
*/
-public class ParamFileRepository implements ParamRepository {
+public class ParamFileRepository implements ParamRepository
+{
/**
* System property defining the repository root directory.
*/
public static final String FILE_PARAMS_REPOS_ROOT = "org.jboss.soa.esb.paramsRepository.file.root";
+
/**
* The repository root dir.
*/
private File root;
+
/**
* Logger.
*/
private Logger logger = Logger.getLogger(ParamFileRepository.class);
-
+
/**
* Public default constructor.
*/
- public ParamFileRepository() {
- String rootDir = Configuration.getPropertyManager().getProperty(FILE_PARAMS_REPOS_ROOT);
-
- // Set the repository root directory.
- if(rootDir == null) {
+ public ParamFileRepository()
+ {
+ String rootDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE)
+ .getProperty(FILE_PARAMS_REPOS_ROOT);
+
+ // Set the repository root directory.
+ if (rootDir == null)
+ {
// set it to the working dir.
root = new File("./");
- } else {
+ } else
+ {
root = new File(rootDir);
- if(!root.exists()) {
- throw new IllegalStateException("Nonexistant directory specified in the [" + FILE_PARAMS_REPOS_ROOT + "] System property: " + root.getAbsolutePath());
+ if (!root.exists())
+ {
+ throw new IllegalStateException(
+ "Nonexistant directory specified in the ["
+ + FILE_PARAMS_REPOS_ROOT
+ + "] System property: "
+ + root.getAbsolutePath());
}
}
-
- logger.info("Setting parameter repository root dir to [" + root.getAbsolutePath() + "].");
+
+ logger.info("Setting parameter repository root dir to ["
+ + root.getAbsolutePath() + "].");
}
- public void add(String name, String value) throws ParamRepositoryException {
+ public void add(String name, String value) throws ParamRepositoryException
+ {
FileParamName nameParam = asserNameOK(name);
- if(value == null) {
- throw new IllegalArgumentException("null 'value' arg in method call.");
+ if (value == null)
+ {
+ throw new IllegalArgumentException(
+ "null 'value' arg in method call.");
}
- synchronized (this) {
+ synchronized (this)
+ {
File paramFile = toParamFile(nameParam);
-
+
paramFile.getParentFile().mkdirs();
FileOutputStream fileStream = null;
- try {
+ try
+ {
fileStream = new FileOutputStream(paramFile);
fileStream.write(value.getBytes("UTF-8"));
- } catch (IOException e) {
- throw new ParamRepositoryException("IO Error while storing param [" + nameParam + "].", e);
- } finally {
- try {
- if(fileStream != null) {
+ } catch (IOException e)
+ {
+ throw new ParamRepositoryException(
+ "IO Error while storing param [" + nameParam + "].", e);
+ } finally
+ {
+ try
+ {
+ if (fileStream != null)
+ {
fileStream.flush();
fileStream.close();
}
- } catch (IOException e) {
- logger.warn("Unable to close param file: " + paramFile.getAbsolutePath(), e);
+ } catch (IOException e)
+ {
+ logger.warn("Unable to close param file: "
+ + paramFile.getAbsolutePath(), e);
}
}
}
}
- public String get(String name) throws ParamRepositoryException {
+ public String get(String name) throws ParamRepositoryException
+ {
FileParamName paramName = asserNameOK(name);
- synchronized (this) {
+ synchronized (this)
+ {
File paramFile = new File(name);
-
- if (!paramFile.exists()) {
+
+ if (!paramFile.exists())
+ {
paramFile = toParamFile(paramName);
- if (!paramFile.exists()) {
+ if (!paramFile.exists())
+ {
return null;
}
}
-
-
-
+
InputStream fileStream = null;
- try {
+ try
+ {
fileStream = new FileInputStream(paramFile);
byte[] value = StreamUtils.readStream(fileStream);
return new String(value, "UTF-8");
- } catch (Exception e) {
- throw new ParamRepositoryException("Unable to load Param Value from file: " + paramFile.getAbsolutePath(), e);
- } finally {
- try {
- if(fileStream != null) {
+ } catch (Exception e)
+ {
+ throw new ParamRepositoryException(
+ "Unable to load Param Value from file: "
+ + paramFile.getAbsolutePath(), e);
+ } finally
+ {
+ try
+ {
+ if (fileStream != null)
+ {
fileStream.close();
}
- } catch (IOException e) {
- logger.warn("Unable to close param file: " + paramFile.getAbsolutePath(), e);
+ } catch (IOException e)
+ {
+ logger.warn("Unable to close param file: "
+ + paramFile.getAbsolutePath(), e);
}
}
}
}
- public void remove(String name) {
+ public void remove(String name)
+ {
FileParamName paramName = asserNameOK(name);
- synchronized (this) {
+ synchronized (this)
+ {
File paramFile = toParamFile(paramName);
- if (paramFile.exists()) {
+ if (paramFile.exists())
+ {
paramFile.delete();
}
}
@@ -139,77 +177,99 @@
/**
* Get the repository root directory.
+ *
* @return The repository root directory.
*/
- public File getRoot() {
+ public File getRoot()
+ {
return root;
}
/**
* Get the param file for the specified param name.
- * @param paramName The param name.
+ *
+ * @param paramName
+ * The param name.
* @return The param file.
*/
- public File toParamFile(String name) {
+ public File toParamFile(String name)
+ {
FileParamName paramName = asserNameOK(name);
return new File(root, paramName.toString());
}
/**
* Get the param file for the specified param name.
- * @param paramName The param name.
+ *
+ * @param paramName
+ * The param name.
* @return The param file.
*/
- private File toParamFile(FileParamName paramName) {
+ private File toParamFile(FileParamName paramName)
+ {
return new File(root, paramName.toString());
}
- private FileParamName asserNameOK(String name) {
+ private FileParamName asserNameOK(String name)
+ {
FileParamName paramName;
-
- if (name == null) {
- throw new IllegalArgumentException("null 'name' arg in repository call.");
+
+ if (name == null)
+ {
+ throw new IllegalArgumentException(
+ "null 'name' arg in repository call.");
}
- try {
+ try
+ {
paramName = new FileParamName(name);
- } catch (InvalidNameException e) {
+ } catch (InvalidNameException e)
+ {
throw new IllegalArgumentException("Invalid 'name' arg: " + name, e);
}
- if (paramName.size() == 0) {
- throw new IllegalArgumentException("Invalid 'name' arg. 0 tokens: " + name);
+ if (paramName.size() == 0)
+ {
+ throw new IllegalArgumentException(
+ "Invalid 'name' arg. 0 tokens: " + name);
}
-
+
return paramName;
}
/**
- * Parameter Name.
- * <p/>
- * Represents a compound parameter name - from a hierarchical namespace.
+ * Parameter Name. <p/> Represents a compound parameter name - from a
+ * hierarchical namespace.
* <h4 id="syntax">Parameter Name Format</h4>
* The syntax of the parameter name is expected to be in "directory" format,
- * read from left to right, where the syntax seperator character is '/'
- * e.g. "com/acme/ParameterX".
+ * read from left to right, where the syntax seperator character is '/' e.g.
+ * "com/acme/ParameterX".
*
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
- private static class FileParamName extends CompoundName {
+ private static class FileParamName extends CompoundName
+ {
private static final long serialVersionUID = 1L;
+
private static final Properties nameSyntaxProperties = new Properties();
- static {
- nameSyntaxProperties.setProperty("jndi.syntax.direction", "left_to_right");
+ static
+ {
+ nameSyntaxProperties.setProperty("jndi.syntax.direction",
+ "left_to_right");
nameSyntaxProperties.setProperty("jndi.syntax.separator", "/");
};
-
+
/**
* Public Constructor.
- * @param name The name of the parameter, specified according to the
- * <a href="#syntax">defined syntax</a>.
- * @throws InvalidNameException The supplied name violates the
- * <a href="#syntax">defined syntax</a>.
+ *
+ * @param name
+ * The name of the parameter, specified according to the <a
+ * href="#syntax">defined syntax</a>.
+ * @throws InvalidNameException
+ * The supplied name violates the <a href="#syntax">defined
+ * syntax</a>.
*/
- public FileParamName(String name) throws InvalidNameException {
+ public FileParamName(String name) throws InvalidNameException
+ {
super(name, nameSyntaxProperties);
}
}
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -24,75 +24,94 @@
import org.jboss.soa.esb.common.Configuration;
/**
- * Factory class for Singleton {@link ParamRepository} creation.
- * <p/>
- * Uses the "org.jboss.soa.esb.paramsRepository.class"
- * system property to determine the {@link ParamRepository} implementation
- * to be created. If not specified, the default implementation is the
+ * Factory class for Singleton {@link ParamRepository} creation. <p/> Uses the
+ * "org.jboss.soa.esb.paramsRepository.class" system property to determine the
+ * {@link ParamRepository} implementation to be created. If not specified, the
+ * default implementation is the
* {@link org.jboss.soa.esb.parameters.ParamFileRepository}.
*
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
-public abstract class ParamRepositoryFactory {
+public abstract class ParamRepositoryFactory
+{
/**
* Singleton instance of the repository.
*/
private static ParamRepository instance;
-
+
/**
- * Factory method for creating the Singleton {@link ParamRepository} instance
- * for the system.
+ * Factory method for creating the Singleton {@link ParamRepository}
+ * instance for the system.
+ *
* @return The ParamRepository instance for the system.
*/
- public static ParamRepository getInstance() {
- if(instance == null) {
- // Hasn't been created yet - lets created it in a synchronized fashion...
+ public static ParamRepository getInstance()
+ {
+ if (instance == null)
+ {
+ // Hasn't been created yet - lets created it in a synchronized
+ // fashion...
instance = synchedGetInstance();
}
-
+
return instance;
}
/**
* Synchronizes creation of the Singleton instance.
+ *
* @return The Singleton ParamRepository instance.
*/
- private static ParamRepository synchedGetInstance() {
- synchronized (ParamRepositoryFactory.class) {
+ private static ParamRepository synchedGetInstance()
+ {
+ synchronized (ParamRepositoryFactory.class)
+ {
// The following check ensures that multithreads won't create
- // multiple instances of the singleton. Threads that are blocked waiting
- // at the start of this synch block will simply fall through and return the
+ // multiple instances of the singleton. Threads that are blocked
+ // waiting
+ // at the start of this synch block will simply fall through and
+ // return the
// instance created by the thread that got in ahead of them.
- if(instance == null) {
- String runtimeClassName = Configuration.getParamRepositoryImplClass();
-
- if(runtimeClassName == null) {
+ if (instance == null)
+ {
+ String runtimeClassName = Configuration
+ .getParamRepositoryImplClass();
+
+ if (runtimeClassName == null)
+ {
// If there's no repository name configured, return the
// default file-based repository...
instance = new ParamFileRepository();
- } else {
- try {
+ } else
+ {
+ try
+ {
Class<?> runtimeClass = Class.forName(runtimeClassName);
instance = (ParamRepository) runtimeClass.newInstance();
- } catch(Exception e) {
- new IllegalStateException("System Configuration Exception: Unable to create system " + ParamRepository.class.getSimpleName() + " instance from runtime class name [" + runtimeClassName + "]", e);
+ } catch (Exception e)
+ {
+ new IllegalStateException(
+ "System Configuration Exception: Unable to create system "
+ + ParamRepository.class.getSimpleName()
+ + " instance from runtime class name ["
+ + runtimeClassName + "]", e);
}
}
}
}
-
+
return instance;
}
/**
- * Resets the factory, allowing creation of a new Singleton
- * instance.
- * <p/>
+ * Resets the factory, allowing creation of a new Singleton instance. <p/>
* Should only need to be used for testing purposes.
*/
- protected static void reset() {
- synchronized (ParamRepositoryFactory.class) {
+ protected static void reset()
+ {
+ synchronized (ParamRepositoryFactory.class)
+ {
instance = null;
}
}
Modified: labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/util/Util.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/util/Util.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/src/org/jboss/soa/esb/util/Util.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -27,74 +27,94 @@
import javax.naming.*;
import org.apache.log4j.*;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
-public class Util {
- private Util() {
+public class Util
+{
+ private Util()
+ {
}
- public static void dumpSysProps(PrintStream p_OS) {
- String[] sa = new String[Configuration.getPropertyManager().getProperties().size()];
- Configuration.getPropertyManager().getProperties().keySet().toArray(sa);
+ public static void dumpSysProps(PrintStream p_OS)
+ {
+ String[] sa = new String[ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE)
+ .getProperties().size()];
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperties().keySet().toArray(sa);
Arrays.sort(sa);
for (String sCurr : sa)
- p_OS.println(sCurr + "=" + Configuration.getPropertyManager().getProperty(sCurr));
+ p_OS.println(sCurr + "="
+ + ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(sCurr));
} // __________________________________
- public static boolean isNullString(String p_s) {
+ public static boolean isNullString(String p_s)
+ {
return (null == p_s) ? true : p_s.trim().length() < 1;
} // __________________________________
- public static boolean isLong(String p_s) {
+ public static boolean isLong(String p_s)
+ {
if (isNullString(p_s))
return false;
- try {
+ try
+ {
Long.parseLong(p_s);
return true;
- } catch (Exception e) {
+ } catch (Exception e)
+ {
return false;
}
} // __________________________________
- public static boolean isPositiveLong(String p_s) {
+ public static boolean isPositiveLong(String p_s)
+ {
if (isNullString(p_s))
return false;
- try {
+ try
+ {
long lBk = Long.parseLong(p_s);
return lBk > 0;
- } catch (Exception e) {
+ } catch (Exception e)
+ {
return false;
}
} // __________________________________
- public static int parseInt(String s) {
+ public static int parseInt(String s)
+ {
if (s == null)
return 0;
String sVal = s.trim();
if (sVal.length() < 1)
return 0;
else
- try {
+ try
+ {
return Integer.parseInt(s);
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException ex)
+ {
return 0;
}
} // __________________________________
- public static long parseLong(String s) {
+ public static long parseLong(String s)
+ {
if (s == null)
return 0;
String sVal = s.trim();
if (sVal.length() < 1)
return 0;
else
- try {
+ try
+ {
return Long.parseLong(s);
- } catch (NumberFormatException ex) {
+ } catch (NumberFormatException ex)
+ {
return 0;
}
} // __________________________________
- public static Logger getDefaultLogger(Class p_oCls) {
+ public static Logger getDefaultLogger(Class p_oCls)
+ {
Logger oRet = Logger.getLogger(p_oCls.getName());
Appender oApp = new ConsoleAppender(new TTCCLayout("ISO8601"));
oRet.addAppender(oApp);
Modified: labs/jbossesb/trunk/product/core/common/tests/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/build.xml 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/build.xml 2006-09-27 23:06:40 UTC (rev 6454)
@@ -27,7 +27,9 @@
<path id="org.jboss.esb.tests.base.classpath">
<fileset dir="../${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
- <fileset dir="../${org.jboss.esb.deploy.lib.dir}" includes="*.jar"/>
+ <fileset dir="../${org.jboss.esb.deploy.lib.dir}" includes="*.jar"/>
+
+ <pathelement location="${org.jboss.esb.root.dir}/common/tests/resources/etc"/>
<pathelement location="${org.jboss.esb.module.classes.dir}"/>
<pathelement location="${org.jboss.esb.ejb3_conf.tests.src.dir}"/>
<fileset dir="${org.jboss.esb.ejb3_embedded.lib.dir}" includes="jboss-ejb3-all.jar hibernate-all.jar thirdparty-all.jar"/>
Added: labs/jbossesb/trunk/product/core/common/tests/resources/etc/jbossesb-test-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/resources/etc/jbossesb-test-properties.xml 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/resources/etc/jbossesb-test-properties.xml 2006-09-27 23:06:40 UTC (rev 6454)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ 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,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: default-jbossesb-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="foobar"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="thishost"/>
+ </properties>
+</esb>
Modified: labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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 2006, 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.soa.esb.common.tests;
import java.sql.Connection;
@@ -30,23 +30,24 @@
import org.apache.log4j.Priority;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import junit.framework.TestCase;
/**
* Base test class for esb test classes, uses jboss logging.
- *
+ *
* @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
- * @version <tt>$Revision:$</tt>
- * $Id:$
+ * @version <tt>$Revision:$</tt> $Id:$
*/
/*
* This should probably use its own property file.
*/
-public class BaseTest extends TestCase {
-
+public class BaseTest extends TestCase
+{
+
/** The Database driver used for unit tests */
public static String DB_DRIVER = "org.jboss.esb.test.db.driver";
@@ -60,99 +61,128 @@
public static String DB_PASSWORD = "org.jboss.esb.test.db.password";
/** The Logger. */
- protected Logger log = Logger.getLogger(getClass());
-
- /** Contains user and or deployment specific paramater */
- public static HashMap<String,String> SYSTEM_PARAMETERS;
- /**
- * Default class constructor.
- */
- public BaseTest() {
- SYSTEM_PARAMETERS = readSystemParameters();
- }
+ protected Logger log = Logger.getLogger(getClass());
- /**
- * Utility constructor.
- * @param name The test name.
- */
- public BaseTest(String name) {
- super(name);
- SYSTEM_PARAMETERS = readSystemParameters();
- }
+ /** Contains user and or deployment specific paramater */
+ public static HashMap<String, String> SYSTEM_PARAMETERS;
- /**
- * Reading system parameter that are set by the ant build when
- * invoking the junit call. The parameter values should be set in
- * the deployment.properties file. If the particular parameter is not
- * found it will receive a default value.
- */
- private HashMap<String,String> readSystemParameters()
- {
- //Reading system parameter
- String dbDriver = Configuration.getPropertyManager().getProperty(DB_DRIVER , "org.hsqldb.jdbcDriver");
- String dbUrl = Configuration.getPropertyManager().getProperty(DB_URL, "jdbc:hsqldb:.");
- String dbUsername = Configuration.getPropertyManager().getProperty(DB_USERNAME, "sa");
- String dbPassword = Configuration.getPropertyManager().getProperty(DB_PASSWORD, "");
- //Setting the paremeters in the HashMap
- HashMap<String,String> systemParameters = new HashMap<String,String>();
- systemParameters.put(DB_DRIVER, dbDriver);
- systemParameters.put(DB_URL, dbUrl);
- systemParameters.put(DB_USERNAME, dbUsername);
- systemParameters.put(DB_PASSWORD, dbPassword);
-
- log.log(Priority.INFO, "DB parameters:");
- log.log(Priority.INFO, "Driver=" + dbDriver);
- log.log(Priority.INFO, "url=" + dbUrl);
- log.log(Priority.INFO, "username=" + dbUsername);
- log.log(Priority.INFO, "password=" + dbPassword);
-
- return systemParameters;
- }
-
- protected String getDbUrl() {
- return SYSTEM_PARAMETERS.get(DB_URL);
- }
-
- protected String getDbUser() {
- return SYSTEM_PARAMETERS.get(DB_USERNAME);
- }
-
- protected String getDbPassword() {
- return SYSTEM_PARAMETERS.get(DB_PASSWORD);
- }
-
- protected String getDbDriver() {
- return SYSTEM_PARAMETERS.get(DB_DRIVER);
- }
-
- public Connection getDbConnection() throws SQLException {
- registerJdbcDriver();
- return DriverManager.getConnection(getDbUrl(), getDbUser(), getDbPassword());
- }
+ /**
+ * Default class constructor.
+ */
+ public BaseTest()
+ {
+ SYSTEM_PARAMETERS = readSystemParameters();
+ }
- public Connection getDbConnection(String username, String password) throws SQLException {
- registerJdbcDriver();
- return DriverManager.getConnection(getDbUrl(), username, password);
+ /**
+ * Utility constructor.
+ *
+ * @param name
+ * The test name.
+ */
+ public BaseTest(String name)
+ {
+ super(name);
+ SYSTEM_PARAMETERS = readSystemParameters();
}
-
- /**
- * Set the test ObjStoreConfigFile location in the classpath/filesystem.
- * @param filePath Classpath/filesystem location.
- */
- public void setObjStoreConfigFile(String filePath) {
- if(filePath == null) {
- Configuration.getPropertyManager().getProperties().remove(Environment.OBJECT_STORE_CONFIG_FILE);
- } else {
- Configuration.getPropertyManager().setProperty(Environment.OBJECT_STORE_CONFIG_FILE, filePath);
- }
- }
- private void registerJdbcDriver() {
- try {
+ /**
+ * Reading system parameter that are set by the ant build when invoking the
+ * junit call. The parameter values should be set in the
+ * deployment.properties file. If the particular parameter is not found it
+ * will receive a default value.
+ */
+ private HashMap<String, String> readSystemParameters()
+ {
+ // Reading system parameter
+ String dbDriver = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+ .getProperty(DB_DRIVER, "org.hsqldb.jdbcDriver");
+ String dbUrl = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+ .getProperty(DB_URL, "jdbc:hsqldb:.");
+ String dbUsername = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+ .getProperty(DB_USERNAME, "sa");
+ String dbPassword = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+ .getProperty(DB_PASSWORD, "");
+
+ // Setting the paremeters in the HashMap
+ HashMap<String, String> systemParameters = new HashMap<String, String>();
+ systemParameters.put(DB_DRIVER, dbDriver);
+ systemParameters.put(DB_URL, dbUrl);
+ systemParameters.put(DB_USERNAME, dbUsername);
+ systemParameters.put(DB_PASSWORD, dbPassword);
+
+ log.log(Priority.INFO, "DB parameters:");
+ log.log(Priority.INFO, "Driver=" + dbDriver);
+ log.log(Priority.INFO, "url=" + dbUrl);
+ log.log(Priority.INFO, "username=" + dbUsername);
+ log.log(Priority.INFO, "password=" + dbPassword);
+
+ return systemParameters;
+ }
+
+ protected String getDbUrl()
+ {
+ return SYSTEM_PARAMETERS.get(DB_URL);
+ }
+
+ protected String getDbUser()
+ {
+ return SYSTEM_PARAMETERS.get(DB_USERNAME);
+ }
+
+ protected String getDbPassword()
+ {
+ return SYSTEM_PARAMETERS.get(DB_PASSWORD);
+ }
+
+ protected String getDbDriver()
+ {
+ return SYSTEM_PARAMETERS.get(DB_DRIVER);
+ }
+
+ public Connection getDbConnection() throws SQLException
+ {
+ registerJdbcDriver();
+ return DriverManager.getConnection(getDbUrl(), getDbUser(),
+ getDbPassword());
+ }
+
+ public Connection getDbConnection(String username, String password)
+ throws SQLException
+ {
+ registerJdbcDriver();
+ return DriverManager.getConnection(getDbUrl(), username, password);
+ }
+
+ /**
+ * Set the test ObjStoreConfigFile location in the classpath/filesystem.
+ *
+ * @param filePath
+ * Classpath/filesystem location.
+ */
+ public void setObjStoreConfigFile(String filePath)
+ {
+ if (filePath == null)
+ {
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties()
+ .remove(Environment.OBJECT_STORE_CONFIG_FILE);
+ } else
+ {
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+ Environment.OBJECT_STORE_CONFIG_FILE, filePath);
+ }
+ }
+
+ private void registerJdbcDriver()
+ {
+ try
+ {
Class.forName(getDbDriver()).newInstance();
- } catch (Exception e) {
+ } catch (Exception e)
+ {
e.printStackTrace();
- fail("JDBC Driver [" + getDbDriver() + "] not available in classpath.");
+ fail("JDBC Driver [" + getDbDriver()
+ + "] not available in classpath.");
}
}
}
Modified: labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/EJBContainerSetup.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -41,6 +41,7 @@
import org.apache.log4j.Logger;
import org.jboss.ejb3.embedded.EJB3StandaloneBootstrap;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
public class EJBContainerSetup extends TestSetup {
@@ -72,7 +73,7 @@
return;
// TODO should not have to do this....
- Configuration.getPropertyManager().setProperty(
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
"javax.security.jacc.PolicyConfigurationFactory.provider",
"org.jboss.security.jacc.JBossPolicyConfigurationFactory");
@@ -85,13 +86,13 @@
EJB3StandaloneBootstrap.deployXmlResource("ejb3-deployment.xml");
EJB3StandaloneBootstrap.deployXmlResource("security-beans.xml");
log.info("scanClasspath: "
- + Configuration.getPropertyManager().getProperty("java.class.path"));
+ + ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty("java.class.path"));
EJB3StandaloneBootstrap.scanClasspath();
// Create InitialContext from jndi.properties
- Configuration.getPropertyManager().setProperty("java.naming.factory.initial",
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty("java.naming.factory.initial",
"org.jnp.interfaces.LocalOnlyContextFactory");
- Configuration.getPropertyManager().setProperty("java.naming.factory.url.pkgs",
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
initialContext = new InitialContext();
@@ -101,7 +102,7 @@
} catch (Exception ex) {
log.error("EJB3 Container Startup Error", ex);
- throw new RuntimeException(ex);
+ // throw new RuntimeException(ex);
}
}
Added: labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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.soa.esb.common.tests.propertymanager;
+
+import junit.framework.ComparisonFailure;
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.common.Environment;
+
+import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
+import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+
+public class PropertyManagerUnitTest extends TestCase
+{
+
+ public void testPropertyManager ()
+ {
+ System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
+
+ PropertyManager corepm = PropertyManagerFactory.getPropertyManager("test.core", "core");
+
+ try
+ {
+ corepm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+
+ fail(e.toString());
+ }
+
+ assertEquals(corepm.getProperty(Environment.JNDI_SERVER_TYPE), "foobar");
+
+ try
+ {
+ assertEquals(corepm.getProperty(Environment.SMTP_HOST), "thishost");
+
+ fail();
+ }
+ catch (ComparisonFailure ex)
+ {
+ }
+ catch (Exception ex)
+ {
+ fail(ex.toString());
+ }
+
+ PropertyManager transportpm = PropertyManagerFactory.getPropertyManager("test.transports", "transports");
+
+ try
+ {
+ transportpm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+
+ fail(e.toString());
+ }
+
+ assertEquals(transportpm.getProperty(Environment.JNDI_SERVER_TYPE), "foobar");
+ assertEquals(transportpm.getProperty(Environment.SMTP_HOST), "thishost");
+ }
+
+}
Modified: labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -21,8 +21,8 @@
*/
package org.jboss.soa.esb.parameters;
-import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import junit.framework.TestCase;
@@ -39,7 +39,7 @@
assertTrue(repo instanceof ParamFileRepository);
ParamRepositoryFactory.reset();
- Configuration.getPropertyManager().setProperty(Environment.PARAMS_REPOS_IMPL_CLASS, TestParamRepo.class.getName());
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(Environment.PARAMS_REPOS_IMPL_CLASS, TestParamRepo.class.getName());
repo = ParamRepositoryFactory.getInstance();
assertTrue(repo instanceof TestParamRepo);
}
Modified: labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/common/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -24,16 +24,20 @@
import java.io.File;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import junit.framework.TestCase;
/**
* ParamFileRepository unit tests.
+ *
* @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
*/
-public class ParamsFileRepositoryUnitTest extends TestCase {
+public class ParamsFileRepositoryUnitTest extends TestCase
+{
- public void test_ParamsFileRepository() throws Exception {
+ public void test_ParamsFileRepository() throws Exception
+ {
File root;
ParamFileRepository fileRepo;
@@ -41,32 +45,38 @@
root = new File("./");
fileRepo = new ParamFileRepository();
assertEquals(root, fileRepo.getRoot());
-
+
// Check it can pick up from the System prop...
root = new File("build/tests/");
- Configuration.getPropertyManager().setProperty(ParamFileRepository.FILE_PARAMS_REPOS_ROOT, root.getPath());
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+ ParamFileRepository.FILE_PARAMS_REPOS_ROOT, root.getPath());
fileRepo = new ParamFileRepository();
assertEquals(root, fileRepo.getRoot());
-
+
// Check for error on invalid System prop...
- Configuration.getPropertyManager().setProperty(ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "blah/blah");
- try {
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+ ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "blah/blah");
+ try
+ {
new ParamFileRepository();
fail("expected IllegalStateException");
- } catch(IllegalStateException e) {
+ } catch (IllegalStateException e)
+ {
// expected
}
}
- public void test_add_get_remove_badargs() throws Exception {
- Configuration.getPropertyManager().setProperty(ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
+ public void test_add_get_remove_badargs() throws Exception
+ {
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+ ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
ParamFileRepository fileRepo = new ParamFileRepository();
-
+
test_add_badargs(fileRepo, null, "val");
test_add_badargs(fileRepo, "", "val");
test_add_badargs(fileRepo, "", "val");
test_add_badargs(fileRepo, "xxx/yyy", null);
-
+
test_get_badargs(fileRepo, null);
test_get_badargs(fileRepo, "");
@@ -74,41 +84,54 @@
test_remove_badargs(fileRepo, "");
}
- private void test_add_badargs(ParamFileRepository fileRepo, String name, String value) throws ParamRepositoryException {
- try {
+ private void test_add_badargs(ParamFileRepository fileRepo, String name,
+ String value) throws ParamRepositoryException
+ {
+ try
+ {
fileRepo.add(name, value);
fail("expected IllegalArgumentException");
- } catch(IllegalArgumentException e) {
+ } catch (IllegalArgumentException e)
+ {
// expected
}
}
- private void test_get_badargs(ParamFileRepository fileRepo, String name) throws ParamRepositoryException {
- try {
+ private void test_get_badargs(ParamFileRepository fileRepo, String name)
+ throws ParamRepositoryException
+ {
+ try
+ {
fileRepo.get(name);
fail("expected IllegalArgumentException");
- } catch(IllegalArgumentException e) {
+ } catch (IllegalArgumentException e)
+ {
// expected
}
}
- private void test_remove_badargs(ParamFileRepository fileRepo, String name) {
- try {
+ private void test_remove_badargs(ParamFileRepository fileRepo, String name)
+ {
+ try
+ {
fileRepo.remove(name);
fail("expected IllegalArgumentException");
- } catch(IllegalArgumentException e) {
+ } catch (IllegalArgumentException e)
+ {
// expected
}
}
- public void test_add_get_remove() throws Exception {
- Configuration.getPropertyManager().setProperty(ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
+ public void test_add_get_remove() throws Exception
+ {
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+ ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
ParamFileRepository fileRepo = new ParamFileRepository();
String name = "repostests/jboss/testparam";
-
+
// Make sure the parameter doesn't already exist...
assertEquals(null, fileRepo.get(name));
-
+
// Now the tests...
assertEquals(null, fileRepo.get(name));
fileRepo.add(name, "tomtestvalue");
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/GpListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/GpListener.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/GpListener.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -40,6 +40,7 @@
import org.jboss.soa.esb.command.JmsCommandQueue;
import org.jboss.soa.esb.common.Configuration;
import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
import org.jboss.soa.esb.helpers.DomElement;
import org.jboss.soa.esb.notification.NotificationList;
import org.jboss.soa.esb.parameters.ParamRepositoryException;
@@ -524,7 +525,7 @@
for (String sCurr : s_saMailProps) {
String sProp = oEmail.getAttr(sCurr);
if (null != sProp)
- Configuration.getPropertyManager().setProperty(sCurr, sProp);
+ ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).setProperty(sCurr, sProp);
}
} // ________________________________
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/nagios/Runner.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/nagios/Runner.java 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/nagios/Runner.java 2006-09-27 23:06:40 UTC (rev 6454)
@@ -1,47 +1,59 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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 2006, 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.soa.esb.nagios;
import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.ModulePropertyManager;
-public class Runner
+/*
+ * Do we still need this stuff?
+ *
+ * TODO
+ */
+
+public class Runner
{
- private static final String MONITOR_PROP = "jbossEsb.nagios.monitor.host";
+ /*
+ * Leave properties here until we determine their utility.
+ */
+
+ private static final String MONITOR_PROP = "org.jboss.soa.esb.nagios.monitor.host";
+
private static final String DEFAULT_HOST = "localhost";
- public static void main(String[] args) {
+ public static void main(String[] args)
+ {
NagiosAgent agent = new NagiosAgent();
agent.setInterval(5000);
- String sNagiosMonitor
- = Configuration.getPropertyManager().getProperty(MONITOR_PROP,DEFAULT_HOST);
+ String sNagiosMonitor = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(
+ MONITOR_PROP, DEFAULT_HOST);
agent.setHost(sNagiosMonitor);
agent.setPort(5667);
agent.start();
- while (true);
-
- }
+ while (true)
+ ;
+ }
}
Modified: labs/jbossesb/trunk/product/core/services/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/services/build.xml 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/services/build.xml 2006-09-27 23:06:40 UTC (rev 6454)
@@ -38,7 +38,7 @@
<!-- =================================================================== -->
<target name="org.jboss.esb.services.init">
<tstamp>
- <format property="TODAY" pattern="d-MM-yy"/>
+ <format property="TODAY" pattern="dd-MM-yy"/>
</tstamp>
</target>
@@ -140,7 +140,4 @@
<ant dir="tests" target="org.jboss.esb.services.internal.test"/>
</target>
-
-
-
</project>
Modified: labs/jbossesb/trunk/product/core/services/tests/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/services/tests/build.xml 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/core/services/tests/build.xml 2006-09-27 23:06:40 UTC (rev 6454)
@@ -1,132 +1,133 @@
-<?xml version="1.0"?>
-<project name="build.services.tests" default="org.jboss.esb.services.tests.compile" basedir=".">
-
- <property file="../../../../config/deployment.properties"/>
-
- <property name="org.jboss.esb.internal.dest" value="${basedir}/../../../build"/>
-
- <property name="org.jboss.esb.module.src.dir" value="../src"/>
- <property name="org.jboss.esb.module.classes.dir" value="${org.jboss.esb.internal.dest}/classes/services"/>
- <property name="org.jboss.esb.module.tests.src.dir" value="${basedir}/src"/>
- <property name="org.jboss.esb.tests.classes.dir" value="${org.jboss.esb.internal.dest}/tests"/>
- <property name="org.jboss.esb.tests.report.dir" value="${org.jboss.esb.internal.dest}/tests/junit"/>
- <property name="org.jboss.esb.root.dir" value="../.."/>
-
- <property environment="env"/>
-
- <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/>
- <property name="org.jboss.esb.ejb3_embedded.lib.dir" value="${org.jboss.esb.root.dir}/../lib/ejb3_embedded"/>
- <property name="org.jboss.esb.ejb3_conf.tests.src.dir" value="${org.jboss.esb.root.dir}/common/tests/resources/conf"/>
- <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client">
- <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
- </condition>
-
- <path id="org.jboss.esb.tests.base.classpath">
- <fileset dir="../${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
- <pathelement location="${org.jboss.esb.module.classes.dir}"/>
- <pathelement location="${org.jboss.esb.internal.dest}/classes/common"/>
- <pathelement location="${org.jboss.esb.ejb3_conf.tests.src.dir}"/>
- <fileset dir="${org.jboss.esb.ejb3_embedded.lib.dir}" includes="*.jar"/>
- </path>
-
- <target name="org.jboss.esb.tests.init">
- <tstamp>
- <format property="TODAY" pattern="d-MM-yy"/>
- </tstamp>
-
- <mkdir dir="${org.jboss.esb.tests.classes.dir}"/>
- <mkdir dir="${org.jboss.esb.tests.report.dir}"/>
- </target>
-
- <target name="clean"/>
-
- <target name="purge" depends="clean">
- <delete dir="${org.jboss.esb.tests.classes.dir}"/>
- </target>
-
- <target name="org.jboss.esb.services.tests.compile" if="org.jboss.esb.buildtests" depends="org.jboss.esb.tests.init">
-
- <javac
- destdir="${org.jboss.esb.tests.classes.dir}"
- classpathref="org.jboss.esb.tests.base.classpath"
- debug="${org.jboss.esb.debug}"
- optimize="${org.jboss.esb.optimize}"
- >
- <src path="${org.jboss.esb.module.tests.src.dir}"/>
- </javac>
-
- </target>
-
- <!-- ====================================================================== -->
- <!-- T E S T -->
- <!-- ====================================================================== -->
- <target name="org.jboss.esb.services.internal.test">
- <property name="org.jboss.esb.module.tests.coverage.dir" value="${org.jboss.esb.internal.dest}/tests/coverage/services"/>
- <property name="org.jboss.esb.module.classes.instr.dir" value="${org.jboss.esb.module.tests.coverage.dir}/instr" />
-
- <delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
- <mkdir dir="${org.jboss.esb.module.tests.coverage.dir}" />
- <!-- emma>
- <instr instrpath="${org.jboss.esb.module.classes.dir}"
- destdir="${org.jboss.esb.module.classes.instr.dir}"
- metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
- </emma -->
-
- <!-- Run the tests -->
- <antcall target="org.jboss.esb.services.internal.test.exec"/>
-
- <!-- Generate the coverage report
- <emma>
- <report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
- <fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
- <include name="*.emma" />
- </fileset>
- <html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
- </report>
- </emma> -->
-
- </target>
-
- <!-- ====================================================================== -->
- <!-- U N I T A N D F U N C T I O N A L T E S T S -->
- <!-- ====================================================================== -->
- <target name="org.jboss.esb.services.internal.test.exec">
- <echo message="Running tests for module"/>
- <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
- <formatter type="plain" usefile="false"/>
- <formatter type="xml"/>
- <batchtest todir="${org.jboss.esb.tests.report.dir}">
- <fileset dir="${org.jboss.esb.module.tests.src.dir}">
- <include name="**/**UnitTest.java"/>
- <include name="**/**FuncTest.java"/>
- </fileset>
- </batchtest>
- <classpath>
- <!-- using instrumented code for code coverage -->
- <!-- pathelement location="${org.jboss.esb.module.classes.instr.dir}"/ -->
- <pathelement location="${org.jboss.esb.tests.classes.dir}"/>
- <!-- Need the tests src folder because there may be non-compiled test resources -->
- <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
- <path refid="org.jboss.esb.tests.base.classpath"/>
-
- </classpath>
- <!-- emma jvm args
- <jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
- <jvmarg value="-Demma.coverage.out.merge=true" /> -->
- <!-- setting system properties -->
- <sysproperty key="org.jboss.esb.db.driver" value="${org.jboss.esb.db.driver}"/>
- <sysproperty key="org.jboss.esb.db.url" value="${org.jboss.esb.db.url}"/>
- <sysproperty key="org.jboss.esb.db.user" value="${org.jboss.esb.db.user}"/>
- <sysproperty key="org.jboss.esb.db.password" value="${org.jboss.esb.db.password}"/>
- <sysproperty key="log4j.configuration" value="log4j.xml"/>
-
- </junit>
- <junitreport>
- <fileset dir="${org.jboss.esb.tests.report.dir}">
- <include name="*.xml"/>
- </fileset>
- <report format="frames" todir="${org.jboss.esb.tests.report.dir}"/>
- <report format="noframes" todir="${org.jboss.esb.tests.report.dir}"/>
- </junitreport>
- </target>
-</project>
+<?xml version="1.0"?>
+<project name="build.services.tests" default="org.jboss.esb.services.tests.compile" basedir=".">
+
+ <property file="../../../../config/deployment.properties"/>
+
+ <property name="org.jboss.esb.internal.dest" value="${basedir}/../../../build"/>
+
+ <property name="org.jboss.esb.module.src.dir" value="../src"/>
+ <property name="org.jboss.esb.module.classes.dir" value="${org.jboss.esb.internal.dest}/classes/services"/>
+ <property name="org.jboss.esb.module.tests.src.dir" value="${basedir}/src"/>
+ <property name="org.jboss.esb.tests.classes.dir" value="${org.jboss.esb.internal.dest}/tests"/>
+ <property name="org.jboss.esb.tests.report.dir" value="${org.jboss.esb.internal.dest}/tests/junit"/>
+ <property name="org.jboss.esb.root.dir" value="../.."/>
+
+ <property environment="env"/>
+
+ <property name="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.root.dir}/lib/ext"/>
+ <property name="org.jboss.esb.ejb3_embedded.lib.dir" value="${org.jboss.esb.root.dir}/../lib/ejb3_embedded"/>
+ <property name="org.jboss.esb.ejb3_conf.tests.src.dir" value="${org.jboss.esb.root.dir}/common/tests/resources/conf"/>
+ <condition property="org.jboss.esb.ext.lib.dir" value="{org.jboss.esb.jboss.home}/client">
+ <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
+ </condition>
+
+ <path id="org.jboss.esb.tests.base.classpath">
+ <fileset dir="../${org.jboss.esb.ext.lib.dir}"
+ includes="*.jar" excludes="jbossall-client.jar"/>
+ <pathelement location="${org.jboss.esb.module.classes.dir}"/>
+ <pathelement location="${org.jboss.esb.internal.dest}/classes/common"/>
+ <pathelement location="${org.jboss.esb.ejb3_conf.tests.src.dir}"/>
+ <fileset dir="${org.jboss.esb.ejb3_embedded.lib.dir}" includes="*.jar"/>
+ </path>
+
+ <target name="org.jboss.esb.tests.init">
+ <tstamp>
+ <format property="TODAY" pattern="d-MM-yy"/>
+ </tstamp>
+
+ <mkdir dir="${org.jboss.esb.tests.classes.dir}"/>
+ <mkdir dir="${org.jboss.esb.tests.report.dir}"/>
+ </target>
+
+ <target name="clean"/>
+
+ <target name="purge" depends="clean">
+ <delete dir="${org.jboss.esb.tests.classes.dir}"/>
+ </target>
+
+ <target name="org.jboss.esb.services.tests.compile" if="org.jboss.esb.buildtests" depends="org.jboss.esb.tests.init">
+
+ <javac
+ destdir="${org.jboss.esb.tests.classes.dir}"
+ classpathref="org.jboss.esb.tests.base.classpath"
+ debug="${org.jboss.esb.debug}"
+ optimize="${org.jboss.esb.optimize}"
+ >
+ <src path="${org.jboss.esb.module.tests.src.dir}"/>
+ </javac>
+
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- T E S T -->
+ <!-- ====================================================================== -->
+ <target name="org.jboss.esb.services.internal.test">
+ <property name="org.jboss.esb.module.tests.coverage.dir" value="${org.jboss.esb.internal.dest}/tests/coverage/services"/>
+ <property name="org.jboss.esb.module.classes.instr.dir" value="${org.jboss.esb.module.tests.coverage.dir}/instr" />
+
+ <delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
+ <mkdir dir="${org.jboss.esb.module.tests.coverage.dir}" />
+ <!-- emma>
+ <instr instrpath="${org.jboss.esb.module.classes.dir}"
+ destdir="${org.jboss.esb.module.classes.instr.dir}"
+ metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
+ </emma -->
+
+ <!-- Run the tests -->
+ <antcall target="org.jboss.esb.services.internal.test.exec"/>
+
+ <!-- Generate the coverage report
+ <emma>
+ <report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
+ <fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
+ <include name="*.emma" />
+ </fileset>
+ <html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
+ </report>
+ </emma> -->
+
+ </target>
+
+ <!-- ====================================================================== -->
+ <!-- U N I T A N D F U N C T I O N A L T E S T S -->
+ <!-- ====================================================================== -->
+ <target name="org.jboss.esb.services.internal.test.exec">
+ <echo message="Running tests for module"/>
+ <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
+ <formatter type="plain" usefile="false"/>
+ <formatter type="xml"/>
+ <batchtest todir="${org.jboss.esb.tests.report.dir}">
+ <fileset dir="${org.jboss.esb.module.tests.src.dir}">
+ <include name="**/**UnitTest.java"/>
+ <include name="**/**FuncTest.java"/>
+ </fileset>
+ </batchtest>
+ <classpath>
+ <!-- using instrumented code for code coverage -->
+ <!-- pathelement location="${org.jboss.esb.module.classes.instr.dir}"/ -->
+ <pathelement location="${org.jboss.esb.tests.classes.dir}"/>
+ <!-- Need the tests src folder because there may be non-compiled test resources -->
+ <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
+ <path refid="org.jboss.esb.tests.base.classpath"/>
+
+ </classpath>
+ <!-- emma jvm args
+ <jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
+ <jvmarg value="-Demma.coverage.out.merge=true" /> -->
+ <!-- setting system properties -->
+ <sysproperty key="org.jboss.esb.db.driver" value="${org.jboss.esb.db.driver}"/>
+ <sysproperty key="org.jboss.esb.db.url" value="${org.jboss.esb.db.url}"/>
+ <sysproperty key="org.jboss.esb.db.user" value="${org.jboss.esb.db.user}"/>
+ <sysproperty key="org.jboss.esb.db.password" value="${org.jboss.esb.db.password}"/>
+ <sysproperty key="log4j.configuration" value="log4j.xml"/>
+
+ </junit>
+ <junitreport>
+ <fileset dir="${org.jboss.esb.tests.report.dir}">
+ <include name="*.xml"/>
+ </fileset>
+ <report format="frames" todir="${org.jboss.esb.tests.report.dir}"/>
+ <report format="noframes" todir="${org.jboss.esb.tests.report.dir}"/>
+ </junitreport>
+ </target>
+</project>
Modified: labs/jbossesb/trunk/product/etc/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/etc/jbossesb-properties.xml 2006-09-27 22:01:44 UTC (rev 6453)
+++ labs/jbossesb/trunk/product/etc/jbossesb-properties.xml 2006-09-27 23:06:40 UTC (rev 6454)
@@ -31,16 +31,31 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
<properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <!-- property name="org.jboss.soa.esb.paramsRepository.class" value="" -->
+ <!-- property name="org.jboss.soa.esb.encryption.factory.class" value="" -->
+ <!-- property name="org.jboss.soa.esb.objStore.configFile" value="" -->
+ </properties>
+ <properties name="transports" depends="core">
<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
<property name="org.jboss.soa.esb.mail.smtp.user" value=""/>
<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
<!-- property name="org.jboss.soa.esb.mail.smtp.from" value="" -->
<!-- property name="org.jboss.soa.esb.mail.smtp.auth" value="" -->
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <!-- property name="org.jboss.soa.esb.paramsRepository.class" value="" -->
- <!-- property name="org.jboss.soa.esb.encryption.factory.class" value="" -->
- <!-- property name="org.jboss.soa.esb.objStore.configFile" value="" -->
</properties>
+ <properties name="connection">
+ <!-- property name="isolation" value="" -->
+ <!-- property name="connection-url" value="" -->
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <!-- property name="connection-pool-class" value="" -->
+ <!-- property name="user-name" value="" -->
+ <!-- property name="password" value="" -->
+ <!-- property name"password-decrypter" value="" -->
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
</esb>
More information about the jboss-svn-commits
mailing list