[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-02 21:03:10
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv29853/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model Modified Files: JNDIContext.java JNDIEntry.java SearchTypeEditor.java Server.java Log Message: Add some JavaDocs Index: JNDIContext.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/JNDIContext.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JNDIContext.java 30 Apr 2002 21:13:19 -0000 1.2 --- JNDIContext.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 19,43 **** import net.sourceforge.ejtools.awt.GenericCustomizer; import net.sourceforge.ejtools.util.Sort; - import org.apache.log4j.Category; /** ! * Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class JNDIContext extends BeanContextServicesSupport implements BeanContextChildComponentProxy { ! /** Description of the Field */ ! protected String name = ""; ! /** Description of the Field */ ! protected String className = ""; ! /** Description of the Field */ protected transient Customizer c = null; ! /** Constructor for the JndiServer object */ public JNDIContext() { --- 19,41 ---- import net.sourceforge.ejtools.awt.GenericCustomizer; import net.sourceforge.ejtools.util.Sort; /** ! * 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 { ! /** Customizer of the JavaBean */ protected transient Customizer c = null; + /** Class name of the context */ + protected String className = ""; + /** Name of the context */ + protected String name = ""; ! /** Constructor for the JndiServer object */ public JNDIContext() { *************** *** 47,64 **** /** ! * Gets the name attribute of the JNDINode object ! * ! * @return The name value ! */ ! public String getName() ! { ! return this.name; ! } ! ! ! /** ! * Gets the className attribute of the JNDINode object * ! * @return The className value */ public String getClassName() --- 45,51 ---- /** ! * Gets the class name of the context * ! * @return The class name string */ public String getClassName() *************** *** 69,78 **** /** ! * Gets the component attribute of the JNDINode object * ! * @return The component value */ public Component getComponent() { if (c == null) { --- 56,66 ---- /** ! * Gets the JavaBean customizer of the context * ! * @return The customizer */ public Component getComponent() { + // Lazy creation if (c == null) { *************** *** 84,96 **** /** ! * Getter for the service attribute * ! * @param child Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @param bcsrl Description of Parameter ! * @return The value ! * @exception TooManyListenersException Description of Exception */ public Object getService(BeanContextChild child, --- 72,95 ---- /** ! * Gets the name of the context * ! * @return The name string ! */ ! public String getName() ! { ! return this.name; ! } ! ! ! /** ! * Override of BeanContextServicesSupport to allow recursive access to BeanContext services ! * ! * @param child Child which requested the service ! * @param requestor Requester of the service ! * @param serviceClass Class of the service ! * @param serviceSelector Selector for the service ! * @param bcsrl Listener for the revocation ! * @return The requested service ! * @exception TooManyListenersException Exception in case of error */ public Object getService(BeanContextChild child, *************** *** 113,116 **** --- 112,116 ---- catch (ClassCastException cce) { + // Ignore it return null; } *************** *** 124,147 **** /** ! * Description of the Method * ! * @return Description of the Returned Value */ ! public String toString() { ! return name == null ? "Undefined" : name; } /** ! * Description of the Method * ! * @return Description of the Returned Value */ ! public Iterator iterator() { ! return Sort.sortByClassAndName(super.iterator()); } } - --- 124,146 ---- /** ! * Return the children of this context as an iterator * ! * @return The sorted iterator by class and by name */ ! public Iterator iterator() { ! return Sort.sortByClassAndName(super.iterator()); } /** ! * Implementation of toString() method * ! * @return The name of the context */ ! public String toString() { ! return name == null ? "Undefined" : name; } } Index: JNDIEntry.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/JNDIEntry.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JNDIEntry.java 30 Apr 2002 21:13:19 -0000 1.2 --- JNDIEntry.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 8,16 **** /** ! *Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete */ public class JNDIEntry extends JNDIContext --- 8,16 ---- /** ! * Describe a simple JNDI entry. * ! * @author letiemble ! * @created 13 décembre 2001 ! * @version $Revision$ */ 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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SearchTypeEditor.java 30 Apr 2002 21:13:19 -0000 1.2 --- SearchTypeEditor.java 2 May 2002 20:52:10 -0000 1.3 *************** *** 7,26 **** package net.sourceforge.ejtools.jndibrowser.model; import com.dreambean.awt.editors.TagsEditor; /** ! * Description of the Class * ! * @author letiembl ! * @created 2 janvier 2002 ! * @todo Javadoc to complete */ public class SearchTypeEditor extends TagsEditor { ! /** Constructor */ public SearchTypeEditor() { ! super(new String[]{"Shallow", "Deep"}, ! new Object[]{new Integer(Server.SHALLOW_SEARCH), new Integer(Server.DEEP_SEARCH)}); } } --- 7,34 ---- package net.sourceforge.ejtools.jndibrowser.model; + import java.util.ResourceBundle; + import com.dreambean.awt.editors.TagsEditor; /** ! * Custom editor for the search depth. * ! * @author letiemble ! * @created 2 janvier 2002 ! * @version $Revision$ */ public class SearchTypeEditor extends TagsEditor { ! /** Bundle for I18N */ ! private final static ResourceBundle res = ResourceBundle.getBundle("ApplicationResources"); ! ! ! /** Constructor for the SearchTypeEditor object */ public SearchTypeEditor() { ! super(new String[]{res.getString("text.editor.SearchTypeEditor.shallow"), ! res.getString("text.editor.SearchTypeEditor.deep")}, ! new Object[]{new Integer(Server.SHALLOW_SEARCH), ! new Integer(Server.DEEP_SEARCH)}); } } Index: Server.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/Server.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Server.java 30 Apr 2002 21:13:19 -0000 1.3 --- Server.java 2 May 2002 20:52:10 -0000 1.4 *************** *** 1,7 **** /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jndibrowser.model; --- 1,7 ---- /* ! * EJTools, the Enterprise Java Tools * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jndibrowser.model; *************** *** 11,14 **** --- 11,15 ---- import java.util.Properties; import java.util.Vector; + import javax.naming.Context; import javax.naming.InitialContext; *************** *** 22,56 **** import net.sourceforge.ejtools.jndibrowser.model.jms.QueueProxy; import net.sourceforge.ejtools.jndibrowser.model.jms.TopicProxy; import org.apache.log4j.Category; /** ! * Description of the Class * ! * @author letiembl ! * @created 13 décembre 2001 ! * @todo Javadoc to complete ! * @todo Add log4j logs */ public class Server extends JNDIContext { ! private static Category logger = Category.getInstance(Server.class); ! /** Description of the Field */ protected String factory = "org.jnp.interfaces.NamingContextFactory"; ! /** Description of the Field */ protected String initialContext = "/"; ! /** Description of the Field */ protected String pkgs = "org.jboss.naming:org.jnp.interfaces"; ! /** Description of the Field */ protected int searchType = Server.SHALLOW_SEARCH; ! /** Description of the Field */ protected String url = "localhost:1099"; ! ! /** Description of the Field */ public final static int DEEP_SEARCH = 0; ! /** Description of the Field */ public final static int SHALLOW_SEARCH = 1; ! /** Constructor for the JndiServer object */ public Server() { --- 23,59 ---- import net.sourceforge.ejtools.jndibrowser.model.jms.QueueProxy; import net.sourceforge.ejtools.jndibrowser.model.jms.TopicProxy; + import org.apache.log4j.Category; /** ! * 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 { ! /** Description of the Field */ protected String factory = "org.jnp.interfaces.NamingContextFactory"; ! /** Description of the Field */ protected String initialContext = "/"; ! /** Description of the Field */ protected String pkgs = "org.jboss.naming:org.jnp.interfaces"; ! /** Description of the Field */ protected int searchType = Server.SHALLOW_SEARCH; ! /** Description of the Field */ protected String url = "localhost:1099"; ! /** Description of the Field */ ! private static Category logger = Category.getInstance(Server.class); ! /** Description of the Field */ public final static int DEEP_SEARCH = 0; ! /** Description of the Field */ public final static int SHALLOW_SEARCH = 1; ! /** Constructor for the JndiServer object */ public Server() { *************** *** 61,67 **** /** ! * Gets the context attribute of the JNDIServer object * ! * @return The context value */ public String getContext() --- 64,70 ---- /** ! * Gets the context attribute of the JNDIServer object * ! * @return The context value */ public String getContext() *************** *** 72,78 **** /** ! * Gets the provider attribute of the JndiServer object * ! * @return The provider value */ public String getFactory() --- 75,81 ---- /** ! * Gets the provider attribute of the JndiServer object * ! * @return The provider value */ public String getFactory() *************** *** 83,89 **** /** ! * Gets the packages attribute of the JndiServer object * ! * @return The packages value */ public String getPackages() --- 86,92 ---- /** ! * Gets the packages attribute of the JndiServer object * ! * @return The packages value */ public String getPackages() *************** *** 94,100 **** /** ! * Getter for the searchType attribute * ! * @return The value */ public int getSearchType() --- 97,103 ---- /** ! * Getter for the searchType attribute * ! * @return The value */ public int getSearchType() *************** *** 105,111 **** /** ! * Gets the url attribute of the JndiServer object * ! * @return The url value */ public String getUrl() --- 108,114 ---- /** ! * Gets the url attribute of the JndiServer object * ! * @return The url value */ public String getUrl() *************** *** 115,119 **** ! /** Description of the Method */ public void refresh() { --- 118,122 ---- ! /** Description of the Method */ public void refresh() { *************** *** 152,158 **** /** ! * Sets the context attribute of the JNDIServer object * ! * @param context The new context value */ public void setContext(String context) --- 155,161 ---- /** ! * Sets the context attribute of the JNDIServer object * ! * @param context The new context value */ public void setContext(String context) *************** *** 163,169 **** /** ! * Sets the provider attribute of the JndiServer object * ! * @param factory The new factory value */ public void setFactory(String factory) --- 166,172 ---- /** ! * Sets the provider attribute of the JndiServer object * ! * @param factory The new factory value */ public void setFactory(String factory) *************** *** 174,180 **** /** ! * Sets the packages attribute of the JndiServer object * ! * @param pkgs The new packages value */ public void setPackages(String pkgs) --- 177,183 ---- /** ! * Sets the packages attribute of the JndiServer object * ! * @param pkgs The new packages value */ public void setPackages(String pkgs) *************** *** 185,191 **** /** ! * Setter for the searchType attribute * ! * @param searchType The new value */ public void setSearchType(int searchType) --- 188,194 ---- /** ! * Setter for the searchType attribute * ! * @param searchType The new value */ public void setSearchType(int searchType) *************** *** 196,202 **** /** ! * Sets the url attribute of the JndiServer object * ! * @param url The new url value */ public void setUrl(String url) --- 199,205 ---- /** ! * Sets the url attribute of the JndiServer object * ! * @param url The new url value */ public void setUrl(String url) *************** *** 207,216 **** /** ! * Gets the context attribute of the JndiServer object * ! * @param context Description of Parameter ! * @param s Description of Parameter ! * @return The context value ! * @exception NamingException Description of Exception */ private boolean isContext(Context context, String s) throws NamingException --- 210,219 ---- /** ! * Gets the context attribute of the JndiServer object * ! * @param context Description of Parameter ! * @param s Description of Parameter ! * @return The context value ! * @exception NamingException Description of Exception */ private boolean isContext(Context context, String s) throws NamingException *************** *** 229,238 **** /** ! * Description of the Method * ! * @param context Description of Parameter ! * @param s Description of Parameter ! * @param node Description of Parameter ! * @return Description of the Returned Value */ private boolean iterateContext(Context context, String s, Collection node) --- 232,241 ---- /** ! * Description of the Method * ! * @param context Description of Parameter ! * @param s Description of Parameter ! * @param node Description of Parameter ! * @return Description of the Returned Value */ private boolean iterateContext(Context context, String s, Collection node) *************** *** 277,321 **** o = context.lookup(nc.getName()); ! try ! { ! newNode = new EJBHomeProxy(o); ! newNode.name = nc.getName(); ! } ! catch (Exception e1) ! { ! ! try ! { ! newNode = new QueueProxy(o); ! newNode.name = nc.getName(); ! newNode.className = nc.getClassName(); ! } ! catch (Exception e2) ! { ! try ! { ! newNode = new TopicProxy(o); ! newNode.name = nc.getName(); ! newNode.className = nc.getClassName(); ! } ! catch (Exception e3) ! { ! try ! { ! newNode = new ConnectionFactoryProxy(o); ! newNode.name = nc.getName(); ! newNode.className = nc.getClassName(); ! } ! catch (Exception e4) ! { ! } ! } ! } ! } } --- 280,323 ---- o = context.lookup(nc.getName()); ! try ! { ! newNode = new EJBHomeProxy(o); ! newNode.name = nc.getName(); ! } ! catch (Exception e1) ! { ! try ! { ! newNode = new QueueProxy(o); ! newNode.name = nc.getName(); ! newNode.className = nc.getClassName(); ! } ! catch (Exception e2) ! { ! try ! { ! newNode = new TopicProxy(o); ! newNode.name = nc.getName(); ! newNode.className = nc.getClassName(); ! } ! catch (Exception e3) ! { ! try ! { ! newNode = new ConnectionFactoryProxy(o); ! newNode.name = nc.getName(); ! newNode.className = nc.getClassName(); ! } ! catch (Exception e4) ! { ! } + } + } ! } } |