Hello!

I have created a component, as explained in the tutorials. Let's call it
"Component". Component has two services, ServiceA and ServiceB. Both of
these services take a while to complete, and should be executed in sequence,
since ServiceB depends on the completion of ServiceA.

I declare my services like this:

  public Interface ServiceA
  {
    Object getStuff();
  }

  public Interface ServiceAObject extends IServiceA, runnable
  {
    void setStuff(Object stuff);
  }

  public Class ServiceAImpl implements ServiceAObject
  {
    private Object stuff;

    Object getStuff()
    {
      return stuff;
    }

    void setStuff(Object stuff)
    {
      this.stuff = stuff;
    }

  }


Same idea for ServiceB.

My Avalon service providers implement ServiceA and ServiceB respectively.


My questions are:

1. When I was using only ServiceA, I only had to make a call to
   getStuff() in initialize(). At that time, I didn't really
   stop to think about the mechanism. I would like to know
   what actually fires off the service.

2. How can I get Component to wait for the completion of
   ServiceA so I can fire ServiceB?


I tried making a direct call to serviceA.start(), but that didn't work. I
don't think that I should be making my service providers Runnable.

So, there's something I'm not getting here...


Can anybody help me understand this, please?


Thanks so much!!



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to