Hi

I have a few questions, I am looking for understanding rather than a
solution to any particular problem.

The following code comes from the
org.apache.tapestry.services.TapestryModule

/**
     * A wrapper around {...@link
<%...@link>org.apache.tapestry5.internal.services.PageRenderQueue} used
for partial
page renders.
     * Supports an ordered configuration of {...@link
<%...@link>org.apache.tapestry5.services.PartialMarkupRendererFilter}s.
     *
     * @see
#contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration,
org.apache.tapestry5.Asset,
     *      org.apache.tapestry5.ioc.services.SymbolSource, AssetSource)
     */
    public PartialMarkupRenderer buildPartialMarkupRenderer(Logger logger,

List<PartialMarkupRendererFilter> configuration,
                                                            @Autobuild
PartialMarkupRendererTerminator terminator)
    {
        return pipelineBuilder.build(logger, PartialMarkupRenderer.class,
PartialMarkupRendererFilter.class,
                                     configuration, terminator);
    }


The questions that I have relate to the code above:

1) What is the type of the instance of the class that gets built by the
pipelineBuilder (ignoring the fact that it is a proxy)?  I would have
expected it to be a PartialMarkupRenderer but some experimenting has led me
to believe that it may be an instance of a
PartialMarkupRendererFilter.   The source of my confusion is that  I have
built an almost exact replica of the setup in the TapestryModule for this
particular pipeline (using all my own mirror interfaces to avoid
ambigouity). I have then injected my service into a component and called a
service method on the injected instance and received the following
error "Method
void renderMarkup(org.apache.tapestry5.MarkupWriter,
org.apache.tapestry5.json.JSONObject) has no match in filter
interface com.mypackage.PartialMarkupRendererFilter."  suggesting that an
instance of the Filter that was injected into my component and not an
instance of the service (which does have that method)

2) If I was to copy the above code exactly and paste it into my own module
then change the name to  buildMyOwnPartialMarkupRenderer()
     a) how would I disambiguate the two services which were built (i.e. the
one in the TapestryModule and the one in my module) so that I did not get
the error "Automatic dependency resolution requires that exactly one service
implement the interface".
     b) Assumin gthat this is possible how would I then disambiguate in the
page or a component where the service is to be injected.
     c) would the List of PartialMarkupRendererFilters which gets passed
into my builder method be the same instance that gets passed in to the
TapestryModule builder method?

Regards

Stephen

Reply via email to