On Thu, Jan 15, 2009 at 4:42 PM, Jared Ladner <[email protected]>wrote:

> Hi,
>
> I have been reviewing Tuscany SCA for a couple of days and I am trying to
> determine if it will suit my requirements for dynamically locating services
> (dynamically meaning using a config file and no code changes).
>
> I have an application that needs to locate new service implementations of a
> non remote Java Interface.  The Implementation is simply a JAR that is
> dropped into the classpath.  I would like to only add the new service/JAR as
> a config entry into the Tuscany '*.composite' file without making any code
> changes.  A server restart is acceptable.  Is this possible?
>
> Sequence
> 1. Input to 'core' application is Web Service (does not need to be
> associated with Tuscany SCA)
> 2. Core app will find available services loadded from the Tuscany SCA
> 3. Make API calls (from non remote Interface) to all available services.
>
> The Services are simple Java Interfaces.  Currently they are NOT web
> services or even remote, but will only be JAR file added to the classpath.
>
> The examples that I have seen define the services as a reference in the
> '*.composite' file.  This is fine but the implemenation code that uses the
> reference is hard coded to have a matching reference member variable.  I
> need this to be dynamic.
>
> Please help!
>
> Thanks,
> Jared
> SCJD,SCWCD,SCBCD
>
>
Hi Jared, Welcome.

It would be possible to add a new service to a SCA composite in the way that
you describe, i.e. add jar to classpath, update composite file, restart
node. However you would need to wire something to the service to make use of
it.

I've had a similar question before (or at least I think it's similar to your
case). Someone wanted to implement a scheduler component which could talk to
a dynamic number of worker nodes. I made a quick example to give an idea of
how this dynamic behaviour can work [1]. Take a look and see if this matches
your defintion of dynamic. If the code doesn't make sense I can talk you
through it.

The schedler code might not be completely right for you but if we can agree
what the question is we might be able to come up with an approach.

Hope that helps

Simon

[1]  http://svn.apache.org/repos/asf/tuscany/sandbox/slaws/scheduler/

Reply via email to