You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Giorgio Zoppi <gi...@gmail.com> on 2007/10/22 16:39:56 UTC

Adding dynamically references

Hi,
I need to add/remove dynamically a reference to another component. For
example i've configured a component MyComponentA in a node:

public class MyComponentA implements ComponentA
{
  private OtherService serviceA;
 @Reference
    public void seOtherService(OtherService wService) {
        this.serviceA= wService;
    }
}

Where have I to look in the code to add another OtherService reference
dynamically? Has it just implemented the possibility to add a dynamic
reference inside a component at run-time?

My workpool sample is ready and actually it works with integers. I'm
testing Job mapping in OMElement. I issue a JIRA with attached my
workpool sample with integers.
Cheers,
Giorgio.

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Adding dynamically references

Posted by Giorgio Zoppi <gi...@gmail.com>.
2007/10/23, Simon Nash <na...@hursley.ibm.com>:
> There is something in the assembly spec for this (WiredByImpl) but
> it didn't make it into the Java language binding.
>
> Do you need to dynamically rewire a reference that was previously
> statically wired in the SCDL, or would you be OK with being able
> to wire (and rewire) a reference that was described as WiredByImpl
> in the SCDL?

Ok. I have a component with a reference to another one, i need to add
a new reference to another component. So I need to do by myself.. I
give you an example: Suppose just only jfor a moment, that I create a
component manager service for a node (i know it already exists). I
wanna ask to this component manager: "take components x in a node,
load a component y and wire x to y".
In this way i can load dynamically worker components and binding to my
 workpool in order to balance load between nodes. So i think that's
the second one (WiredByImpl).
Cheers,
Giorgio.

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org


Re: Adding dynamically references

Posted by Simon Nash <na...@hursley.ibm.com>.
There is something in the assembly spec for this (WiredByImpl) but
it didn't make it into the Java language binding.

Do you need to dynamically rewire a reference that was previously
statically wired in the SCDL, or would you be OK with being able
to wire (and rewire) a reference that was described as WiredByImpl
in the SCDL?

   Simon

Giorgio Zoppi wrote:

> Hi,
> I need to add/remove dynamically a reference to another component. For
> example i've configured a component MyComponentA in a node:
> 
> public class MyComponentA implements ComponentA
> {
>   private OtherService serviceA;
>  @Reference
>     public void seOtherService(OtherService wService) {
>         this.serviceA= wService;
>     }
> }
> 
> Where have I to look in the code to add another OtherService reference
> dynamically? Has it just implemented the possibility to add a dynamic
> reference inside a component at run-time?
> 
> My workpool sample is ready and actually it works with integers. I'm
> testing Job mapping in OMElement. I issue a JIRA with attached my
> workpool sample with integers.
> Cheers,
> Giorgio.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-dev-help@ws.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-dev-help@ws.apache.org