From 902481c5caf3a72538586a68cb779ddb9aa60c58 Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 31 Jul 2007 22:34:12 +0000 Subject: Rolled back revision 561365 and commented out some broken code in ClientSession.java. The trunk should now build. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@561578 13f79535-47bb-0310-9956-ffa450edef68 --- java/common/pom.xml | 26 +++------- .../org/apache/qpid/framing/AMQShortString.java | 56 ---------------------- .../abstraction/MessagePublishInfoConverter.java | 25 +++++----- .../ProtocolVersionMethodConverter.java | 25 +++++----- .../org/apache/qpid/util/CommandLineParser.java | 14 +++--- 5 files changed, 35 insertions(+), 111 deletions(-) (limited to 'java/common') diff --git a/java/common/pom.xml b/java/common/pom.xml index 6aaf9960e9..792a7f38f4 100644 --- a/java/common/pom.xml +++ b/java/common/pom.xml @@ -100,34 +100,22 @@ - + - - commons-configuration - commons-configuration - - - - commons-cli - commons-cli - - - - - + org.slf4j - slf4j-api + slf4j-api 1.4.0 - - org.slf4j - slf4j-log4j12 - 1.4.0 + + org.slf4j + slf4j-log4j12 + 1.4.0 test diff --git a/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java b/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java index df99f6589d..05e9473463 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java +++ b/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java @@ -26,10 +26,6 @@ import org.apache.mina.common.ByteBuffer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.Map; -import java.util.WeakHashMap; -import java.lang.ref.WeakReference; - /** * A short string is a representation of an AMQ Short String * Short strings differ from the Java String class by being limited to on ASCII characters (0-127) @@ -38,19 +34,6 @@ import java.lang.ref.WeakReference; */ public final class AMQShortString implements CharSequence, Comparable { - - private static final ThreadLocal>> _localInternMap = - new ThreadLocal>>() - { - protected Map> initialValue() - { - return new WeakHashMap>(); - }; - }; - - private static final Map> _globalInternMap = - new WeakHashMap>(); - private static final Logger _logger = LoggerFactory.getLogger(AMQShortString.class); private final ByteBuffer _data; @@ -393,43 +376,4 @@ public final class AMQShortString implements CharSequence, Comparable> localMap = - _localInternMap.get(); - - WeakReference ref = localMap.get(this); - AMQShortString internString; - - if(ref != null) - { - internString = ref.get(); - if(internString != null) - { - return internString; - } - } - - - synchronized(_globalInternMap) - { - - ref = _globalInternMap.get(this); - if((ref == null) || ((internString = ref.get()) == null)) - { - internString = new AMQShortString(getBytes()); - ref = new WeakReference(internString); - _globalInternMap.put(internString, ref); - } - - } - localMap.put(internString, ref); - return internString; - - } } diff --git a/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java b/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java index 42e2f7ad97..c9e15f18e3 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java +++ b/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java @@ -1,21 +1,18 @@ /* * - * 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 + * Copyright (c) 2006 The Apache Software Foundation * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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 * - * 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. + * 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. * */ diff --git a/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java b/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java index 99588a0908..52e82cdf07 100644 --- a/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java +++ b/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java @@ -1,21 +1,18 @@ /* * - * 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 + * Copyright (c) 2006 The Apache Software Foundation * - * http://www.apache.org/licenses/LICENSE-2.0 + * Licensed 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 * - * 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. + * 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. * */ diff --git a/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java b/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java index 64e61fe5ff..9bb4a6635f 100644 --- a/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java +++ b/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java @@ -483,9 +483,9 @@ public class CommandLineParser } /** - * If a command line has been parsed, calling this method sets all of its parsed options into the specified properties. + * If a command line has been parsed, calling this method sets all of its parsed options as system properties. */ - public void addCommandLineToProperties(Properties properties) + public void addCommandLineToSysProperties() { if (parsedProperties != null) { @@ -494,7 +494,7 @@ public class CommandLineParser String name = (String) propKey; String value = parsedProperties.getProperty(name); - properties.setProperty(name, value); + System.setProperty(name, value); } } } @@ -607,9 +607,7 @@ public class CommandLineParser * instrucitons and calling System.exit on errors. Extracts all trailing name=value pairs from the command line, * and sets them all as system properties and also returns a map of properties containing them. * - * @param args The command line. - * @param commandLine The command line parser. - * @param properties The properties object to inject all parsed properties into (optional may be null). + * @param args The command line. * * @return A set of properties containing all name=value pairs from the command line. * @@ -621,7 +619,7 @@ public class CommandLineParser * @todo Allow the Properties to add trailing options to be specified as an argument rather than hard coding * system properties. Again, gives the caller the option to decide. */ - public static Properties processCommandLine(String[] args, CommandLineParser commandLine, Properties properties) + public static Properties processCommandLine(String[] args, CommandLineParser commandLine) { // Capture the command line arguments or display errors and correct usage and then exit. Properties options = null; @@ -632,7 +630,7 @@ public class CommandLineParser // Add all the trailing command line options (name=value pairs) to system properties. They may be picked up // from there. - commandLine.addCommandLineToProperties(properties); + commandLine.addCommandLineToSysProperties(); } catch (IllegalArgumentException e) { -- cgit v1.2.1