-
1. How to access MC pojo beans from a RAP app
alesj Mar 19, 2011 7:19 AM (in response to csabaszucs)Within RAP, I can also provide a ServletContext object, but the KernelControllerCDFConnector.valid() always return a false value.
How can I solve this issue?
Hmmm, I'm not familiar with RAP.
Which ServletContext instance does this provide?
What we're doing in JBossAS is when creating ServletContext inside JBossWeb/AS code,
we still have access to MC' Kernel and underlying DeploymentUnit,
hence we simply stick it in as an attribute.
* see org.jboss.web.tomcat.service.deployers.JBossContextConfig
Or why using ServletContext?
Can't you push MC layer (aka some MC bean) all the way to RAP layer?
(guessing as I don't know how RAP works ...)
-
2. How to access MC pojo beans from a RAP app
csabaszucs Mar 19, 2011 9:23 AM (in response to alesj)Hello Ales,
The runtime type of the ServletContext instance is org.eclipse.equinox.http.servlet.internal.ServletContextAdaptor.
So that must be the cause the valid() method gives false.
Unfortuntely I don't know how I could put MC beans into RAP, actually that's what I just tried to ask. I also put this message up to RAP user forum, in case they might help me on this.
What I do know is how to access EJBs from RAP.
So maybe a workaround solution could be to delegate MC bean's logics on to an EJB class, and using that EJB class from RAP.
The draw-back here is the need to refactor/change existing classes in BU layer just because of RAP UI layer...
Thanks, anyway.
Csaba
-
3. How to access MC pojo beans from a RAP app
alesj Mar 19, 2011 10:05 AM (in response to csabaszucs)The runtime type of the ServletContext instance is org.eclipse.equinox.http.servlet.internal.ServletContextAdaptor.
So that must be the cause the valid() method gives false.
Perhaps see if you can then tie this ServletContextAdaptor with MC.
e.g. putting the same Kernel and DeploymentUnit attributes in
(or at least Kernel, as that's what you need)
Then your code wouldn't need any change. :-)
-
4. How to access MC pojo beans from a RAP app
alesj Mar 19, 2011 10:08 AM (in response to csabaszucs)What I do know is how to access EJBs from RAP.
So maybe a workaround solution could be to delegate MC bean's logics on to an EJB class, and using that EJB class from RAP.
The draw-back here is the need to refactor/change existing classes in BU layer just because of RAP UI layer...
Afaik, you can inject MC stuff into EJBs.
So you could simply inject MC's Kernel or Controller into EJB and go from there.
If you would to abstract the MC lookup logic, behind some interface:
* from ServletContext
* from EJB
then you probably wouldn't have a hard time changing this.