You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2015/08/14 21:08:16 UTC

[43/50] [abbrv] qpid-proton git commit: Changed the descriptor registry to use the renamed fields.

Changed the descriptor registry to use the renamed fields.


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/d285fdb8
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/d285fdb8
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/d285fdb8

Branch: refs/heads/rajith-codec
Commit: d285fdb8bef86345ef24faf8894fad6651ca31f1
Parents: 892ec5e
Author: Rajith Attapattu <ra...@apache.org>
Authored: Fri May 15 09:19:04 2015 -0400
Committer: Rajith Attapattu <ra...@apache.org>
Committed: Thu Jul 9 09:15:57 2015 -0400

----------------------------------------------------------------------
 .../qpid/proton/codec2/DiscriptorRegistry.java  | 40 ++++++++++----------
 .../apache/qpid/proton/codec2/Performative.java | 26 -------------
 2 files changed, 20 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d285fdb8/proton-j/src/main/java/org/apache/qpid/proton/codec2/DiscriptorRegistry.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec2/DiscriptorRegistry.java b/proton-j/src/main/java/org/apache/qpid/proton/codec2/DiscriptorRegistry.java
index 697a89a..5720432 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec2/DiscriptorRegistry.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec2/DiscriptorRegistry.java
@@ -58,9 +58,9 @@ import org.apache.qpid.proton.transport2.Transfer;
 
 public class DiscriptorRegistry
 {
-    private static Map<String, DescribedTypeFactory> _typeRegByStrCode = new HashMap<String, DescribedTypeFactory>();
+    private static Map<String, DescribedTypeFactory> _typeRegByDescriptor = new HashMap<String, DescribedTypeFactory>();
 
-    private static Map<Long, DescribedTypeFactory> _typeRegByLongCode = new HashMap<Long, DescribedTypeFactory>();
+    private static Map<Long, DescribedTypeFactory> _typeRegByCode = new HashMap<Long, DescribedTypeFactory>();
 
     // Register the standard types
     static
@@ -70,23 +70,23 @@ public class DiscriptorRegistry
         registerSaslTypes();
     }
 
-    public static void registerType(long longCode, String strCode, DescribedTypeFactory factory)
+    public static void registerType(long code, String descriptor, DescribedTypeFactory factory)
     {
-        _typeRegByStrCode.put(strCode, factory);
-        _typeRegByLongCode.put(longCode, factory);
+        _typeRegByDescriptor.put(descriptor, factory);
+        _typeRegByCode.put(code, factory);
     }
 
     private static void registerTransportTypes()
     {
-        registerType(Open.DESCRIPTOR_LONG, Open.DESCRIPTOR_STRING, Open.FACTORY);
-        registerType(Begin.DESCRIPTOR_LONG, Begin.DESCRIPTOR_STRING, Begin.FACTORY);
-        registerType(Attach.DESCRIPTOR_LONG, Attach.DESCRIPTOR_STRING, Attach.FACTORY);
-        registerType(Flow.DESCRIPTOR_LONG, Flow.DESCRIPTOR_STRING, Flow.FACTORY);
-        registerType(Transfer.DESCRIPTOR_LONG, Transfer.DESCRIPTOR_STRING, Transfer.FACTORY);
-        registerType(Disposition.DESCRIPTOR_LONG, Disposition.DESCRIPTOR_STRING, Disposition.FACTORY);
-        registerType(Detach.DESCRIPTOR_LONG, Detach.DESCRIPTOR_STRING, Detach.FACTORY);
-        registerType(End.DESCRIPTOR_LONG, End.DESCRIPTOR_STRING, End.FACTORY);
-        registerType(Close.DESCRIPTOR_LONG, Close.DESCRIPTOR_STRING, Close.FACTORY);
+        registerType(Open.CODE, Open.DESCRIPTOR, Open.FACTORY);
+        registerType(Begin.CODE, Begin.DESCRIPTOR, Begin.FACTORY);
+        registerType(Attach.CODE, Attach.DESCRIPTOR, Attach.FACTORY);
+        registerType(Flow.CODE, Flow.DESCRIPTOR, Flow.FACTORY);
+        registerType(Transfer.CODE, Transfer.DESCRIPTOR, Transfer.FACTORY);
+        registerType(Disposition.CODE, Disposition.DESCRIPTOR, Disposition.FACTORY);
+        registerType(Detach.CODE, Detach.DESCRIPTOR, Detach.FACTORY);
+        registerType(End.CODE, End.DESCRIPTOR, End.FACTORY);
+        registerType(Close.CODE, Close.DESCRIPTOR, Close.FACTORY);
         registerType(ErrorCondition.DESCRIPTOR_LONG, ErrorCondition.DESCRIPTOR_STRING, ErrorCondition.FACTORY);
     }
 
@@ -136,11 +136,11 @@ public class DiscriptorRegistry
     {
         if (code instanceof Long)
         {
-            return lookupLongCode((Long) code);
+            return lookupByCode((Long) code);
         }
         else if (code instanceof String)
         {
-            return lookupStringCode((String) code);
+            return lookupByDescriptor((String) code);
         }
         else
         {
@@ -148,13 +148,13 @@ public class DiscriptorRegistry
         }
     }
 
-    static DescribedTypeFactory lookupLongCode(long code)
+    static DescribedTypeFactory lookupByCode(long code)
     {
-        return _typeRegByLongCode.get(code);
+        return _typeRegByCode.get(code);
     }
 
-    static DescribedTypeFactory lookupStringCode(String code)
+    static DescribedTypeFactory lookupByDescriptor(String code)
     {
-        return _typeRegByStrCode.get(code);
+        return _typeRegByDescriptor.get(code);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/d285fdb8/proton-j/src/main/java/org/apache/qpid/proton/codec2/Performative.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec2/Performative.java b/proton-j/src/main/java/org/apache/qpid/proton/codec2/Performative.java
deleted file mode 100644
index 9ce1fb6..0000000
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec2/Performative.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * 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.
- *
- */
-package org.apache.qpid.proton.codec2;
-
-public interface Performative
-{
-    boolean isValid();
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org