You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by David Daniel <da...@gmail.com> on 2016/05/31 18:44:17 UTC

Where can I find the default implementation of httpcontext

When no implementation of httpcontext is passed in to felix what is the
default implementation used.  Where can I find this code in source
control.

Thanks for any help,
  David

Re: Where can I find the default implementation of httpcontext

Posted by Carsten Ziegeler <cz...@apache.org>.
Raymond Auge wrote
> I believe in the latest felix http impl Carsten added a feature to be able
> to target legacy contexts using DS via http whiteboard.
> 
> However, you need to know the name of this legacy context
> and I'm not sure how you do that in the felix impl.
> 
Yes, you can reference the http contexts using the whiteboard by specifying
the value "org.osgi.service.http" for the context name property.

But this is - as Ray notes - implementation specific. The next version
of the http whiteboard spec might have a solution for this

Regards
Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Where can I find the default implementation of httpcontext

Posted by Raymond Auge <ra...@liferay.com>.
I believe in the latest felix http impl Carsten added a feature to be able
to target legacy contexts using DS via http whiteboard.

However, you need to know the name of this legacy context
and I'm not sure how you do that in the felix impl.

@Carsten?

- Ray

On Tue, May 31, 2016 at 4:11 PM, David Daniel <da...@gmail.com>
wrote:

> I am using whiteboard to register my servlets but i also use the jaxrs
> connector https://github.com/hstaudacher/osgi-jax-rs-connector.  My custom
> filter is called on rest calls but I do not seem to be getting the correct
> context.  I am not sure if it is similar to
> https://github.com/hstaudacher/osgi-jax-rs-connector/issues/99  or not.  I
> can see how to set the context for the connector by implementing this class
>
> https://github.com/hstaudacher/osgi-jax-rs-connector/blob/master/bundles/com.eclipsesource.jaxrs.publisher/src/com/eclipsesource/jaxrs/publisher/ServletConfiguration.java
> but I do not know how to get an already created context from the
> httpservice.  I do know how to set the context for a given path using
> declarative services though.  My thinking was that I could just create a
> class based off the default context and set it in declarative services and
> return it in the ServletConfiguration.  It seems kinda hacky to me but I
> couldn't think of a better way.  Am I on the wrong track.
>
> On Tue, May 31, 2016 at 3:50 PM, Raymond Auge <ra...@liferay.com>
> wrote:
>
> > You may want to consider moving to Http Whiteboard. It's much more
> flexible
> > particularly around context.
> >
> > - Ray
> >
> > On Tue, May 31, 2016 at 3:04 PM, David Daniel <
> david.daniel.1979@gmail.com
> > >
> > wrote:
> >
> > > I'm ok.  I think I found it.
> > >
> > >
> > >
> >
> https://github.com/apache/felix/blob/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/DefaultHttpContext.java
> > >
> > > On Tue, May 31, 2016 at 2:44 PM, David Daniel <
> > david.daniel.1979@gmail.com
> > > >
> > > wrote:
> > >
> > > > When no implementation of httpcontext is passed in to felix what is
> the
> > > > default implementation used.  Where can I find this code in source
> > > > control.
> > > >
> > > > Thanks for any help,
> > > >   David
> > > >
> > >
> >
> >
> >
> > --
> > *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
> >  (@rotty3000)
> > Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
> >  (@Liferay)
> > Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> > (@OSGiAlliance)
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

Re: Where can I find the default implementation of httpcontext

Posted by David Daniel <da...@gmail.com>.
I am using whiteboard to register my servlets but i also use the jaxrs
connector https://github.com/hstaudacher/osgi-jax-rs-connector.  My custom
filter is called on rest calls but I do not seem to be getting the correct
context.  I am not sure if it is similar to
https://github.com/hstaudacher/osgi-jax-rs-connector/issues/99  or not.  I
can see how to set the context for the connector by implementing this class
https://github.com/hstaudacher/osgi-jax-rs-connector/blob/master/bundles/com.eclipsesource.jaxrs.publisher/src/com/eclipsesource/jaxrs/publisher/ServletConfiguration.java
but I do not know how to get an already created context from the
httpservice.  I do know how to set the context for a given path using
declarative services though.  My thinking was that I could just create a
class based off the default context and set it in declarative services and
return it in the ServletConfiguration.  It seems kinda hacky to me but I
couldn't think of a better way.  Am I on the wrong track.

On Tue, May 31, 2016 at 3:50 PM, Raymond Auge <ra...@liferay.com>
wrote:

> You may want to consider moving to Http Whiteboard. It's much more flexible
> particularly around context.
>
> - Ray
>
> On Tue, May 31, 2016 at 3:04 PM, David Daniel <david.daniel.1979@gmail.com
> >
> wrote:
>
> > I'm ok.  I think I found it.
> >
> >
> >
> https://github.com/apache/felix/blob/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/DefaultHttpContext.java
> >
> > On Tue, May 31, 2016 at 2:44 PM, David Daniel <
> david.daniel.1979@gmail.com
> > >
> > wrote:
> >
> > > When no implementation of httpcontext is passed in to felix what is the
> > > default implementation used.  Where can I find this code in source
> > > control.
> > >
> > > Thanks for any help,
> > >   David
> > >
> >
>
>
>
> --
> *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
>  (@rotty3000)
> Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
>  (@Liferay)
> Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
> (@OSGiAlliance)
>

Re: Where can I find the default implementation of httpcontext

Posted by Raymond Auge <ra...@liferay.com>.
You may want to consider moving to Http Whiteboard. It's much more flexible
particularly around context.

- Ray

On Tue, May 31, 2016 at 3:04 PM, David Daniel <da...@gmail.com>
wrote:

> I'm ok.  I think I found it.
>
>
> https://github.com/apache/felix/blob/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/DefaultHttpContext.java
>
> On Tue, May 31, 2016 at 2:44 PM, David Daniel <david.daniel.1979@gmail.com
> >
> wrote:
>
> > When no implementation of httpcontext is passed in to felix what is the
> > default implementation used.  Where can I find this code in source
> > control.
> >
> > Thanks for any help,
> >   David
> >
>



-- 
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
 (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
 (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)

Re: Where can I find the default implementation of httpcontext

Posted by David Daniel <da...@gmail.com>.
I'm ok.  I think I found it.

https://github.com/apache/felix/blob/trunk/http/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/DefaultHttpContext.java

On Tue, May 31, 2016 at 2:44 PM, David Daniel <da...@gmail.com>
wrote:

> When no implementation of httpcontext is passed in to felix what is the
> default implementation used.  Where can I find this code in source
> control.
>
> Thanks for any help,
>   David
>