You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Vinicius Carvalho <vi...@caravelatech.com> on 2009/01/06 13:28:46 UTC

Felix inside web container

Hello there!

After reading the books and the many help got here we started our project,
but there's just one piece of the osgi architecture that I still don't get
it.
I have a background on JEE development, and since the Felix is a registry
one could make an analogy just like JNDI, I know there's much more to the
OSGi platform than only a simple registry, but looking that way, inside a
web container, why would I need my servlets to be registered as services as
well? On a MVC model, the servlets purpose is solely to act as a controller
right?

I was imagining putting the Felix inside a servlet context, much like Spring
app do. And my servlets would consume services provided by the Felix, I
would create some special servlets front ends to install bundles, list them,
update, and the application would only consume the services. Since I have
not seen this approach anywhere I'm guessing I'm doing something terrible
wrong ;). Would this be a good approach? Has anyone tried this before?


Best regards

Re: Felix inside web container

Posted by Vinicius Carvalho <vi...@caravelatech.com>.
Thanks a lot Bertrand, your help is being very very helpful. I've already
have our app starting felix and installing bundles, we used the same
approach as you guys (Bootsrapinstaller) very beautiful. I would like to
talk to you later about how can we use it in our codebase (our app will be
opensource as well) for now I've just copied and paste keeping the header of
the disclaimer.

One thing that I could not understand in your distro is why felix is used
inside the classes/ dir in an exploded way and not a jar inside web-inf/lib
(we are doing this). The same question goes for the HTTPService, I could not
find a jar of equinox httpservice to embedded in my app :(

Regards

On Tue, Jan 13, 2009 at 8:31 AM, Bertrand Delacretaz <bdelacretaz@apache.org
> wrote:

> Hi Vinicius,
>
> On Fri, Jan 9, 2009 at 7:12 PM, Vinicius Carvalho
> <vi...@caravelatech.com> wrote:
> > Bertrand Sling is amazing,...
>
> Thanks!
>
> > ...One thing we really would like is to use some framework to help on the
> > development, I guess I'm just too lazy now that I've used Spring and
> Seam,
> > and all the stuff they do for us (Transaction demarcation, Open Session
> in
> > View, different scopes for beans) and I really wish I could use spring dm
> > also...
>
> I don't have experience mixing Spring DM with Sling, but [1] reports
> getting that to work.
>
> > ...I've got some great guidance from a user (really sorry, do not have
> the
> > message now, otherwise I would name him) about GWT integration, which is
> > another thing we would like to use....
>
> There is a GWT extension for Sling at [2], maybe that helps.
>
> > ...I'm feeling like McGyver, if only I had a bubble gum, a paper clip and
> a
> > pencil ...
>
> I know...paradox of choice ;-)
>
> -Bertrand
>
> [1]
> http://dev.day.com/microsling/content/blogs/main/slingspringspling.html
>
> [2] http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/gwt/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Felix inside web container

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Vinicius,

On Fri, Jan 9, 2009 at 7:12 PM, Vinicius Carvalho
<vi...@caravelatech.com> wrote:
> Bertrand Sling is amazing,...

Thanks!

> ...One thing we really would like is to use some framework to help on the
> development, I guess I'm just too lazy now that I've used Spring and Seam,
> and all the stuff they do for us (Transaction demarcation, Open Session in
> View, different scopes for beans) and I really wish I could use spring dm
> also...

I don't have experience mixing Spring DM with Sling, but [1] reports
getting that to work.

> ...I've got some great guidance from a user (really sorry, do not have the
> message now, otherwise I would name him) about GWT integration, which is
> another thing we would like to use....

There is a GWT extension for Sling at [2], maybe that helps.

> ...I'm feeling like McGyver, if only I had a bubble gum, a paper clip and a
> pencil ...

I know...paradox of choice ;-)

-Bertrand

[1] http://dev.day.com/microsling/content/blogs/main/slingspringspling.html

[2] http://svn.apache.org/repos/asf/incubator/sling/trunk/extensions/gwt/

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


Re: Felix inside web container

Posted by Vinicius Carvalho <vi...@caravelatech.com>.
Bertrand Sling is amazing, I was already checking the source code of it. It
does an impressive job, I've checked how you guys start the container,
register the bundles and so far, it's the best integration we found.

One thing we really would like is to use some framework to help on the
development, I guess I'm just too lazy now that I've used Spring and Seam,
and all the stuff they do for us (Transaction demarcation, Open Session in
View, different scopes for beans) and I really wish I could use spring dm
also.

