incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1498571 - /sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
Date Mon, 01 Jul 2013 17:06:30 GMT
Author: bdelacretaz
Date: Mon Jul  1 17:06:30 2013
New Revision: 1498571

URL: http://svn.apache.org/r1498571
Log:
SLING-2822 - add adapter.condition property for webconsole plugin

Modified:
    sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java

Modified: sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java?rev=1498571&r1=1498570&r2=1498571&view=diff
==============================================================================
--- sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
(original)
+++ sling/whiteboard/bdelacretaz/adapter-methods/extensions-adapter/src/main/java/org/apache/sling/adapter/internal/AdapterMethodsManagerImpl.java
Mon Jul  1 17:06:30 2013
@@ -111,6 +111,20 @@ public class AdapterMethodsManagerImpl {
             props.put(AdapterFactory.ADAPTABLE_CLASSES, new String[] { fromClass.getName()
});
             props.put(AdapterFactory.ADAPTER_CLASSES, new String[] { toClass.getName() });
             
+            // TODO "condition" is displayed by the adapters webconsole page,
+            // we might want to improve how these proxies are reported there
+            final StringBuilder condition = new StringBuilder();
+            condition
+                .append("AdapterMethod: ")
+                .append(methodProvider.getClass().getName())
+                .append(".")
+                .append(m.getName())
+                .append("(")
+                .append(fromClass.getSimpleName())
+                .append(") returns a ")
+                .append(toClass.getSimpleName());
+            props.put("adapter.condition", condition.toString());
+            
             final AdapterFactory factory = new AdapterFactory() {
                 @SuppressWarnings("unchecked")
                 public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType>
type) {



Mime
View raw message