You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2011/05/12 15:19:17 UTC

svn commit: r1102283 - /tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java

Author: antelder
Date: Thu May 12 13:19:17 2011
New Revision: 1102283

URL: http://svn.apache.org/viewvc?rev=1102283&view=rev
Log:
Remove the allNodes static as its not used by anything

Modified:
    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java

Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java?rev=1102283&r1=1102282&r2=1102283&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java Thu May 12 13:19:17 2011
@@ -87,8 +87,6 @@ public class NodeImpl implements Node {
     private TuscanyRuntime tuscanyRuntime;
     private Map<String, InstalledContribution> locallyInstalledContributions = new HashMap<String, InstalledContribution>();
     
-    private static Map<String, Node> allNodes = new HashMap<String, Node>();
-    
     public NodeImpl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) {
         this.domainName = domainName;
         this.deployer = deployer;
@@ -96,7 +94,6 @@ public class NodeImpl implements Node {
         this.endpointRegistry = endpointRegistry;
         this.extensionPointRegistry = extensionPointRegistry;
         this.tuscanyRuntime = tuscanyRuntime;
-        allNodes.put(domainName, this);
     }
 
     public String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException {
@@ -325,7 +322,6 @@ public class NodeImpl implements Node {
         if (tuscanyRuntime != null) {
             tuscanyRuntime.stop();
         }
-        allNodes.remove(this.domainName);
     }
 
     public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
@@ -494,7 +490,7 @@ public class NodeImpl implements Node {
 
     protected void startComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException {
         List<Contribution> dependentContributions = calculateDependentContributions(ic);
-        DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
+        DeployedComposite dc = new DeployedComposite(c, ic.getContribution(), dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
         ic.start(dc);
     }
     
@@ -543,8 +539,4 @@ public class NodeImpl implements Node {
         return endpointRegistry;
     }
     
-    public static Node nodeExists(String domainName) {
-        return allNodes.get(domainName);
-    }
-
 }



Re: svn commit: r1102283 - /tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java

Posted by Simon Laws <si...@googlemail.com>.
On Thu, May 12, 2011 at 2:59 PM, ant elder <an...@gmail.com> wrote:
> On Thu, May 12, 2011 at 2:46 PM, Simon Laws <si...@googlemail.com> wrote:
>> On Thu, May 12, 2011 at 2:19 PM,  <an...@apache.org> wrote:
>>> Author: antelder
>>> Date: Thu May 12 13:19:17 2011
>>> New Revision: 1102283
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1102283&view=rev
>>> Log:
>>> Remove the allNodes static as its not used by anything
>>>
>>> Modified:
>>>    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
>>>
>>> Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
>>> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java?rev=1102283&r1=1102282&r2=1102283&view=diff
>>> ==============================================================================
>>> --- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java (original)
>>> +++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java Thu May 12 13:19:17 2011
>>> @@ -87,8 +87,6 @@ public class NodeImpl implements Node {
>>>     private TuscanyRuntime tuscanyRuntime;
>>>     private Map<String, InstalledContribution> locallyInstalledContributions = new HashMap<String, InstalledContribution>();
>>>
>>> -    private static Map<String, Node> allNodes = new HashMap<String, Node>();
>>> -
>>>     public NodeImpl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) {
>>>         this.domainName = domainName;
>>>         this.deployer = deployer;
>>> @@ -96,7 +94,6 @@ public class NodeImpl implements Node {
>>>         this.endpointRegistry = endpointRegistry;
>>>         this.extensionPointRegistry = extensionPointRegistry;
>>>         this.tuscanyRuntime = tuscanyRuntime;
>>> -        allNodes.put(domainName, this);
>>>     }
>>>
>>>     public String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException {
>>> @@ -325,7 +322,6 @@ public class NodeImpl implements Node {
>>>         if (tuscanyRuntime != null) {
>>>             tuscanyRuntime.stop();
>>>         }
>>> -        allNodes.remove(this.domainName);
>>>     }
>>>
>>>     public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
>>> @@ -494,7 +490,7 @@ public class NodeImpl implements Node {
>>>
>>>     protected void startComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException {
>>>         List<Contribution> dependentContributions = calculateDependentContributions(ic);
>>> -        DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
>>> +        DeployedComposite dc = new DeployedComposite(c, ic.getContribution(), dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
>>>         ic.start(dc);
>>>     }
>>>
>>> @@ -543,8 +539,4 @@ public class NodeImpl implements Node {
>>>         return endpointRegistry;
>>>     }
>>>
>>> -    public static Node nodeExists(String domainName) {
>>> -        return allNodes.get(domainName);
>>> -    }
>>> -
>>>  }
>>>
>>>
>>>
>>
>> What I'd like to do is move info about the running nodes into the
>> registry. I'm assuming I'll just collide with you atm as you're making
>> changes there now.
>>
>
> Yes probably, but i could take a checkpoint and stop if you want to
> get in a make some changes, but what do you mean there by "node"? I
> have now added info about running composites to the registry , eg see
> org.apache.tuscany.sca.runtime.EndpointRegistry methods like
> addRunningComposite / removeRunningComposite /
> getRunningCompositeNames. Do they do anything like what you want?
>
>   ...ant
>
Yeah, that's good. I'd also like to be able to tell which groups of
composites are running together and, potentially in the future, what
the capabilities and status of the runtime is where they're running.
Basically what instances of the Tuscany runtime are active in the
domain.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Re: svn commit: r1102283 - /tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java

Posted by ant elder <an...@gmail.com>.
On Thu, May 12, 2011 at 2:46 PM, Simon Laws <si...@googlemail.com> wrote:
> On Thu, May 12, 2011 at 2:19 PM,  <an...@apache.org> wrote:
>> Author: antelder
>> Date: Thu May 12 13:19:17 2011
>> New Revision: 1102283
>>
>> URL: http://svn.apache.org/viewvc?rev=1102283&view=rev
>> Log:
>> Remove the allNodes static as its not used by anything
>>
>> Modified:
>>    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
>>
>> Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
>> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java?rev=1102283&r1=1102282&r2=1102283&view=diff
>> ==============================================================================
>> --- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java (original)
>> +++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java Thu May 12 13:19:17 2011
>> @@ -87,8 +87,6 @@ public class NodeImpl implements Node {
>>     private TuscanyRuntime tuscanyRuntime;
>>     private Map<String, InstalledContribution> locallyInstalledContributions = new HashMap<String, InstalledContribution>();
>>
>> -    private static Map<String, Node> allNodes = new HashMap<String, Node>();
>> -
>>     public NodeImpl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) {
>>         this.domainName = domainName;
>>         this.deployer = deployer;
>> @@ -96,7 +94,6 @@ public class NodeImpl implements Node {
>>         this.endpointRegistry = endpointRegistry;
>>         this.extensionPointRegistry = extensionPointRegistry;
>>         this.tuscanyRuntime = tuscanyRuntime;
>> -        allNodes.put(domainName, this);
>>     }
>>
>>     public String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException {
>> @@ -325,7 +322,6 @@ public class NodeImpl implements Node {
>>         if (tuscanyRuntime != null) {
>>             tuscanyRuntime.stop();
>>         }
>> -        allNodes.remove(this.domainName);
>>     }
>>
>>     public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
>> @@ -494,7 +490,7 @@ public class NodeImpl implements Node {
>>
>>     protected void startComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException {
>>         List<Contribution> dependentContributions = calculateDependentContributions(ic);
>> -        DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
>> +        DeployedComposite dc = new DeployedComposite(c, ic.getContribution(), dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
>>         ic.start(dc);
>>     }
>>
>> @@ -543,8 +539,4 @@ public class NodeImpl implements Node {
>>         return endpointRegistry;
>>     }
>>
>> -    public static Node nodeExists(String domainName) {
>> -        return allNodes.get(domainName);
>> -    }
>> -
>>  }
>>
>>
>>
>
> What I'd like to do is move info about the running nodes into the
> registry. I'm assuming I'll just collide with you atm as you're making
> changes there now.
>

Yes probably, but i could take a checkpoint and stop if you want to
get in a make some changes, but what do you mean there by "node"? I
have now added info about running composites to the registry , eg see
org.apache.tuscany.sca.runtime.EndpointRegistry methods like
addRunningComposite / removeRunningComposite /
getRunningCompositeNames. Do they do anything like what you want?

   ...ant

Re: svn commit: r1102283 - /tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java

Posted by Simon Laws <si...@googlemail.com>.
On Thu, May 12, 2011 at 2:19 PM,  <an...@apache.org> wrote:
> Author: antelder
> Date: Thu May 12 13:19:17 2011
> New Revision: 1102283
>
> URL: http://svn.apache.org/viewvc?rev=1102283&view=rev
> Log:
> Remove the allNodes static as its not used by anything
>
> Modified:
>    tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
>
> Modified: tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java
> URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java?rev=1102283&r1=1102282&r2=1102283&view=diff
> ==============================================================================
> --- tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java (original)
> +++ tuscany/sca-java-2.x/trunk/modules/domain-node/src/main/java/org/apache/tuscany/sca/impl/NodeImpl.java Thu May 12 13:19:17 2011
> @@ -87,8 +87,6 @@ public class NodeImpl implements Node {
>     private TuscanyRuntime tuscanyRuntime;
>     private Map<String, InstalledContribution> locallyInstalledContributions = new HashMap<String, InstalledContribution>();
>
> -    private static Map<String, Node> allNodes = new HashMap<String, Node>();
> -
>     public NodeImpl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry, TuscanyRuntime tuscanyRuntime) {
>         this.domainName = domainName;
>         this.deployer = deployer;
> @@ -96,7 +94,6 @@ public class NodeImpl implements Node {
>         this.endpointRegistry = endpointRegistry;
>         this.extensionPointRegistry = extensionPointRegistry;
>         this.tuscanyRuntime = tuscanyRuntime;
> -        allNodes.put(domainName, this);
>     }
>
>     public String installContribution(String contributionURL) throws ContributionReadException, ActivationException, ValidationException {
> @@ -325,7 +322,6 @@ public class NodeImpl implements Node {
>         if (tuscanyRuntime != null) {
>             tuscanyRuntime.stop();
>         }
> -        allNodes.remove(this.domainName);
>     }
>
>     public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
> @@ -494,7 +490,7 @@ public class NodeImpl implements Node {
>
>     protected void startComposite(Composite c, InstalledContribution ic) throws ActivationException, ValidationException {
>         List<Contribution> dependentContributions = calculateDependentContributions(ic);
> -        DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
> +        DeployedComposite dc = new DeployedComposite(c, ic.getContribution(), dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
>         ic.start(dc);
>     }
>
> @@ -543,8 +539,4 @@ public class NodeImpl implements Node {
>         return endpointRegistry;
>     }
>
> -    public static Node nodeExists(String domainName) {
> -        return allNodes.get(domainName);
> -    }
> -
>  }
>
>
>

What I'd like to do is move info about the running nodes into the
registry. I'm assuming I'll just collide with you atm as you're making
changes there now.

Simon

-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com