Update of /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/session/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25649/modules/ejb/src/xdoclet/modules/ejb/session/resources
Modified Files: session.xdt Log Message: statefull session bean passivation implemented (XDT-1325) Index: session.xdt =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/session/resources/session.xdt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** session.xdt 10 Apr 2005 13:13:24 -0000 1.14 --- session.xdt 10 Apr 2005 16:49:05 -0000 1.15 *************** *** 13,16 **** --- 13,50 ---- public void ejbActivate() <XDtMethod:exceptionList method="ejbActivate"/> { + + <XDtEjbSession:ifStatefulSession> + <XDtEjbEnv:ifHasTag tagName="ejb.resource-ref,ejb.resource-env-ref,ejb.destination-ref,ejb.ejb-service-ref"> + javax.naming.Context namingCtx = null; + try + { + namingCtx = new javax.naming.InitialContext(); + <XDtEjbEnv:forAllMemberTags tagName="ejb.resource-env-ref,ejb.destination-ref,ejb.ejb-service-ref"> + <XDtEjbEnv:memberName/> = (<XDtEjbEnv:type/>) namingCtx.lookup("java:comp/env/<XDtEjbEnv:name paramName="name"/>"); + </XDtEjbEnv:forAllMemberTags> + <XDtEjbEnv:forAllMemberTags tagName="ejb.resource-ref"> + <XDtEjbEnv:memberName/> = (<XDtEjbEnv:type/>) namingCtx.lookup("java:comp/env/<XDtEjbEnv:name paramName="res-name,res-ref-name"/>"); + </XDtEjbEnv:forAllMemberTags> + } + catch(javax.naming.NamingException e) + { + throw new javax.ejb.EJBException("lookup failed", e); + } + finally { + if (namingCtx != null) + { + try + { + namingCtx.close(); + } + catch(javax.naming.NamingException e) + { + e.printStackTrace(); + } + } + } + </XDtEjbEnv:ifHasTag> + </XDtEjbSession:ifStatefulSession> + <XDtMethod:ifHasMethod name="ejbActivate"> super.ejbActivate(); *************** *** 23,26 **** --- 57,65 ---- super.ejbPassivate(); </XDtMethod:ifHasMethod> + <XDtEjbSession:ifStatefulSession> + <XDtEjbEnv:forAllMemberTags tagName="ejb.resource-ref,ejb.resource-env-ref,ejb.destination-ref,ejb.ejb-service-ref,"> + <XDtEjbEnv:memberName/> = null; + </XDtEjbEnv:forAllMemberTags> + </XDtEjbSession:ifStatefulSession> } ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-devel mailing list xdoclet-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-devel