Wouldn't it be nice to let the same class look up local interfaces too? <aslak/>
-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Konstantin Priblouda Sent: 8. oktober 2001 19:13 To: [EMAIL PROTECTED] Subject: [Xdoclet-devel] Utility class subtask Hi folks, I added new subtask for generation of utility objects ( to made lookup of home interfaces easy ) Generated class looks like: ---snip--- /** * Generatedutility for bank/Teller. Do not edit! */ package test.interfaces; import java.lang.*; import javax.ejb.*; import java.util.Collection; import javax.rmi.PortableRemoteObject; import javax.naming.NamingException; import javax.naming.InitialContext; import java.util.Collection; /** * This is a teller bean. It is an example of how to use the XDoclet tags. * @xdoclet-generated at Oct 8, 2001 7:12:14 PM */ public class TellerUtil { // static reference to initial context public static InitialContext ic = null; private static test.interfaces.TellerHome home = null; // home interface lookup methods // obtain initial context private static synchronized InitialContext getIC() throws NamingException { if(ic == null) { ic = new InitialContext(); } return ic; } // obtain home interface public static synchronized test.interfaces.TellerHome getHome() throws NamingException { getIC(); if(home == null) { Object objRef = ic.lookup(test.interfaces.TellerHome.COMP_NAME); home = (test.interfaces.TellerHome)PortableRemoteObject.narrow(objRef, test.interfaces.TellerHome.class); } return home; } } ---snap--- Future direction may be generatinng special stuff for local interfaces ( do we need this? ) or whatever else that seems convenient to place there. Ara also proposed of generating single util class per package which would lookup every of the required beans have fun, ===== Konstantin Priblouda ( ko5tik ) Freelance Software developer < http://www.pribluda.de > < play java games -> http://www.yook.de > < render charts online -> http://www.pribluda.de/povray/ > __________________________________________________ Do You Yahoo!? NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1 _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
