[Ejtools-cvs] CVS: applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model JNDI
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-15 20:45:48
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv6407/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model Modified Files: JNDIContext.java JNDIEntry.java SearchTypeEditor.java Server.java Log Message: Add JavaDocs tags for BeanInfo generation by XDoclet Index: JNDIContext.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/JNDIContext.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JNDIContext.java 2 May 2002 20:52:10 -0000 1.3 --- JNDIContext.java 15 May 2002 20:45:46 -0000 1.4 *************** *** 21,29 **** /** ! * Ancestor of all element in the JNDI tree. Represents a JNDI Context and can contains other context. * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ */ public class JNDIContext extends BeanContextServicesSupport implements BeanContextChildComponentProxy --- 21,32 ---- /** ! * Ancestor of all element in the JNDI tree. Represents a JNDI Context and can ! * contains other context. * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @beaninfo:class displayName="JNDI Context" shortDescription="JNDI Context" ! * @beaninfo:icons color16="/toolbarButtonGraphics/general/Folder16.gif" */ public class JNDIContext extends BeanContextServicesSupport implements BeanContextChildComponentProxy *************** *** 31,35 **** /** Customizer of the JavaBean */ protected transient Customizer c = null; ! /** Class name of the context */ protected String className = ""; /** Name of the context */ --- 34,43 ---- /** Customizer of the JavaBean */ protected transient Customizer c = null; ! /** ! * Class name of the context ! * ! * @beaninfo:property name="name" class="java.lang.String" ! * displayName="Name" shortDescription="Name of the context" ! */ protected String className = ""; /** Name of the context */ *************** *** 62,66 **** public Component getComponent() { ! // Lazy creation if (c == null) { --- 70,74 ---- public Component getComponent() { ! // Lazy creation if (c == null) { *************** *** 83,87 **** /** ! * Override of BeanContextServicesSupport to allow recursive access to BeanContext services * * @param child Child which requested the service --- 91,96 ---- /** ! * Override of BeanContextServicesSupport to allow recursive access to ! * BeanContext services * * @param child Child which requested the service *************** *** 112,116 **** catch (ClassCastException cce) { ! // Ignore it return null; } --- 121,125 ---- catch (ClassCastException cce) { ! // Ignore it return null; } *************** *** 124,128 **** /** ! * Return the children of this context as an iterator * * @return The sorted iterator by class and by name --- 133,137 ---- /** ! * Return the children of this context as an iterator * * @return The sorted iterator by class and by name Index: JNDIEntry.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/JNDIEntry.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JNDIEntry.java 2 May 2002 20:52:10 -0000 1.3 --- JNDIEntry.java 15 May 2002 20:45:46 -0000 1.4 *************** *** 10,19 **** * Describe a simple JNDI entry. * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ */ public class JNDIEntry extends JNDIContext { } - --- 10,24 ---- * Describe a simple JNDI entry. * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @beaninfo:class displayName="JNDI Entry" shortDescription="JNDI Entry" ! * @beaninfo:icons color16="/toolbarButtonGraphics/general/File16.gif" ! * @beaninfo:property name="name" class="java.lang.String" displayName="Name" ! * shortDescription="Name of the entry" ! * @beaninfo:property name="className" class="java.lang.String" ! * displayName="Class" shortDescription="Class of the entry" */ public class JNDIEntry extends JNDIContext { } Index: SearchTypeEditor.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/SearchTypeEditor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Index: Server.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/Server.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Server.java 2 May 2002 20:52:10 -0000 1.4 --- Server.java 15 May 2002 20:45:46 -0000 1.5 *************** *** 10,13 **** --- 10,14 ---- import java.util.Iterator; import java.util.Properties; + import java.util.ResourceBundle; import java.util.Vector; *************** *** 29,37 **** * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class Server extends JNDIContext --- 30,51 ---- * Description of the Class * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Add log4j logs ! * @beaninfo:class displayName="JNDI Server" shortDescription="JNDI Server" ! * @beaninfo:icons color16="/toolbarButtonGraphics/development/Server16.gif" ! * @beaninfo:property name="factory" class="java.lang.String" ! * displayName="Factory" shortDescription="JNDI context factory" ! * @beaninfo:property name="context" class="java.lang.String" ! * displayName="Context" shortDescription="Initial JNDI context" ! * @beaninfo:property name="packages" class="java.lang.String" ! * displayName="Packages" shortDescription="Packages for context" ! * @beaninfo:property name="url" class="java.lang.String" displayName="URL" ! * shortDescription="JNDI Server URL" ! * @beaninfo:property name="searchType" class="int" displayName="Browsing" ! * shortDescription="JNDI context factory" ! * propertyeditor="net.sourceforge.ejtools.jndibrowser.model.SearchTypeEditor" */ public class Server extends JNDIContext *************** *** 53,63 **** /** Description of the Field */ public final static int SHALLOW_SEARCH = 1; ! /** Constructor for the JndiServer object */ public Server() { super(); ! this.name = "JNDI Server"; } --- 67,96 ---- /** Description of the Field */ public final static int SHALLOW_SEARCH = 1; + /** Bundle for I18N */ + private final static ResourceBundle res = ResourceBundle.getBundle("ApplicationResources"); ! /** ! * Constructor for the JndiServer object ! * ! * @todo I18N to complete ! */ public Server() { super(); ! this.name = res.getString("tree.server.name"); ! ! if (System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null) ! { ! this.factory = System.getProperty(Context.INITIAL_CONTEXT_FACTORY); ! } ! if (System.getProperty(Context.URL_PKG_PREFIXES) != null) ! { ! this.pkgs = System.getProperty(Context.URL_PKG_PREFIXES); ! } ! if (System.getProperty(Context.PROVIDER_URL) != null) ! { ! this.url = System.getProperty(Context.PROVIDER_URL); ! } } *************** *** 118,124 **** ! /** Description of the Method */ public void refresh() { Iterator iterator = iterator(); while (iterator.hasNext()) --- 151,163 ---- ! /** ! * Description of the Method ! * ! * @beaninfo:method name="refresh" displayName="Refresh" ! * shortDescription="Refresh the JNDI tree" ! */ public void refresh() { + logger.debug("Cleaning JNDI tree..."); Iterator iterator = iterator(); while (iterator.hasNext()) *************** *** 130,144 **** { Properties props = new Properties(); ! // To change ! props.put("java.naming.factory.initial", this.getFactory()); ! // To change ! props.put("java.naming.factory.url.pkgs", this.getPackages()); props.put(Context.PROVIDER_URL, this.getUrl()); - InitialContext context = new InitialContext(props); ! Vector content = new Vector(); this.iterateContext(context, this.getContext(), content); Iterator it = content.iterator(); while (it.hasNext()) --- 169,186 ---- { Properties props = new Properties(); ! props.put(Context.INITIAL_CONTEXT_FACTORY, this.getFactory()); ! props.put(Context.URL_PKG_PREFIXES, this.getPackages()); props.put(Context.PROVIDER_URL, this.getUrl()); ! Context context = new InitialContext(props); ! logger.debug("Initial context with " + props); ! ! // context = (Context) context.lookup(this.getContext()); + logger.debug("Parsing context " + props); + Vector content = new Vector(); this.iterateContext(context, this.getContext(), content); + logger.debug("Populating JNDI tree..."); Iterator it = content.iterator(); while (it.hasNext()) *************** *** 315,329 **** { } - } } - } - } catch (Exception e1) { } - } catch (Exception e1) --- 357,367 ---- *************** *** 338,342 **** catch (Exception namingexception) { ! System.err.println("iterateContext Exception " + namingexception.getMessage()); return false; } --- 376,380 ---- catch (Exception namingexception) { ! logger.warn("iterateContext Exception " + namingexception.getMessage()); return false; } |