Author: ritchiem
Date: Thu Jan 25 07:08:28 2007
New Revision: 499813
URL: http://svn.apache.org/viewvc?view=rev&rev=499813
Log:
Revision: 495550
Author: bhupendrab
Date: 11:00:49, 12 January 2007
Message:
QPID-279
Nuno Santos provided a patch for running the management console on linux. Baes
on that these scripts are created to run on linux with different windowing
system
----
Modified :
/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
Added :
/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
Added :
/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
Modified :
/incubator/qpid/trunk/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
Revision: 495517
Author: ritchiem
Date: 08:52:31, 12 January 2007
Message:
QPID-282
Updated AMQConnection and AMQBrokerDetails to check the host:port and add
tcp:// if there is no protocol specified.
----
Modified :
/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
Modified :
/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
Modified :
/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
Modified :
/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
Added:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
(with props)
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
(with props)
Modified:
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
incubator/qpid/branches/perftesting/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
Modified:
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java?view=diff&rev=499813&r1=499812&r2=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
(original)
+++
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
Thu Jan 25 07:08:28 2007
@@ -334,4 +334,15 @@
}
+ public static String checkTransport(String broker)
+ {
+ if ((!broker.contains("://")))
+ {
+ return "tcp://" + broker;
+ }
+ else
+ {
+ return broker;
+ }
+ }
}
Modified:
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java?view=diff&rev=499813&r1=499812&r2=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
(original)
+++
incubator/qpid/branches/perftesting/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
Thu Jan 25 07:08:28 2007
@@ -150,8 +150,8 @@
{
this(new AMQConnectionURL(ConnectionURL.AMQ_PROTOCOL + "://" +
username + ":" + password + "@" +
- (clientName==null?"":clientName) +
- virtualHost + "?brokerlist='" + broker +
"'"));
+ (clientName == null ? "" : clientName) +
+ virtualHost + "?brokerlist='" +
AMQBrokerDetails.checkTransport(broker) + "'"));
}
public AMQConnection(String host, int port, String username, String
password,
@@ -166,12 +166,12 @@
this(new AMQConnectionURL(useSSL ?
ConnectionURL.AMQ_PROTOCOL + "://" +
username + ":" + password + "@" +
- (clientName==null?"":clientName) +
+ (clientName == null ? "" : clientName) +
virtualHost + "?brokerlist='tcp://" + host +
":" + port + "'"
+ "," + ConnectionURL.OPTIONS_SSL +
"='true'" :
ConnectionURL.AMQ_PROTOCOL + "://" +
username + ":" + password + "@" +
-
(clientName==null?"":clientName) +
+
(clientName == null ? "" : clientName) +
virtualHost + "?brokerlist='tcp://" + host + ":" + port + "'"
+ "," + ConnectionURL.OPTIONS_SSL + "='false'"
));
@@ -469,22 +469,22 @@
// TODO: Connect this to the session version obtained from
ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions change.
_protocolHandler.syncWrite(
- ChannelOpenBody.createAMQFrame(channelId,
- (byte)8, (byte)0, // AMQP version (major, minor)
- null), // outOfBand
- ChannelOpenOkBody.class);
+ ChannelOpenBody.createAMQFrame(channelId,
+ (byte) 8, (byte) 0, // AMQP
version (major, minor)
+ null), // outOfBand
+
ChannelOpenOkBody.class);
//todo send low water mark when protocol allows.
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
// TODO: Connect this to the session version obtained from
ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions change.
_protocolHandler.syncWrite(
- BasicQosBody.createAMQFrame(channelId,
- (byte)8, (byte)0, // AMQP version (major, minor)
- false, // global
- prefetchHigh, // prefetchCount
- 0), // prefetchSize
- BasicQosOkBody.class);
+ BasicQosBody.createAMQFrame(channelId,
+ (byte) 8, (byte) 0, // AMQP
version (major, minor)
+ false, // global
+ prefetchHigh, // prefetchCount
+ 0), // prefetchSize
+ BasicQosOkBody.class);
if (transacted)
{
@@ -495,7 +495,7 @@
// AMQP version change: Hardwire the version to 0-8 (major=8,
minor=0)
// TODO: Connect this to the session version obtained from
ProtocolInitiation for this session.
// Be aware of possible changes to parameter order as versions
change.
- _protocolHandler.syncWrite(TxSelectBody.createAMQFrame(channelId,
(byte)8, (byte)0), TxSelectOkBody.class);
+ _protocolHandler.syncWrite(TxSelectBody.createAMQFrame(channelId,
(byte) 8, (byte) 0), TxSelectOkBody.class);
}
}
@@ -527,6 +527,7 @@
/**
* Returns an AMQQueueSessionAdaptor which wraps an AMQSession and throws
IllegalStateExceptions
* where specified in the JMS spec
+ *
* @param transacted
* @param acknowledgeMode
* @return QueueSession
@@ -540,6 +541,7 @@
/**
* Returns an AMQTopicSessionAdapter which wraps an AMQSession and throws
IllegalStateExceptions
* where specified in the JMS spec
+ *
* @param transacted
* @param acknowledgeMode
* @return TopicSession
@@ -574,7 +576,7 @@
{
checkNotClosed();
return _connectionMetaData;
-
+
}
public ExceptionListener getExceptionListener() throws JMSException
@@ -625,7 +627,7 @@
public void close() throws JMSException
{
- synchronized(getFailoverMutex())
+ synchronized (getFailoverMutex())
{
if (!_closed.getAndSet(true))
{
@@ -903,7 +905,7 @@
{
if (cause instanceof AMQException)
{
- je = new
JMSException(Integer.toString(((AMQException)cause).getErrorCode()) ,"Exception
thrown against " + toString() + ": " + cause);
+ je = new JMSException(Integer.toString(((AMQException)
cause).getErrorCode()), "Exception thrown against " + toString() + ": " +
cause);
}
else
{
@@ -956,8 +958,8 @@
void deregisterSession(int channelId)
{
_sessions.remove(channelId);
- }
-
+ }
+
/**
* For all sessions, and for all consumers in those sessions, resubscribe.
This is called during failover handling.
* The caller must hold the failover mutex before calling this method.
Modified:
incubator/qpid/branches/perftesting/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java?view=diff&rev=499813&r1=499812&r2=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
(original)
+++
incubator/qpid/branches/perftesting/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
Thu Jan 25 07:08:28 2007
@@ -207,6 +207,72 @@
assertTrue(service.getPort() == 5672);
}
+ public void testSingleTransportDefaultedBrokerWithPort() throws
URLSyntaxException
+ {
+ String url = "amqp://guest:guest@/temp?brokerlist='localhost:1234'";
+
+ ConnectionURL connectionurl = new AMQConnectionURL(url);
+
+ assertTrue(connectionurl.getFailoverMethod() == null);
+ assertTrue(connectionurl.getUsername().equals("guest"));
+ assertTrue(connectionurl.getPassword().equals("guest"));
+ assertTrue(connectionurl.getVirtualHost().equals("/temp"));
+
+
+ assertTrue(connectionurl.getBrokerCount() == 1);
+
+ BrokerDetails service = connectionurl.getBrokerDetails(0);
+
+ assertTrue(service.getTransport().equals("tcp"));
+
+ assertTrue(service.getHost().equals("localhost"));
+ assertTrue(service.getPort() == 1234);
+ }
+
+ public void testSingleTransportDefaultedBrokerWithIP() throws
URLSyntaxException
+ {
+ String url = "amqp://guest:guest@/temp?brokerlist='127.0.0.1'";
+
+ ConnectionURL connectionurl = new AMQConnectionURL(url);
+
+ assertTrue(connectionurl.getFailoverMethod() == null);
+ assertTrue(connectionurl.getUsername().equals("guest"));
+ assertTrue(connectionurl.getPassword().equals("guest"));
+ assertTrue(connectionurl.getVirtualHost().equals("/temp"));
+
+
+ assertTrue(connectionurl.getBrokerCount() == 1);
+
+ BrokerDetails service = connectionurl.getBrokerDetails(0);
+
+ assertTrue(service.getTransport().equals("tcp"));
+
+ assertTrue(service.getHost().equals("127.0.0.1"));
+ assertTrue(service.getPort() == 5672);
+ }
+
+ public void testSingleTransportDefaultedBrokerWithIPandPort() throws
URLSyntaxException
+ {
+ String url = "amqp://guest:guest@/temp?brokerlist='127.0.0.1:1234'";
+
+// ConnectionURL connectionurl = new AMQConnectionURL(url);
+//
+// assertTrue(connectionurl.getFailoverMethod() == null);
+// assertTrue(connectionurl.getUsername().equals("guest"));
+// assertTrue(connectionurl.getPassword().equals("guest"));
+// assertTrue(connectionurl.getVirtualHost().equals("/temp"));
+//
+//
+// assertTrue(connectionurl.getBrokerCount() == 1);
+//
+// BrokerDetails service = connectionurl.getBrokerDetails(0);
+//
+// assertTrue(service.getTransport().equals("tcp"));
+//
+// assertTrue(service.getHost().equals("127.0.0.1"));
+// assertTrue(service.getPort() == 1234);
+ }
+
public void testSingleTransportMultiOptionURL() throws URLSyntaxException
{
Modified:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh?view=diff&rev=499813&r1=499812&r2=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
(original)
+++
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
Thu Jan 25 07:08:28 2007
@@ -1,4 +1,22 @@
#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
if [ "$JAVA_HOME" == "" ]; then
echo "The JAVA_HOME environment variable is not defined";
@@ -10,4 +28,27 @@
exit 0;
fi
-"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar
$QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher
$QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600
-configuration "file:$QPIDMC_HOME/configuration"
+os=win32
+ws=win32
+arch=x86
+
+##echo $os
+##echo $ws
+##echo $arch
+
+## If this is to be run on different platform other than windows then
following parameters should be passed
+## qpidmc.sh <operating system> <windowing system> <platform achitecture>
+## eg. qpidmc.sh linux motif x86
+if [ $# -eq 3 ]; then
+ os=$1
+ ws=$2
+ arch=$3
+fi
+
+if [ $os = "SunOS" ]; then
+ os="solaris"
+elif [ $os = "Linux" ]; then
+ os="linux"
+fi
+
+"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar
$QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher
$QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600
-configuration "file:$QPIDMC_HOME/configuration" -os $os -ws $ws -arch $arch
Added:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh?view=auto&rev=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
(added)
+++
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
Thu Jan 25 07:08:28 2007
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+os=`uname`
+arch=`uname -p`
+
+$QPIDMC_HOME/bin/qpidmc.sh $os gtk $arch
Propchange:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
------------------------------------------------------------------------------
svn:executable = *
Added:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh?view=auto&rev=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
(added)
+++
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
Thu Jan 25 07:08:28 2007
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+os=`uname`
+arch=`uname -p`
+
+$QPIDMC_HOME/bin/qpidmc.sh $os motif $arch
Propchange:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
------------------------------------------------------------------------------
svn:executable = *
Modified:
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini?view=diff&rev=499813&r1=499812&r2=499813
==============================================================================
---
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
(original)
+++
incubator/qpid/branches/perftesting/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
Thu Jan 25 07:08:28 2007
@@ -24,3 +24,4 @@
eclipse.application=org.apache.qpid.management.ui.application
[EMAIL PROTECTED]:start,[EMAIL
PROTECTED],com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.motif.linux.x86,org.eclipse.swt.gtk.linux.x86_64,org.eclipse.swt.gtk.linux.x86,org.eclipse.swt.gtk.linux.ppc,org.eclipse.swt.motif.hpux.PA_RISC,org.eclipse.swt.gtk.solaris.sparc,org.eclipse.swt.motif.solaris.sparc,org.eclipse.swt.carbon.macocx,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench
osgi.bundles.defaultStartLevel=4
+eof=eof
\ No newline at end of file