[jboss-user] [Microcontainer] - Re: Microcontainer support in Netty
alesj
do-not-reply at jboss.com
Mon Jan 12 08:04:28 EST 2009
"trustin" wrote :
| * A glue module that combines all together to run the server up
| (will look up proper handler and codec instances via KernelController
| - I guess it's a piece of cake, right?)
|
I would try to use MC's API as little as possible.
Your stuff is all about beans, so we should be able to handle it w/o the explicit usage of MC API.
e.g. contextual injection, callbacks, installs, value-factory, ...
"trustin" wrote :
| Should I use some call back in this case, or does MC hide this race condition during upgrade (or redeployment)?
|
I would use callback.
e.g. callback on addProtocol(Protocol p)
Nope, MC doesn't explicitly handle that.
But if you would have proper dependencies, this would not matter.
"trustin" wrote :
| BTW, I still didn't figure out how to hide internal beans. How can I
| exactly do that?
|
Annotate your bean with @DeploymentScope and @ApplicationScope - via xml or directly on the class.
This will move the bean out of main Kernel(Controller) into a scoped one.
By default your scoped bean only 'sees' its scope and ancestors.
But you can 'change' the lookup order with @Search markup.
@Search takes type on how to search - currently only annotation support.
But you need to explicitly add SearchAnnotationPlugin - see the tests on how to do it.
"trustin" wrote :
| I'm also thinking about distributing a minimal JBossMC binary tarball
| with my tutorial so that a user can play with MC more easily (i.e.
| untar and drop the sample JARs etc etc). I think it might help MC
| adoption because people are really used to just downloading a Tomcat
| tarball and dropping a WAR and see it working. We already have
| something similar in jboss-demos, but I think it needs to be a binary
| form so that users can familiarize with MC quickly. I can do this
| while I write my tutorial. WDYT?
I would add your example directly under mc-demos.
Simply create new netty sub-module and hack all the stuff there.
See my previous examples on how to do this, following the same concept.
Glue code:
- bootstrap
- jmx
- classloading
Actual example code:
- models
- ioc
- classpath
Then simply link the tutorial to that code.
Or even better, write a simple article about it at DZone,
could be even part of my MC series - more than welcome to 'host' it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4200980#4200980
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4200980
More information about the jboss-user
mailing list