qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1618846 - in /qpid/trunk/qpid/java: bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/ broker-codegen/src/main/java/org/apache/qpid/server/model/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/ma...
Date Tue, 19 Aug 2014 11:58:07 GMT
Author: rgodfrey
Date: Tue Aug 19 11:58:06 2014
New Revision: 1618846

URL: http://svn.apache.org/r1618846
Log:
QPID-6018 : [Java Broker] Add an attribute to the ManagedObject annotation to signify that
the given object should not be registered in the meta-data registry

Modified:
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHost.java
    qpid/trunk/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/ConfiguredObjectRegistrationGenerator.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHost.java?rev=1618846&r1=1618845&r2=1618846&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHost.java
(original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/virtualhost/berkeleydb/BDBHAReplicaVirtualHost.java
Tue Aug 19 11:58:06 2014
@@ -58,7 +58,7 @@ import org.apache.qpid.server.virtualhos
   Object that represents the VirtualHost whilst the VirtualHostNode is in the replica role.
 The
   real virtualhost will be elsewhere in the group.
  */
-@ManagedObject( category = false, type = "BDB_HA_REPLICA" )
+@ManagedObject( category = false, type = "BDB_HA_REPLICA", register = false )
 public class BDBHAReplicaVirtualHost extends AbstractConfiguredObject<BDBHAReplicaVirtualHost>
     implements VirtualHostImpl<BDBHAReplicaVirtualHost, AMQQueue<?>, ExchangeImpl<?>>,
                VirtualHost<BDBHAReplicaVirtualHost,AMQQueue<?>, ExchangeImpl<?>>

Modified: qpid/trunk/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/ConfiguredObjectRegistrationGenerator.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/ConfiguredObjectRegistrationGenerator.java?rev=1618846&r1=1618845&r2=1618846&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/ConfiguredObjectRegistrationGenerator.java
(original)
+++ qpid/trunk/qpid/java/broker-codegen/src/main/java/org/apache/qpid/server/model/ConfiguredObjectRegistrationGenerator.java
Tue Aug 19 11:58:06 2014
@@ -87,30 +87,33 @@ public class ConfiguredObjectRegistratio
                     PackageElement packageElement = elementUtils.getPackageOf(e);
                     String packageName = packageElement.getQualifiedName().toString();
                     String className = e.getSimpleName().toString();
-                    for(AnnotationMirror a : e.getAnnotationMirrors())
+                    AnnotationMirror annotation = getAnnotation(e, annotationElement);
+
+                    AnnotationValue registerValue = getAnnotationValue(annotation, "register");
+
+                    if(registerValue == null || (Boolean) registerValue.getValue() )
                     {
-                        if(a.getAnnotationType().asElement().equals(annotationElement))
+                        AnnotationValue typeValue = getAnnotationValue(annotation, "type");
+
+                        if (typeValue != null)
                         {
-                            for(Map.Entry<? extends ExecutableElement, ? extends AnnotationValue>
entry : a.getElementValues().entrySet())
-                            {
-                                if(entry.getKey().getSimpleName().toString().equals("type"))
-                                {
-                                    _typeMap.put(packageName + "." + className, (String)
entry.getValue().getValue());
-                                    processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE,
"looking for " + packageName + "." + className);
-                                    _categoryMap.put(packageName + "." + className, getCategory((TypeElement)e));
-                                    break;
-                                }
-                            }
-                            break;
+                            _typeMap.put(packageName + "." + className, (String) typeValue.getValue());
+                            processingEnv.getMessager()
+                                    .printMessage(Diagnostic.Kind.NOTE,
+                                                  "looking for " + packageName + "." + className);
+                            _categoryMap.put(packageName + "." + className, getCategory((TypeElement)
e));
+
                         }
+
+
+                        Set<String> classNames = _managedObjectClasses.get(packageName);
+                        if (classNames == null)
+                        {
+                            classNames = new HashSet<>();
+                            _managedObjectClasses.put(packageName, classNames);
+                        }
+                        classNames.add(className);
                     }
-                    Set<String> classNames = _managedObjectClasses.get(packageName);
-                    if (classNames == null)
-                    {
-                        classNames = new HashSet<>();
-                        _managedObjectClasses.put(packageName, classNames);
-                    }
-                    classNames.add(className);
                 }
             }
             for (Map.Entry<String, Set<String>> entry : _managedObjectClasses.entrySet())
@@ -129,6 +132,30 @@ public class ConfiguredObjectRegistratio
         return false;
     }
 
+    private AnnotationValue getAnnotationValue(final AnnotationMirror annotation, final String
attribute)
+    {
+        for(Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry
: annotation.getElementValues().entrySet())
+        {
+            if(entry.getKey().getSimpleName().toString().equals(attribute))
+            {
+                return entry.getValue();
+            }
+        }
+        return null;
+    }
+
+    private AnnotationMirror getAnnotation(final Element e, final TypeElement annotationElement)
+    {
+        for(AnnotationMirror a : e.getAnnotationMirrors())
+        {
+            if (a.getAnnotationType().asElement().equals(annotationElement))
+            {
+                return a;
+            }
+        }
+        return null;
+    }
+
     private String getCategory(final TypeElement e)
     {
         Elements elementUtils = processingEnv.getElementUtils();

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java?rev=1618846&r1=1618845&r2=1618846&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/ManagedObject.java
Tue Aug 19 11:58:06 2014
@@ -35,4 +35,5 @@ public @interface ManagedObject
     boolean creatable() default true;
     String defaultType() default ""; // in this case the class/interface itself is to be
used
     String type() default "";
+    boolean register() default true;
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java?rev=1618846&r1=1618845&r2=1618846&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
(original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManager.java
Tue Aug 19 11:58:06 2014
@@ -46,7 +46,7 @@ import org.apache.qpid.server.security.a
 import org.apache.qpid.server.security.auth.sasl.plain.PlainPasswordCallback;
 import org.apache.qpid.server.security.auth.sasl.plain.PlainSaslServer;
 
-@ManagedObject( category = false, type = "Simple" )
+@ManagedObject( category = false, type = "Simple", register = false )
 public class SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager>
 {
     private static final Logger _logger = Logger.getLogger(SimpleAuthenticationManager.class);



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


Mime
View raw message