[jboss-svn-commits] JBL Code SVN: r26285 - in labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2: product/docs and 19 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Apr 28 06:34:17 EDT 2009
Author: kevin.conner at jboss.com
Date: 2009-04-28 06:34:16 -0400 (Tue, 28 Apr 2009)
New Revision: 26285
Removed:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/helloworld_db_registration/
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
Modified:
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/ProgrammersGuide.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/services/Registry.odt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/resources/META-INF/jboss-aop.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/readme.txt
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management-esb/build.xml
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml
Log:
Merge 4.2.1 CP5 to SOA branch
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/build.xml 2009-04-28 10:34:16 UTC (rev 26285)
@@ -37,7 +37,7 @@
<property name="org.jboss.esb.internal.jar.dest" location="build/jbossesb/lib"/>
<!-- JBoss ESB version -->
- <property name="version" value="4.2.1CP4"/>
+ <property name="version" value="4.2.1-CP5"/>
<property name="esb.server.name" value="jbossesb-server-${version}"/>
<property name="esbserver.dist.dir" value="${org.jboss.esb.internal.dest}/${esb.server.name}"/>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/docs/services/Registry.odt
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/java/org/jboss/internal/soa/esb/services/registry/aspect/JUDDIAspect.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -21,6 +21,9 @@
*/
package org.jboss.internal.soa.esb.services.registry.aspect;
+import java.util.Vector;
+
+import org.jboss.aop.joinpoint.MethodCalledByMethodInvocation;
import org.jboss.aop.joinpoint.MethodInvocation;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -29,6 +32,8 @@
/**
* Aspect used to support CDATA sections from within jUDDI.
*
+ * Also intercepts calls for services when constructing the organizational information.
+ *
* @author <a href='mailto:Kevin.Conner at jboss.com'>Kevin Conner</a>
*/
public class JUDDIAspect
@@ -54,4 +59,10 @@
return sb.toString().trim();
}
+
+ public Object fetchServiceByBusinessKey(final MethodCalledByMethodInvocation invocation)
+ throws Throwable
+ {
+ return new Vector<Object>() ;
+ }
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/resources/META-INF/jboss-aop.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/resources/META-INF/jboss-aop.xml 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/aop/resources/META-INF/jboss-aop.xml 2009-04-28 10:34:16 UTC (rev 26285)
@@ -14,5 +14,9 @@
<bind pointcut="execution(* org.apache.juddi.util.xml.XMLUtils->getText(..))">
<advice name="getText" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
</bind>
+
+ <bind pointcut="withincode(* org.apache.juddi.datastore.jdbc.JDBCDataStore->fetchBusiness(..)) AND call(* org.apache.juddi.datastore.jdbc.JDBCDataStore->fetchServiceByBusinessKey(..))">
+ <advice name="fetchServiceByBusinessKey" aspect="org.jboss.internal.soa.esb.services.registry.aspect.JUDDIAspect"/>
+ </bind>
</aop>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/build.xml 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/build.xml 2009-04-28 10:34:16 UTC (rev 26285)
@@ -162,9 +162,13 @@
<aopclasspath path="${org.jboss.esb.rosetta.aop.classes.dir}"/>
</aopc>
<aopc compilerclasspathref="aop-classpath">
- <classpath path="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
+ <classpath>
+ <pathelement path="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
+ <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="commons-logging*.jar"/>
+ </classpath>
<src path="${org.jboss.esb.rosetta.aopc.juddi.classes.dir}"/>
<include name="org/apache/juddi/util/xml/XMLUtils.class"/>
+ <include name="org/apache/juddi/datastore/jdbc/JDBCDataStore.class"/>
<aoppath path="aop/resources/META-INF/jboss-aop.xml"/>
<aopclasspath path="${org.jboss.esb.rosetta.aop.classes.dir}"/>
</aopc>
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsSession.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -56,6 +56,10 @@
* The pool instance id.
*/
private final long id ;
+ /**
+ * The session acknowledge mode.
+ */
+ private final int acknowledgeMode ;
/**
* The set of active queue browsers.
@@ -82,6 +86,7 @@
{
this.id = id ;
this.session = session ;
+ acknowledgeMode = session.getAcknowledgeMode() ;
}
public long getId()
@@ -219,8 +224,7 @@
public int getAcknowledgeMode() throws JMSException
{
- associate() ;
- return session.getAcknowledgeMode();
+ return acknowledgeMode;
}
public MessageListener getMessageListener() throws JMSException
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -92,7 +92,7 @@
ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
Classification classification = blm.createClassification(cScheme, "category", category);
service.addClassification(classification);
- organization.addService(service);
+ service.setProvidingOrganization(organization);
saveRegistryObject(service, jaxrConnectionFactory);
} finally {
jaxrConnectionFactory.closeConnection(connection);
@@ -225,9 +225,9 @@
{
List<String> serviceNames = new ArrayList<String>();
try {
- Collection services = getJBossESBOrganization().getServices();
- for (Iterator i=services.iterator();i.hasNext();) {
- String serviceName = ((Service)i.next()).getName().getValue();
+ Collection<Service> services = findServices();
+ for (Service service: services) {
+ String serviceName = service.getName().getValue();
serviceNames.add(serviceName);
}
} catch (JAXRException je) {
@@ -497,6 +497,31 @@
}
/**
+ * Finds all services for the organization.
+ */
+ @SuppressWarnings("unchecked")
+ protected Collection<Service> findServices() throws JAXRException
+ {
+ Collection<Service> services = new ArrayList<Service>();
+ Connection connection = jaxrConnectionFactory.getConnection();
+ try {
+ // Get registry service and business query manager
+ RegistryService rs = connection.getRegistryService();
+ BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ //Find based upon qualifier type and values
+ logger.log(Level.DEBUG, "Going to query the registry for services");
+ BulkResponse response = bqm.findServices(getJBossESBOrganization().getKey(),
+ null, null, null, null);
+ if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+ services = (Collection<Service>) response.getCollection();
+ }
+ return services;
+ } finally {
+ jaxrConnectionFactory.closeConnection(connection);
+ }
+ }
+
+ /**
* Create a jbossesb organization under which we will register all our services.
*
* @return
@@ -628,14 +653,18 @@
/**
* finds the JBossESB Organizationa and creates one if it is not there.
+ * Note, there are no services associated with this information.
+ *
* @return JBossESB Organization
* @throws JAXRException
*/
- private Organization getJBossESBOrganization() throws JAXRException
+ private synchronized Organization getJBossESBOrganization() throws JAXRException
{
- jbossESBOrganization = findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
if (jbossESBOrganization==null) {
- jbossESBOrganization = createJBossESBOrganization(jaxrConnectionFactory);
+ jbossESBOrganization = findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
+ if (jbossESBOrganization==null) {
+ jbossESBOrganization = createJBossESBOrganization(jaxrConnectionFactory);
+ }
}
return jbossESBOrganization;
}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -1,587 +0,0 @@
-/*
- * 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.internal.soa.esb.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-
-import com.jcraft.jsch.Channel;
-import com.jcraft.jsch.ChannelSftp;
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.SftpATTRS;
-import com.jcraft.jsch.SftpException;
-import com.jcraft.jsch.UserInfo;
-import com.jcraft.jsch.ChannelSftp.LsEntry;
-
-/**
- *
- * Implementation of sftp (Secure FTP over SSH) Based on JSch from JCraft
- * http://www.jcraft.com/
- *
- * @author b_georges
- *
- */
-
-public class SecureFtpImpl implements RemoteFileSystem
-{
-
- private static final Logger _logger = Logger.getLogger(SecureFtpImpl.class);
-
- private static final String TMP_SUFFIX = ".rosettaPart";
-
- private static final String SECURE_CHANNEL = "sftp";
-
- // The objects implementing secure FTP over ssh
- private JSch m_oJSch = new JSch();
-
- private Session session = null;
-
- private Channel m_oChannel = null;
-
- private ChannelSftp m_oSftpChannel = null;
-
- // TODO Add support for certificate. Not for GA though.
- private URL m_oCertificate = null;
-
- @SuppressWarnings("unused")
- private boolean m_bConnected, m_bPassive;
-
- private int m_iPort;
-
- private SFTPEpr m_oEpr;
-
- private ConfigTree m_oParms;
-
- private String m_sFtpServer, m_sUser, m_sPasswd;
-
- private String m_sRemoteDir, m_sLocalDir;
-
- /*
- * Constructor
- *
- * @param p_oP Is a config treeThe used to initialize the object
- *
- * @param connect If true create a new sftp session
- *
- */
- public SecureFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws ConfigurationException, RemoteFileSystemException
- {
- m_oParms = p_oP;
- initialize(p_bConnect);
- }
-
- /*
- * Constructor
- *
- * @param p_oP Is an EPR used to initialize the object
- *
- * @param connect If true create a new sftp session
- *
- */
- public SecureFtpImpl(SFTPEpr p_oP, boolean p_bConnect) throws ConfigurationException, RemoteFileSystemException
- {
-
- m_oEpr = p_oP;
-
- URL url = null;
- try {
- url = m_oEpr.getURL();
- } catch (MalformedURLException e) {
- throw new RemoteFileSystemException(e);
- } catch (URISyntaxException e) {
- throw new RemoteFileSystemException(e);
- }
-
- m_sFtpServer = url.getHost();
-
- String[] sa = null;
-
- if (url.getUserInfo() != null)
- sa = url.getUserInfo().split(":");
-
- if (sa == null)
- sa = new String[] { "", "" };
-
- m_sUser = (sa.length < 1) ? "" : sa[0];
- m_sPasswd = (sa.length < 2) ? "" : sa[1];
-
- m_sRemoteDir = url.getFile();
-
- final String tmpdir = System.getProperty("java.io.tmpdir");
- if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
- m_sRemoteDir = ModulePropertyManager.getPropertyManager(
- ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
- Environment.FTP_REMOTEDIR, tmpdir);
-
- m_iPort = url.getPort();
- if (m_iPort < 0)
- m_iPort = url.getDefaultPort();
-
- m_sLocalDir = ModulePropertyManager.getPropertyManager(
- ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
- Environment.FTP_LOCALDIR, tmpdir);
-
- m_bPassive = false;
-
- try
- {
- m_bPassive = m_oEpr.getPassive();
- } catch (URISyntaxException e)
- {
- _logger.warn(e);
- }
-
- try
- {
- m_oCertificate = m_oEpr.getCertificateURL();
- }
- catch (MalformedURLException ex)
- {
- _logger.error(ex);
-
- throw new ConfigurationException(ex);
- }
- catch (URISyntaxException e)
- {
- _logger.warn(e);
-
- throw new ConfigurationException(e);
- }
-
- // TODO there is still a bit of space for improvements here.
- configTreeFromEpr();
-
- initialize(p_bConnect);
- }
-
- /*
- * Constructor
- *
- * @param attribs The key/value pairs used to initialize the object
- *
- * @param connect If true create a new sftp session using attribs
- *
- */
- public SecureFtpImpl(List<KeyValuePair> attribs, boolean connect)
- throws ConfigurationException, RemoteFileSystemException
- {
- m_oParms = new ConfigTree("fromProps");
- for (KeyValuePair oCurr : attribs)
- m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
- initialize(connect);
- }
-
- private void initialize(boolean bConnect) throws ConfigurationException, RemoteFileSystemException
- {
- checkParms();
-
- if (bConnect)
- {
- try
- {
- session = m_oJSch.getSession(m_sUser, m_sFtpServer, m_iPort);
-
- UserInfo ui = new SecureFtpUserInfo(m_sPasswd);
- session.setUserInfo(ui);
-
- session.connect();
-
- m_oChannel = session.openChannel(SECURE_CHANNEL);
-
- m_oChannel.connect();
-
- m_oSftpChannel = (ChannelSftp) m_oChannel;
-
- for (int i1 = 0; i1 < 10 && !session.isConnected(); i1++)
- {
- try
- {
- Thread.sleep(200); // TODO magic number
- }
- catch (InterruptedException ex)
- {
- // try again?
- }
- }
-
- if (!session.isConnected())
- throw new RemoteFileSystemException("Can't connect to FTP server");
-
- m_bConnected = this.session.isConnected();
- }
- catch (JSchException ex)
- {
- _logger.error("Caught Secure FTP Exception.", ex);
-
- throw new RemoteFileSystemException(ex);
- }
- }
- // TODO set connection Mode [PASSIVE|ACTIVE]using m_bPassive ?
-
- }
-
- private void checkParms() throws ConfigurationException
- {
- m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
- if (null == m_sFtpServer)
- throw new ConfigurationException("No SFTP server specified");
-
- m_sUser = m_oParms.getAttribute(PARMS_USER);
- if (null == m_sUser)
- throw new ConfigurationException("No username specified for SFTP");
-
- m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
- if (null == m_sPasswd)
- throw new ConfigurationException("No password specified for SFTP");
-
- m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
- if (null == m_sRemoteDir)
- m_sRemoteDir = "";
-
- m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
- if (null == m_sLocalDir)
- m_sLocalDir = ".";
-
- String sAux = m_oParms.getAttribute(PARMS_PORT);
-
- try
- {
- m_iPort = (null == sAux) ? 22 : Integer.parseInt(sAux);
- }
- catch (Exception ex)
- {
- throw new ConfigurationException(ex);
- }
-
- m_bPassive = false;
- sAux = m_oParms.getAttribute(PARMS_PASSIVE);
- m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
-
- final String certificate = m_oParms.getAttribute(PARMS_CERTIFICATE) ;
-
- if (certificate != null)
- {
- try
- {
- m_oCertificate = new URL(certificate);
- }
- catch (MalformedURLException ex)
- {
- throw new ConfigurationException(ex);
- }
- }
- }
-
- /*
- * Deletes a file on the SFTP-Server
- *
- * @param fileName The file's Name to be removed from the SFTP-Server
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
- */
- public void deleteRemoteFile(String p_sFile) throws RemoteFileSystemException
- {
- try
- {
- m_oSftpChannel.rm(getRemoteDir() + "/" + new File(p_sFile).getName());
- }
- catch (SftpException ex)
- {
- throw new RemoteFileSystemException(ex);
- }
- }
-
- /*
- * Deletes a file on the SFTP-Server
- *
- * @param fileName The file to be removed from the SFTP-Server
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
- */
- public void remoteDelete(File p_oFile) throws RemoteFileSystemException
- {
- try
- {
- m_oSftpChannel.rm(FtpUtils.fileToFtpString(p_oFile));
- }
- catch (SftpException ex)
- {
- throw new RemoteFileSystemException(ex);
- }
- }
-
- /*
- * Returns a list of Filenames for the directory specified in p_Suffix
- *
- * @param p_sSuffix The remote directory path from the SFTP-Server
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
- */
- public String[] getFileListFromRemoteDir(String p_sSuffix) throws RemoteFileSystemException
- {
- try
- {
- String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
- List<String> lFileList = new ArrayList<String>();
- Vector vFileList = m_oSftpChannel.ls(sSuffix);
-
- if (vFileList != null)
- {
- for (int i = 0; i < vFileList.size(); i++)
- {
- Object obj = vFileList.elementAt(i);
-
- if (obj instanceof LsEntry)
- {
- SftpATTRS oSftAttr = ((LsEntry) obj).getAttrs();
- if (!oSftAttr.isDir())
- {
- lFileList.add(((LsEntry) obj).getFilename());
- }
- }
- }
- }
-
- return (String[]) lFileList.toArray(new String[lFileList.size()]);
- }
- catch (SftpException ex)
- {
- throw new RemoteFileSystemException(ex);
- }
- }
-
- /*
- * Set the new directory to p_SDir
- *
- * @param p_sDir The remote directory path name we want to "cd" to.
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
- */
- public void setRemoteDir(String p_sDir) throws RemoteFileSystemException
- {
- try
- {
- m_oSftpChannel.cd(p_sDir);
- }
- catch (SftpException ex)
- {
- throw new RemoteFileSystemException(ex);
- }
- }
-
- /*
- * Rename the Remote Directory name p_sFrom with p_sTo
- *
- * @param p_sFrom The remote directory name we want to rename
- *
- * @param p_sTo The new remote directory name
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#renameInRemoteDir(java.lang.String,
- * java.lang.String)
- */
- public void renameInRemoteDir(String p_sFrom, String p_sTo)
- throws RemoteFileSystemException
- {
-
- String sRmtFrom = new File(p_sFrom).getName();
- String sRmtTo = new File(p_sTo).getName();
-
- try
- {
- m_oSftpChannel.rename(getRemoteDir() + "/" + sRmtFrom,
- getRemoteDir() + "/" + sRmtTo);
- }
- catch (Exception e)
- {
- String sMess = this.getClass().getSimpleName()
- + " can't rename in remote directory <" + e.getMessage()
- + ">";
- throw new RemoteFileSystemException(sMess);
- }
- }
-
- /*
- * Rename the Remote File name p_sFrom with p_sTo
- *
- * @param p_oFrom The remote file name we want to rename
- *
- * @param p_oTo The new remote file name
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
- * java.io.File)
- */
- public void remoteRename(File p_oFrom, File p_oTo) throws RemoteFileSystemException
- {
- try
- {
- m_oSftpChannel.rename(FtpUtils.fileToFtpString(p_oFrom), FtpUtils
- .fileToFtpString(p_oTo));
- }
- catch (Exception e)
- {
- String sMess = this.getClass().getSimpleName()
- + " can't rename in remote directory <" + e.getMessage()
- + ">";
- throw new RemoteFileSystemException(sMess);
- }
- }
-
- /*
- * Upload the local File p_ofile to p_sRemoteName
- *
- * @param p_oFile The local file name we want to upload
- *
- * @param p_sRemoteName The remote file name [can be the same as p_oFile of
- * course]
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
- * java.lang.String)
- */
- public void uploadFile(File p_oFile, String p_sRemoteName) throws RemoteFileSystemException
- {
- try
- {
- String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
- String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
- m_oSftpChannel.put(FtpUtils.fileToFtpString(p_oFile), sRemoteTmp);
- m_oSftpChannel.rename(sRemoteTmp, sRemoteOK);
- }
- catch (SftpException ex)
- {
- throw new RemoteFileSystemException(ex);
- }
- }
-
- /*
- * Download the remote File p_sFile to p_sFile.
- *
- * @param p_sFile The remote file name we want to download
- *
- * @param p_sFinalName The local file name
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#downloadFile(java.lang.String,
- * java.lang.String)
- */
- public void downloadFile(String p_sFile, String p_sFinalName) throws IOException, RemoteFileSystemException
- {
- File oLocalDir = new File(m_sLocalDir);
- File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
-
- try
- {
- oLclFile.delete();
- }
- catch (Exception e)
- {
- _logger.warn("Could not delete file: "+oLclFile, e);
- }
- // TODO check if we have to set the Transfer Type with JSch impl =>
- // m_oXferType
-
- try
- {
- m_oSftpChannel.get(p_sFile, FtpUtils.fileToFtpString(oLclFile));
-
- File oNew = new File(oLocalDir, p_sFinalName);
- if (oNew.exists())
- oNew.delete();
- FileUtil.renameTo(oLclFile, oNew);
- }
- catch (Exception ex)
- {
- throw new RemoteFileSystemException(ex);
- }
- }
-
- /*
- * Returns the current remote directory
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
- */
- public String getRemoteDir()
- {
- return m_sRemoteDir;
- }
-
- /*
- * Terminates the sftp session.
- *
- * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
- */
- public void quit()
- {
- m_oSftpChannel.quit();
- }
-
- private void configTreeFromEpr() throws ConfigurationException
- {
- m_oParms = new ConfigTree("fromEpr");
- try
- {
- m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
- m_sFtpServer);
- m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
- m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
- m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
- m_sRemoteDir);
- m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
- .toString(m_iPort));
- m_oParms.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
- m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
- .toString(false));
- m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
- .toString(m_bPassive));
- if (m_oCertificate != null)
- {
- m_oParms.setAttribute(RemoteFileSystem.PARMS_CERTIFICATE, m_oCertificate.toString());
- }
- }
- catch (Exception e)
- {
- throw new ConfigurationException(e);
- }
- }
-
-}
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -1,103 +0,0 @@
-/*
- * 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.internal.soa.esb.util;
-
-import com.jcraft.jsch.UserInfo;
-
-/**
- * @author geo
- *
- */
-public class SecureFtpUserInfo implements UserInfo {
-
- /** The user-password */
- String password = null;
-
- /**
- * Constructor
- *
- * @param password
- * The users password.
- */
- public SecureFtpUserInfo(String password) {
- this.password = password;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.jcraft.jsch.UserInfo#getPassphrase()
- */
- public String getPassphrase() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.jcraft.jsch.UserInfo#getPassword()
- */
- public String getPassword() {
- return password;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.jcraft.jsch.UserInfo#promptPassphrase(java.lang.String)
- */
- public boolean promptPassphrase(String arg0) {
- return false;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.jcraft.jsch.UserInfo#promptPassword(java.lang.String)
- */
- public boolean promptPassword(String arg0) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.jcraft.jsch.UserInfo#promptYesNo(java.lang.String)
- */
- public boolean promptYesNo(String arg0) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see com.jcraft.jsch.UserInfo#showMessage(java.lang.String)
- */
- public void showMessage(String arg0) {
-
- }
-
-}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -516,6 +516,7 @@
addr.setAddress(getJmsAddress(uri, name));
addr.addExtension(DESTINATION_TYPE_TAG, destinationType);
+ addr.addExtension(DESTINATION_NAME_TAG, destinationName);
addr.addExtension(SPECIFICATION_VERSION_TAG, protocol);
@@ -580,6 +581,11 @@
public final String getDestinationName() throws URISyntaxException
{
+ final String name = getAddr().getExtensionValue(DESTINATION_NAME_TAG);
+ if (name != null)
+ {
+ return name ;
+ }
URI uri = new URI(getAddr().getAddress());
return uri.getPath().substring(1);
@@ -701,16 +707,8 @@
private String getJmsAddress(final String uri, final String name)
{
try {
- final URI uriVal = new URI(uri) ;
- final String host = uriVal.getHost() ;
- if (host != null) {
- final int port = uriVal.getPort() ;
- if (port > 0) {
- return JMS_PROTOCOL + PROTOCOL_SEPARATOR + host + ":" + port + "/" + name;
- } else {
- return JMS_PROTOCOL + PROTOCOL_SEPARATOR + host + "/" + name;
- }
- }
+ final URI result = new URI(JMS_PROTOCOL, uri, name) ;
+ return result.toString() ;
} catch (final URISyntaxException urise) {}
return JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name;
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -139,7 +139,7 @@
* Register the courier as part of the current set.
* @param courier The current courier.
*/
- private static synchronized void registerCourier(final TwoWayCourier courier)
+ private static void registerCourier(final TwoWayCourier courier)
throws CourierException
{
final Exception ex ;
@@ -151,25 +151,37 @@
{
ex = null ;
}
+ final Map<TwoWayCourier, Exception> map ;
try
{
- lifecycleCouriers.getLifecycleResource().put(courier, ex) ;
+ map = lifecycleCouriers.getLifecycleResource() ;
}
catch (final LifecycleResourceException lre)
{
throw new CourierException("Unexpected lifecycle resource exception while registering courier", lre) ;
}
+
+ synchronized(map)
+ {
+ map.put(courier, ex) ;
+ }
}
/**
* Deregister the courier from the current set.
* @param courier The current courier.
*/
- public static synchronized void deregisterCourier(final TwoWayCourier courier)
+ public static void deregisterCourier(final TwoWayCourier courier)
{
+ final Map<TwoWayCourier, Exception> map ;
try
{
- lifecycleCouriers.getLifecycleResource().remove(courier) ;
+ map = lifecycleCouriers.getLifecycleResource() ;
+
+ synchronized(map)
+ {
+ map.remove(courier) ;
+ }
}
catch (final LifecycleResourceException lre)
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -218,7 +218,7 @@
}
if (listener.getMaxThreads() > 0)
{
- addPropertyElement(activationConfigElement, "maxMessages", Integer.toString(listener.getMaxThreads())) ;
+ addPropertyElement(activationConfigElement, "maxSession", Integer.toString(listener.getMaxThreads())) ;
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -283,7 +283,7 @@
_inputDirectory = fileFromString(sInpDir);
seeIfOkToWorkOnDir(_inputDirectory);
- _inputSuffix = config.getRequiredAttribute(ListenerTagNames.FILE_INPUT_SFX_TAG).trim();
+ _inputSuffix = ListenerUtil.getValue(config, ListenerTagNames.FILE_INPUT_SFX_TAG, "").trim();
checkInputSuffix();
// WORK suffix (will rename in input directory)
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -341,10 +341,13 @@
throw new ConfigurationException(
"A valid inProcessField attribute must be specified");
_timestamp = ListenerUtil.getValue(_config,
- JDBCEpr.TIMESTAMP_COLUMN_TAG, "");
- if (_timestamp.trim().length() < 1)
+ JDBCEpr.TIMESTAMP_COLUMN_TAG);
+ if ((_timestamp == null) || (_timestamp.trim().length() == 0))
+ {
_logger.debug("No value specified for: "
+ ListenerTagNames.SQL_TIMESTAMP_TAG);
+ _timestamp = null ;
+ }
_where = ListenerUtil.getValue(_config,
ListenerTagNames.SQL_WHERE_CONDITION_TAG, "");
if (_where.trim().length() < 1)
@@ -604,7 +607,7 @@
protected String updateStatement() {
StringBuilder sb = new StringBuilder().append("update ").append(
_tableName).append(" set ").append(_inProcessField).append(" = ? ");
- if (_timestamp.trim().length() < 1) {
+ if (_timestamp != null) {
sb.append(", " + _timestamp + " = ? ");
}
sb.append("where ").append(_inProcessField).append(" = ?");
@@ -701,7 +704,7 @@
try {
int iParm = 3;
- if (_timestamp.trim().length() < 1) {
+ if (_timestamp != null) {
iParm++;
}
@@ -734,7 +737,7 @@
try {
int counter = 1;
_PSupdate.setString(counter++, getStatus(toState));
- if (_timestamp.trim().length() < 1) {
+ if (_timestamp != null) {
Date now = new Date();
_PSupdate.setString(counter++, now.toString());
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -27,7 +27,6 @@
import java.net.URL;
import org.jboss.internal.soa.esb.util.EdtFtpImpl;
-import org.jboss.internal.soa.esb.util.SecureFtpImpl;
import org.jboss.soa.esb.addressing.eprs.FTPEpr;
import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
@@ -60,7 +59,7 @@
if (url.getProtocol().equals(RemoteFileSystem.FTP_PROTOCOL))
return new EdtFtpImpl((FTPEpr) p_oEpr, p_bConnect);
else if (url.getProtocol().equals(RemoteFileSystem.SFTP_PROTOCOL))
- return new SecureFtpImpl((SFTPEpr) p_oEpr, p_bConnect);
+ throw new RemoteFileSystemException("Not supported.");
} catch (MalformedURLException e)
{
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/JMSEprUnitTest.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -206,20 +206,20 @@
// should default address to system property
final JMSEpr firstEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
queueName, "connection", null, null, true, null, null, null, true) ;
- assertEquals("System JNDI_SERVER_URL", "jms://" + defaultProvider + "/" + queueName, firstEpr.getAddr().getAddress()) ;
+ assertEquals("System JNDI_SERVER_URL", "jms:" + JNDI_PREFIX + defaultProvider + "#" + queueName, firstEpr.getAddr().getAddress()) ;
// should use Provider URL extension
final Properties environment = new Properties() ;
environment.setProperty(Context.PROVIDER_URL, JNDI_PREFIX + extensionProvider) ;
final JMSEpr secondEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
queueName, "connection", environment, null, true, null, null, null, true) ;
- assertEquals("Extension Context.PROVIDER_URL", "jms://" + extensionProvider + "/" + queueName, secondEpr.getAddr().getAddress()) ;
+ assertEquals("Extension Context.PROVIDER_URL", "jms:" + JNDI_PREFIX + extensionProvider + "#" + queueName, secondEpr.getAddr().getAddress()) ;
// should use jndi-URL property
environment.setProperty(JNDI_URL_TAG, JNDI_PREFIX + propertyJndi) ;
final JMSEpr thirdEpr = new JMSEpr(ONE_ONE_PROTOCOL, expectedDestinationType,
queueName, "connection", environment, null, true, null, null, null, true) ;
- assertEquals("Extension Context.PROVIDER_URL", "jms://" + propertyJndi + "/" + queueName, thirdEpr.getAddr().getAddress()) ;
+ assertEquals("Extension Context.PROVIDER_URL", "jms:" + JNDI_PREFIX + propertyJndi + "#" + queueName, thirdEpr.getAddr().getAddress()) ;
}
finally
{
@@ -281,6 +281,46 @@
assertEquals( transacted, jmsEpr.getTransacted() );
}
+ @Test
+ public void testDefaultURIConfig()
+ throws URISyntaxException
+ {
+ testEPRConfig(JMSEpr.QUEUE_TYPE, "queue/destinationName",
+ "ConnectionFactory", "jnp://localhost:1099",
+ "org.jnp.interfaces.NamingContextFactory",
+ "org.jboss.naming:org.jnp.interfaces") ;
+ }
+
+ @Test
+ public void testNonStandardURIConfig()
+ throws URISyntaxException
+ {
+ testEPRConfig(JMSEpr.QUEUE_TYPE, "abc/def/ghi",
+ "ConnectionFactory", "scheme://host:port/config#123456?abc=def",
+ "MyNonStandardContextFactory", "MyPkgInterfaces") ;
+ }
+
+ private void testEPRConfig(final String destinationType, final String destinationName,
+ final String connectionFactory, final String jndiURL, final String contextFactory,
+ final String pkgPrefix)
+ throws URISyntaxException
+ {
+ final Properties env = new Properties() ;
+ env.put(Context.PROVIDER_URL, jndiURL) ;
+ env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory) ;
+ env.put(Context.URL_PKG_PREFIXES, pkgPrefix) ;
+
+ final JMSEpr jmsEpr = new JMSEpr(destinationType, destinationName, connectionFactory, env, null) ;
+ assertEquals("destinationType", destinationType, jmsEpr.getDestinationType()) ;
+ assertEquals("destinationName", destinationName, jmsEpr.getDestinationName()) ;
+ assertEquals("connectionFactory", connectionFactory, jmsEpr.getConnectionFactory()) ;
+
+ final Properties jmsEprEnv = jmsEpr.getJndiEnvironment() ;
+ assertEquals(Context.PROVIDER_URL, jndiURL, jmsEprEnv.getProperty(Context.PROVIDER_URL)) ;
+ assertEquals(Context.INITIAL_CONTEXT_FACTORY, contextFactory, jmsEprEnv.getProperty(Context.INITIAL_CONTEXT_FACTORY)) ;
+ assertEquals(Context.URL_PKG_PREFIXES, pkgPrefix, jmsEprEnv.getProperty(Context.URL_PKG_PREFIXES)) ;
+ }
+
private void assertDefaults(final String destination, final String connectionFactory, final String destinationType)
{
assertEquals( expectedDestination, destination );
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/DefaultESBPropertiesSetterUnitTest.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -96,7 +96,7 @@
final EPR replyToEPR = toESBMessage.getHeader().getCall().getReplyTo();
- assertEquals( "jms://localhost/testDest", replyToEPR.getAddr().getAddress() );
+ assertEquals( "jms:localhost#testDest", replyToEPR.getAddr().getAddress() );
final String connectionFactory = replyToEPR.getAddr().getExtensionValue( JMSEpr.CONNECTION_FACTORY_TAG );
assertEquals ( "ConnectionFactory", connectionFactory );
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/readme.txt
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/readme.txt 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/samples/quickstarts/readme.txt 2009-04-28 10:34:16 UTC (rev 26285)
@@ -31,8 +31,6 @@
This process will add the JBoss ESB artifacts to your JBoss Application
Server.
- Almost all of these examples use RMI-based registration.
- "helloworld_db_registration" makes a client/server connection to the registry
- database. It assumes a MySQL DB holds the registry.
The following is a brief outline of some of the various quickstarts. If this is
your first time working with the JBoss ESB we recommend at least trying
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management-esb/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management-esb/build.xml 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/product/tools/console/management-esb/build.xml 2009-04-28 10:34:16 UTC (rev 26285)
@@ -14,7 +14,6 @@
<!-- Default deploy property settings for the jbossesb-server -->
<property name="org.jboss.esb.server.home" value="${product.dir}"/>
- <property name="org.jboss.esb.server.config" value="default"/>
<target name="clean">
<delete dir="${mgmt.esb.dir}/build"/>
@@ -22,9 +21,36 @@
<ant dir="${console.dir}/management" target="clean"/>
</target>
- <target name="messaging-config">
- <property name="org.jboss.esb.server.deploy.dir"
- value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy"/>
+ <target name="initialise-config" unless="org.jboss.esb.server.config">
+ <condition property="jbossesb-server-production">
+ <available file="${org.jboss.esb.server.home}/server/production/deploy/jbossesb.sar"/>
+ </condition>
+ <condition property="jbossesb-server-default">
+ <available file="${org.jboss.esb.server.home}/server/default/deploy/jbossesb.sar"/>
+ </condition>
+
+ <condition property="jbossesb-server-recognised">
+ <or>
+ <isset property="jbossesb-server-production"/>
+ <isset property="jbossesb-server-default"/>
+ </or>
+ </condition>
+
+ <fail unless="jbossesb-server-recognised" message="Could not detect default ESB server instance"/>
+
+ <condition property="org.jboss.esb.server.config"
+ value="production">
+ <isset property="jbossesb-server-production"/>
+ </condition>
+ <condition property="org.jboss.esb.server.config"
+ value="default">
+ <isset property="jbossesb-server-default"/>
+ </condition>
+ </target>
+
+ <target name="initialise-messaging" depends="initialise-config">
+ <property name="org.jboss.esb.server.deploy.dir"
+ value="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy"/>
<condition property="messaging.present">
<available file="${org.jboss.esb.server.deploy.dir}/jboss-messaging"/>
@@ -69,7 +95,7 @@
</copy>
</target>
- <target name="esb" depends="messaging-config,messaging-dependencies,jbossmq-dependencies,build-war,copy-metainf"
+ <target name="esb" depends="initialise-messaging,messaging-dependencies,jbossmq-dependencies,build-war,copy-metainf"
description="Build the management ESB">
<mkdir dir="${mgmt.esb.dir}/build"/>
<mkdir dir="${mgmt.esb.dir}/build/META-INF"/>
@@ -107,7 +133,7 @@
</jar>
</target>
- <target name="copy-datasource" if="management.ds.available">
+ <target name="copy-datasource" if="management.ds.available" depends="initialise-config">
<filter token="db.username" value="${db.username}"/>
<filter token="db.password" value="${db.password}"/>
<copy file="${mgmt.esb.dir}/src/main/resources/${db}/management-ds.xml" todir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy" filtering="true" overwrite="true"/>
@@ -116,4 +142,4 @@
<target name="deploy" depends="esb,copy-datasource" description="Deploy the WAR">
<copy file="${mgmt.esb.dir}/build/management.esb" todir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy" overwrite="true"/>
</target>
-</project>
+</project>
\ No newline at end of file
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServer.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -22,6 +22,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collection;
+import java.util.List;
import javax.xml.registry.BulkResponse;
import javax.xml.registry.BusinessQueryManager;
@@ -29,6 +30,7 @@
import javax.xml.registry.JAXRException;
import javax.xml.registry.JAXRResponse;
import javax.xml.registry.RegistryService;
+import javax.xml.registry.infomodel.Organization;
import javax.xml.registry.infomodel.Service;
import javax.xml.registry.infomodel.ServiceBinding;
@@ -101,6 +103,30 @@
return null ;
}
+ public String verifyServiceRetrieval()
+ throws RegistryException
+ {
+ final Registry registry = RegistryFactory.getRegistry() ;
+ final List<String> services = registry.findAllServices() ;
+ if ((services == null) || (services.size() == 0))
+ {
+ return "No services returned from query" ;
+ }
+ return null ;
+ }
+
+ public String verifyOrganizationalStructure()
+ throws RegistryException, JAXRException
+ {
+ final Organization jbossESBOrganization = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", new JAXRConnectionFactory());
+ final Collection<Service> services = jbossESBOrganization.getServices() ;
+ if ((services != null) & (services.size() > 0))
+ {
+ return "Services returned in organization information" ;
+ }
+ return null ;
+ }
+
private String verifyHeuristic(final String value)
{
final char[] contents = value.toCharArray() ;
@@ -144,33 +170,40 @@
final ScoutConnectionFactory scoutConnectionFactory = new ScoutConnectionFactory() ;
final Connection connection = scoutConnectionFactory.getConnection();
- final RegistryService rs = connection.getRegistryService();
- final BusinessQueryManager bqm = rs.getBusinessQueryManager();
- final BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),null,null,null);
- if (bulkResponse.getStatus()!=JAXRResponse.STATUS_SUCCESS)
+ try
{
- return "findServiceBindings failed" ;
- }
- final Collection<ServiceBinding> serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
- if ((serviceBindings == null) || (serviceBindings.size() == 0))
- {
- return "could not find service bindings for DeadLetterService" ;
- }
-
- for(ServiceBinding serviceBinding: serviceBindings)
- {
- final Service bindingService = serviceBinding.getService() ;
- if (bindingService == null)
+ final RegistryService rs = connection.getRegistryService();
+ final BusinessQueryManager bqm = rs.getBusinessQueryManager();
+ final BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),null,null,null);
+ if (bulkResponse.getStatus()!=JAXRResponse.STATUS_SUCCESS)
{
- return "Could not find service associated with binding" ;
+ return "findServiceBindings failed" ;
}
- if (bindingService.getProvidingOrganization() != null)
+ final Collection<ServiceBinding> serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
+ if ((serviceBindings == null) || (serviceBindings.size() == 0))
{
- return "FAILED: Organization is present in service binding" ;
+ return "could not find service bindings for DeadLetterService" ;
}
+
+ for(ServiceBinding serviceBinding: serviceBindings)
+ {
+ final Service bindingService = serviceBinding.getService() ;
+ if (bindingService == null)
+ {
+ return "Could not find service associated with binding" ;
+ }
+ if (bindingService.getProvidingOrganization() != null)
+ {
+ return "FAILED: Organization is present in service binding" ;
+ }
+ }
+
+ return null ;
}
-
- return null ;
+ finally
+ {
+ scoutConnectionFactory.closeConnection(connection) ;
+ }
}
}
@@ -185,5 +218,10 @@
{
return super.getConnection() ;
}
+
+ public void closeConnection(Connection connection)
+ {
+ super.closeConnection(connection) ;
+ }
}
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPServerMBean.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -40,4 +40,10 @@
public String verifyJUDDICDataIssue()
throws RegistryException, MarshalException, ServiceNotFoundException ;
+
+ public String verifyServiceRetrieval()
+ throws RegistryException ;
+
+ public String verifyOrganizationalStructure()
+ throws RegistryException, JAXRException ;
}
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/junit/src/org/jboss/soa/esb/server/aop/AOPUnitTest.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -75,6 +75,34 @@
}
/**
+ * Test service retrieval.
+ * @throws Exception For any failures.
+ */
+ public void testServiceRetrievalIssue()
+ throws Exception
+ {
+ final String result = (String)execute("verifyServiceRetrieval", null, null) ;
+ if (result != null)
+ {
+ fail(result) ;
+ }
+ }
+
+ /**
+ * Test for scout performance issue.
+ * @throws Exception For any failures.
+ */
+ public void testOrganizationalStructureIssue()
+ throws Exception
+ {
+ final String result = (String)execute("verifyOrganizationalStructure", null, null) ;
+ if (result != null)
+ {
+ fail(result) ;
+ }
+ }
+
+ /**
* Execute the specified method on the mbean.
* @param method The method name.
* @param values The parmeter values.
Modified: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/build.xml 2009-04-28 10:34:16 UTC (rev 26285)
@@ -63,7 +63,6 @@
<include name="fun_cbr/lib/**/*.jar"/>
<include name="helloworld/lib/**/*.jar"/>
<include name="helloworld_action/lib/**/*.jar"/>
- <include name="helloworld_db_registration/lib/**/*.jar"/>
<include name="helloworld_file_action/lib/**/*.jar"/>
<include name="helloworld_sql_action/lib/**/*.jar"/>
<include name="recipient_list/lib/**/*.jar"/>
@@ -95,7 +94,6 @@
<include name="groovy_gateway/build/classes"/>
<include name="helloworld/build/classes"/>
<include name="helloworld_action/build/classes"/>
- <include name="helloworld_db_registration/build/classes"/>
<include name="helloworld_file_action/build/classes"/>
<include name="helloworld_file_notifier/build/classes"/>
<include name="helloworld_sql_action/build/classes"/>
@@ -199,7 +197,6 @@
<exec-quickstart quickstart="groovy_gateway" target="clean"/>
<exec-quickstart quickstart="helloworld" target="clean"/>
<exec-quickstart quickstart="helloworld_action" target="clean"/>
- <exec-quickstart quickstart="helloworld_db_registration" target="clean"/>
<exec-quickstart quickstart="helloworld_file_action" target="clean"/>
<exec-quickstart quickstart="helloworld_file_notifier" target="clean"/>
<exec-quickstart quickstart="helloworld_sql_action" target="clean"/>
@@ -243,7 +240,6 @@
<exec-quickstart quickstart="groovy_gateway" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_action" target="prepare-deployment"/>
- <exec-quickstart quickstart="helloworld_db_registration" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_file_action" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_file_notifier" target="prepare-deployment"/>
<exec-quickstart quickstart="helloworld_sql_action" target="prepare-deployment"/>
@@ -283,7 +279,6 @@
<include name="groovy_gateway/build/*.esb"/>
<include name="helloworld/build/*.esb"/>
<include name="helloworld_action/build/*.esb"/>
- <include name="helloworld_db_registration/build/*.esb"/>
<include name="helloworld_file_action/build/*.esb"/>
<include name="helloworld_file_notifier/build/*.esb"/>
<include name="helloworld_sql_action/build/*.esb"/>
Deleted: labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java
===================================================================
--- labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2009-04-28 10:14:09 UTC (rev 26284)
+++ labs/jbossesb/workspace/platform/JBESB_4_2_1_SOA_4_2/qa/quickstarts/src/org/jboss/soa/esb/quickstart/test/HelloWorldDBRegistrationTest.java 2009-04-28 10:34:16 UTC (rev 26285)
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-package org.jboss.soa.esb.quickstart.test;
-
-import junit.framework.Test;
-
-import org.jboss.soa.esb.samples.quickstart.helloworlddbregistration.test.SendJMSMessage;
-
-/**
- * CI test for the helloworlddbregistration quickstart.
- *
- * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
- */
-public class HelloWorldDBRegistrationTest extends AbstractQuickstartTestCase {
- private static final String JMS_MESSAGE = "HelloWorldDBRegistrationTest message";
-
- public HelloWorldDBRegistrationTest(String name) {
- super(name);
- }
-
- public void testMessage() throws Exception {
- clearMessages() ;
- sendMessage() ;
- checkMessages(30000, JMS_MESSAGE) ;
- }
-
- public void sendMessage() throws Exception {
- SendJMSMessage sm = new SendJMSMessage();
- sm.setupConnection();
- sm.sendAMessage(JMS_MESSAGE);
- sm.stop();
- }
-
- public static Test suite() throws Exception {
- return getDeploySetup(HelloWorldDBRegistrationTest.class,
- "QuickstartMessageStoreServer.sar, Quickstart_db_registration.esb");
- }
-}
More information about the jboss-svn-commits
mailing list