tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r1103521 - in /tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime: BaseEndpointRegistry.java ContributionListener.java EndpointRegistry.java
Date Sun, 15 May 2011 20:08:35 GMT
Author: antelder
Date: Sun May 15 20:08:35 2011
New Revision: 1103521

URL: http://svn.apache.org/viewvc?rev=1103521&view=rev
Log:
Add a EndpointRegistry method to update contributions and a ContributionListener so that clients
can register for contributionUpdated and contributionRemoved events

Added:
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
Modified:
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
    tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java

Modified: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java?rev=1103521&r1=1103520&r2=1103521&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/BaseEndpointRegistry.java
Sun May 15 20:08:35 2011
@@ -43,6 +43,7 @@ public abstract class BaseEndpointRegist
 
     protected List<EndpointReference> endpointreferences = new CopyOnWriteArrayList<EndpointReference>();
     protected List<EndpointListener> listeners = new CopyOnWriteArrayList<EndpointListener>();
+    protected List<ContributionListener> contributionlisteners = new CopyOnWriteArrayList<ContributionListener>();
     protected ExtensionPointRegistry registry;
     protected Map<String, String> attributes;
 
@@ -156,4 +157,11 @@ public abstract class BaseEndpointRegist
         return domainURI;
     }
 
+    public void addContributionListener(ContributionListener listener) {
+        contributionlisteners.add(listener);
+    }
+
+    public void removeContributionListener(ContributionListener listener) {
+        contributionlisteners.remove(listener);
+    }
 }

Added: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java?rev=1103521&view=auto
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
(added)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/ContributionListener.java
Sun May 15 20:08:35 2011
@@ -0,0 +1,29 @@
+/*
+ * 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.tuscany.sca.runtime;
+
+import java.util.EventListener;
+
+public interface ContributionListener extends EventListener {
+
+    void contributionRemoved(String uri);
+
+    void contributionUpdated(String uri);
+}

Modified: tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java?rev=1103521&r1=1103520&r2=1103521&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/core-spi/src/main/java/org/apache/tuscany/sca/runtime/EndpointRegistry.java
Sun May 15 20:08:35 2011
@@ -85,10 +85,15 @@ public interface EndpointRegistry {
     void uninstallContribution(String uri);
     List<String> getInstalledContributionURIs();
     InstalledContribution getInstalledContribution(String uri);
+    void updateInstalledContribution(InstalledContribution ic);
+    
+    void addContributionListener(ContributionListener listener);
+    void removeContributionListener(ContributionListener listener);
 
     // TODO: Change to use the QName instead of Composite and have clients look up the Composite
from the contribution themselves, but i need to get that working first
     void addRunningComposite(String contributionURI, Composite composite);
     void removeRunningComposite(String contributionURI, QName name);
     Map<String, List<QName>> getRunningCompositeNames();
     Composite getRunningComposite(String contributionURI, QName name);
+
 }



Mime
View raw message