You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Kevin Williams <kj...@gmail.com> on 2007/05/08 01:22:44 UTC

"cross-composite" locate service

I have been looking into the single failing test case in itest/extended-api
(currently skipped via @ignore).  This test drives an attempt by a component
service to get a handle to a service provided by a component in a separate
composite using context.getService()

Here is the relevant part of the test:


@Service(BasicService.class)
public class BasicServiceImpl implements BasicService {

    @Context
    protected ComponentContext context;

    public int negate(int theInt) {
        return -theInt;
    }

    public int delegateNegate(int theInt) {

        MathService service = context.getService(MathService.class,
"MathServiceComponent");

        return service.negate(theInt);

    }

}

The test initializes the SCADomain like this:

      domain =  SCADomain.newInstance("sca://local", ".", "
BasicService.composite", "MathService.composite");

I have traced through the domain initialization code and both composites
seem to be added to the Domain correctly and it looks like wires are created
for the single component in each composite.  However, when
context.getService is called, it seems to only consider the immediate
context and fails to find a reference for MathService.  The only available
reference is to $self$.

Should context.getService also have access to domain-level information?

Thanks to Ant for modifying this test based on the new Domain APIs.

--Kevin