[Carbon-dev] svn commit r41574 - in trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences: . tooling

ruwan at wso2.com ruwan at wso2.com
Mon Jul 20 23:13:57 PDT 2009


Author: ruwan
Date: Mon Jul 20 23:13:56 2009
New Revision: 41574
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=41574

Log:
Tooling BE fixes - adds registry to the tooling BE

Added:
   trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingComponent.java
      - copied, changed from r41561, /trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/SequenceEditorToolingComponent.java
Removed:
   trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/SequenceEditorToolingComponent.java
Modified:
   trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingBE.java

Deleted: trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/SequenceEditorToolingComponent.java
URL: http://wso2.org/svn/browse/wso2/None?pathrev=41573

Modified: trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingBE.java
URL: http://wso2.org/svn/browse/wso2/trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingBE.java?rev=41574&r1=41573&r2=41574&view=diff
==============================================================================
--- trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingBE.java	(original)
+++ trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingBE.java	Mon Jul 20 23:13:56 2009
@@ -30,6 +30,7 @@
 import org.wso2.carbon.sequences.common.SequenceEditorException;
 import org.wso2.carbon.sequences.common.factory.SequenceInfoFactory;
 import org.wso2.carbon.sequences.common.to.SequenceInfo;
+import org.wso2.carbon.registry.core.session.UserRegistry;
 
 import javax.xml.namespace.QName;
 import java.util.*;
@@ -42,6 +43,7 @@
     private static final Log log = LogFactory.getLog(SequenceEditorToolingBE.class);
 
     private Map<String, SequenceMediator> sequences = new HashMap<String, SequenceMediator>();
+    private static UserRegistry registry;
 
     public SequenceInfo[] getSequences() throws SequenceEditorException {
         return SequenceInfoFactory.getSortedSequenceInfoArray(sequences.values());
@@ -276,6 +278,14 @@
         return "";
     }
 
+    public static UserRegistry getRegistry() {
+        return registry;
+    }
+
+    public static void setRegistry(UserRegistry registry) {
+        SequenceEditorToolingBE.registry = registry;
+    }
+
     public void addDynamicSequence(String key, OMElement sequence) throws SequenceEditorException {}
     public OMElement getDynamicSequence(String key) throws SequenceEditorException { return null; }
     public void saveDynamicSequence(String key, OMElement sequence) throws SequenceEditorException {}

Copied: trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingComponent.java (from r41561, /trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/SequenceEditorToolingComponent.java)
URL: http://wso2.org/svn/browse/wso2/trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingComponent.java?rev=41574&r1=41561&r2=41574&view=diff
==============================================================================
--- /trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/SequenceEditorToolingComponent.java	(original)
+++ trunk/carbon-components/sequence-editor/org.wso2.carbon.sequences.tooling/src/main/java/org/wso2/carbon/sequences/tooling/SequenceEditorToolingComponent.java	Mon Jul 20 23:13:56 2009
@@ -14,7 +14,7 @@
  *  limitations under the License.
  */
 
-package org.wso2.carbon.sequences;
+package org.wso2.carbon.sequences.tooling;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -22,9 +22,15 @@
 import org.osgi.service.component.ComponentContext;
 import org.wso2.carbon.sequences.common.ISequenceAdmin;
 import org.wso2.carbon.sequences.tooling.SequenceEditorToolingBE;
+import org.wso2.carbon.registry.core.service.RegistryService;
+import org.wso2.carbon.registry.core.exceptions.RegistryException;
 
 /**
  * @scr.component name="org.wso2.carbon.sequences.tooling" immediate="true"
+ * @scr.reference name="registry.service"
+ * interface="org.wso2.carbon.registry.core.service.RegistryService"
+ * cardinality="1..1" policy="dynamic"
+ * bind="setRegistryService" unbind="unsetRegistryService"
  */
 public class SequenceEditorToolingComponent {
 
@@ -41,4 +47,22 @@
             log.error("Failed to activate Sequence Editor tooling bundle ", e);
         }
     }
+
+    protected void setRegistryService(RegistryService regService) {
+        if (log.isDebugEnabled()) {
+            log.debug("RegistryService bound to the ESB initialization process");
+        }
+        try {
+            SequenceEditorToolingBE.setRegistry(regService.getSystemRegistry());
+        } catch (RegistryException e) {
+            log.error("Couldn't retrieve the registry from the registry service");
+        }
+    }
+
+    protected void unsetRegistryService(RegistryService regService) {
+        if (log.isDebugEnabled()) {
+            log.debug("RegistryService unbound from the ESB environment");
+        }
+        SequenceEditorToolingBE.setRegistry(null);
+    }
 }



More information about the Carbon-dev mailing list