You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@abdera.apache.org by David Primmer <da...@gmail.com> on 2008/04/16 03:35:09 UTC

CustomProvider example not intended to host more than one adapter?

I've swapped out routing in the CustomProvider and I'm trying to use
multiple adapters. CP extends AbstractWorkspaceProvider. That
implements WorkspaceManager which requires you to implement
getCollectionAdapter(RequestContext request) in your provider; This is
easy if you just use one adapter in this provider, you just return it
as the sample shows. However, what if you have a number of workspaces
and adapters. AbstractWorkspaceProvider looks like it should support
this.

Since I'm using RouteManager I thought the RouteManager.resolve would
handle this dispatching.  Should I abandon CP for DefaultProvider?

thanks again!

davep

Re: CustomProvider example not intended to host more than one adapter?

Posted by David Primmer <da...@gmail.com>.
There is something very similar to this in RouteManager.resolve but it
returns a target object and not a CA. I suppose i can just lift that
code. Now I understand why it still finds the CA when the last
collectionadapter argument was left off in the DefaultProvider's route
specifications. Thanks.

davep

On Tue, Apr 15, 2008 at 7:58 PM, James M Snell <ja...@gmail.com> wrote:
> The CustomProvider example only supports a single adapter but the
> AbstractWorkspaceProvider can provide as many as necessary by overriding the
> getCollectionAdapter(RequestContext) method.  I have a current
> implementation using a subclass of AWP that returns one of five different
> adapters depending on the Target type.
>
>  - James
>
>
>
>  David Primmer wrote:
>
> > I've swapped out routing in the CustomProvider and I'm trying to use
> > multiple adapters. CP extends AbstractWorkspaceProvider. That
> > implements WorkspaceManager which requires you to implement
> > getCollectionAdapter(RequestContext request) in your provider; This is
> > easy if you just use one adapter in this provider, you just return it
> > as the sample shows. However, what if you have a number of workspaces
> > and adapters. AbstractWorkspaceProvider looks like it should support
> > this.
> >
> > Since I'm using RouteManager I thought the RouteManager.resolve would
> > handle this dispatching.  Should I abandon CP for DefaultProvider?
> >
> > thanks again!
> >
> > davep
> >
> >
>

Re: CustomProvider example not intended to host more than one adapter?

Posted by James M Snell <ja...@gmail.com>.
The CustomProvider example only supports a single adapter but the 
AbstractWorkspaceProvider can provide as many as necessary by overriding 
the getCollectionAdapter(RequestContext) method.  I have a current 
implementation using a subclass of AWP that returns one of five 
different adapters depending on the Target type.

- James

David Primmer wrote:
> I've swapped out routing in the CustomProvider and I'm trying to use
> multiple adapters. CP extends AbstractWorkspaceProvider. That
> implements WorkspaceManager which requires you to implement
> getCollectionAdapter(RequestContext request) in your provider; This is
> easy if you just use one adapter in this provider, you just return it
> as the sample shows. However, what if you have a number of workspaces
> and adapters. AbstractWorkspaceProvider looks like it should support
> this.
> 
> Since I'm using RouteManager I thought the RouteManager.resolve would
> handle this dispatching.  Should I abandon CP for DefaultProvider?
> 
> thanks again!
> 
> davep
>