[jboss-dev-forums] [Design of JBoss Web Services] - EJBContext as an attachment in WebServiceContext
jaikiran
do-not-reply at jboss.com
Tue Jun 16 10:23:23 EDT 2009
Currently in our EJB3 StatelessContainer http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/core/src/main/java/org/jboss/ejb3/stateless/StatelessContainer.java we have WSCallbackImpl which is a callback for BeanContext creation and removal:
static class WSCallbackImpl implements BeanContextLifecycleCallback
| {
| private ExtensibleWebServiceContext jaxwsContext;
| private javax.xml.rpc.handler.MessageContext jaxrpcMessageContext;
|
| public WSCallbackImpl(javax.xml.rpc.handler.MessageContext jaxrpc, ExtensibleWebServiceContext jaxws)
| {
| jaxrpcMessageContext = jaxrpc;
| jaxwsContext = jaxws;
| }
|
| public void attached(BeanContext beanCtx)
| {
| // JAX-RPC MessageContext
| StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
| sbc.setMessageContextJAXRPC(jaxrpcMessageContext);
|
| // JAX-WS MessageContext
| BeanProperty beanProp = sbc.getWebServiceContextProperty();
| if (beanProp != null)
| {
| EJBContext ejbCtx = beanCtx.getEJBContext();
| jaxwsContext.addAttachment(EJBContext.class, ejbCtx);
| beanProp.set(beanCtx.getInstance(), jaxwsContext);
| }
| }
|
| public void released(BeanContext beanCtx)
| {
| StatelessBeanContext sbc = (StatelessBeanContext)beanCtx;
| sbc.setMessageContextJAXRPC(null);
|
| BeanProperty beanProp = sbc.getWebServiceContextProperty();
| if (beanProp != null)
| beanProp.set(beanCtx.getInstance(), null);
| }
| }
As seen in the code, on the BeanContext callback, we attach the EJBContext as an attachment to the WebServiceContext. Does JBossWS still require this EJBContext within the WebServiceContext or can we stop attaching this?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4237949#4237949
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4237949
More information about the jboss-dev-forums
mailing list