I've got some great guidance from a user (really sorry, do not have the
message now, otherwise I would name him) about GWT integration, which is
another thing we would like to use. I'm still struggling with GWT it self
since I had no previous experience within it, as soon as I get things
rolling within it I will try to get it working with  OSGi, than I would
follow sling steps (the system console is a must for us), and finally see if
I can mix spring on top of all that.

I'm feeling like McGyver, if only I had a bubble gum, a paper clip and a
pencil ...

On Fri, Jan 9, 2009 at 9:04 AM, Bertrand Delacretaz
<bd...@apache.org>wrote:

> Hi,
>
> On Tue, Jan 6, 2009 at 1:28 PM, Vinicius Carvalho
> <vi...@caravelatech.com> wrote:
> > ...I was imagining putting the Felix inside a servlet context, much like
> Spring
> > app do. And my servlets would consume services provided by the Felix, I
> > would create some special servlets front ends to install bundles, list
> them,
> > update, and the application would only consume the services....
>
> Apache Sling does something similar, you can have a look at the code
> under [1] to see how Felix is started.
>
> Sling allows you to register servlets using SCR annotations, see [2]
> for example, loading a bundle that contains that JsonQueryServlet is
> enough to have it process URLs ending in ".query.json".
>
> See http://incubator.apache.org/sling for general info about Sling.
>
> -Bertrand
>
> [1]
> http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher
>
> [2]
> http://svn.apache.org/repos/asf/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/JsonQueryServlet.java
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Felix inside web container

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Tue, Jan 6, 2009 at 1:28 PM, Vinicius Carvalho
<vi...@caravelatech.com> wrote:
> ...I was imagining putting the Felix inside a servlet context, much like Spring
> app do. And my servlets would consume services provided by the Felix, I
> would create some special servlets front ends to install bundles, list them,
> update, and the application would only consume the services....

Apache Sling does something similar, you can have a look at the code
under [1] to see how Felix is started.

Sling allows you to register servlets using SCR annotations, see [2]
for example, loading a bundle that contains that JsonQueryServlet is
enough to have it process URLs ending in ".query.json".

See http://incubator.apache.org/sling for general info about Sling.

-Bertrand

[1] http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launcher

[2] http://svn.apache.org/repos/asf/incubator/sling/trunk/servlets/get/src/main/java/org/apache/sling/servlets/get/JsonQueryServlet.java

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


Re: Felix inside web container

Posted by Danilo Luiz Rheinheimer <da...@yahoo.com>.
Vinicius,

  I think your idea is correct.

> I was imagining putting the Felix inside a servlet context,
> much like Spring
> app do. And my servlets would consume services provided by

  You are talking here about the embedding mode of felix.
  In this way you will instance a Felix class inside you application. And you can acess the bundles on it, install new bundles and so on.
  You can read more about this here :

  http://felix.apache.org/site/launching-and-embedding-apache-felix.html

  I start to do something like it inside my application, but this project is halted. But I will restart it soon I hope.

  By the way are you from Brazil ? If you are you can send me a private email if you want to talk more about this (in portuguese of course).

Danilo.

--- On Tue, 1/6/09, Vinicius Carvalho <vi...@caravelatech.com> wrote:

> From: Vinicius Carvalho <vi...@caravelatech.com>
> Subject: Felix inside web container
> To: users@felix.apache.org
> Date: Tuesday, January 6, 2009, 8:28 AM
> Hello there!
> 
> After reading the books and the many help got here we
> started our project,
> but there's just one piece of the osgi architecture
> that I still don't get
> it.
> I have a background on JEE development, and since the Felix
> is a registry
> one could make an analogy just like JNDI, I know
> there's much more to the
> OSGi platform than only a simple registry, but looking that
> way, inside a
> web container, why would I need my servlets to be
> registered as services as
> well? On a MVC model, the servlets purpose is solely to act
> as a controller
> right?
> 
> I was imagining putting the Felix inside a servlet context,
> much like Spring
> app do. And my servlets would consume services provided by
> the Felix, I
> would create some special servlets front ends to install
> bundles, list them,
> update, and the application would only consume the
> services. Since I have
> not seen this approach anywhere I'm guessing I'm
> doing something terrible
> wrong ;). Would this be a good approach? Has anyone tried
> this before?
> 
> 
> Best regards


      

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