[jboss-user] [Microcontainer] - Re: Programmatically deploying an object

alesj do-not-reply at jboss.com
Fri May 22 16:17:42 EDT 2009


"mwringe" wrote : Ok, lets try this again. And please don't post code from somewhere and refuse to explain it. Looking through the code doesn't help if I don't know in what context to use it :)
  | 
This sounds to me like hand holding, which is something I don't do,
at least to a project that is not what I should be working on. ;-)

Second, it sounds like you didn't or aren't willing to do any investigation.
Which means I should do your homework.

If I say it's simple, I say it because it is, not to mislead you or show off.
As I know you previously did quite well with deployers,
I very much doubt that you're not able to trace down ServletContext's purpose in that code.

"mwringe" wrote : 
  | The situation is that I need to have access to the servlet context for deployment (see http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228452 and https://jira.jboss.org/jira/browse/JBAS-6865). Until its actually supported properly, I need to find away around it.
  | 
This is a different issue, just the opposite of what your initial post was about.
But that is something to be, unfortunately, addressed by the jbw/tomcat guys.
And if things go .tld way, we're in for a long waiting. ;-)

"mwringe" wrote : 
  | If I use a servlet context listener, I can easily get this object when the webapp is initialized. So I know how to get the servlet context indirectly, but the servletcontextlistener is handled by the server and not the microcontainer.
  | 
Your first post said you're fine with this.

And this is exactly how mc-int helps you.
You should provide a custom ServletContextListener (SCL),
which then uses MC-int to get proper underlying Kernel or DeploymentUnit.
Kernel --> Controller --> register or do lookup
(VFS)DeploymentUnit --> check resources or any attachments

"mwringe" wrote : 
  | Is there a proper way too add this object as an attachment to the deployment unit for the war? Or to hook this into the microcontainer to do so?
Which object?

If you mean SCL, you could just add a deployer, 
that requires JBWMD + JBPortalMD --> add new SCL metadata to JBWMD

WebBeans deployers do something similar,
or do I need to draw this one down again ... sarc ... ;-)


View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232821#4232821

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4232821



More information about the jboss-user mailing list