You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Andreas Hartmann <an...@apache.org> on 2003/07/10 16:46:30 UTC

Getting ServiceSelector instead of ComponentSelector

Hi Cocoon developers,

I define a component selector in my roles file:

<role name="org.apache.lenya.cms.ac2.AccreditableManagerSelector"
       shorthand="accreditable-managers"
       default-class="org.apache.avalon.excalibur
                 .component.ExcaliburComponentSelector">
   ...
</role>

and set it up in cocoon.xconf:

<accreditable-managers>
   <component-instance logger="lenya.ac.accreditablemanager"
     class="org.apache.lenya.cms.ac2.file.FileAccreditableManager"
     name="file"/>
</accreditable-managers>


But when I try to get the selector in my Java class, I get
an org.apache.avalon.framework.service.WrapperServiceSelector
instead of the ExcaliburComponentSelector. Can anyone tell me
how to avoid this? Is it because my client object is a Serviceable
and not a Composable?

BTW, which class should one use as the default ServiceSelector
instead of the ExcaliburComponentSelector that depends on the
deprecated ComponentSelector?

Thanks in advance!
Andreas



Re: Getting ServiceSelector instead of ComponentSelector

Posted by Berin Loritsch <bl...@apache.org>.
Andreas Hartmann wrote:

> Hi Cocoon developers,
> 
> I define a component selector in my roles file:
> 
> <role name="org.apache.lenya.cms.ac2.AccreditableManagerSelector"
>       shorthand="accreditable-managers"
>       default-class="org.apache.avalon.excalibur
>                 .component.ExcaliburComponentSelector">
>   ...
> </role>
> 
> and set it up in cocoon.xconf:
> 
> <accreditable-managers>
>   <component-instance logger="lenya.ac.accreditablemanager"
>     class="org.apache.lenya.cms.ac2.file.FileAccreditableManager"
>     name="file"/>
> </accreditable-managers>
> 
> 
> But when I try to get the selector in my Java class, I get
> an org.apache.avalon.framework.service.WrapperServiceSelector
> instead of the ExcaliburComponentSelector. Can anyone tell me
> how to avoid this? Is it because my client object is a Serviceable
> and not a Composable?

Yes.

> BTW, which class should one use as the default ServiceSelector
> instead of the ExcaliburComponentSelector that depends on the
> deprecated ComponentSelector?

When we can go Fortress instead of ECM, you can use that.  In the
mean time, ECM requires you to use the old Composable stuff.

-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin