[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-25 20:54:50
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv5113/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model Modified Files: JNDIContext.java JNDIEntry.java Server.java Log Message: Pretty print Index: JNDIContext.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/JNDIContext.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JNDIContext.java 24 May 2002 21:18:55 -0000 1.5 --- JNDIContext.java 25 May 2002 20:54:47 -0000 1.6 *************** *** 1,218 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package net.sourceforge.ejtools.jndibrowser.model; ! ! import java.awt.Component; ! import java.beans.Customizer; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChild; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextServiceRevokedListener; ! import java.beans.beancontext.BeanContextServices; ! import java.beans.beancontext.BeanContextServicesSupport; ! import java.util.Iterator; ! import java.util.TooManyListenersException; ! ! import net.sourceforge.ejtools.awt.GenericCustomizer; ! import net.sourceforge.ejtools.util.Sort; ! ! import org.apache.log4j.Category; ! ! /** ! * 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" ! * @beaninfo:property name="name" class="java.lang.String" displayName="Name" ! * shortDescription="Name of the context" ! * @beaninfo:property name="path" class="java.lang.String" displayName="Full ! * Path" shortDescription="Absolute path of the context" ! */ ! 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 = ""; ! /** Description of the Field */ ! private static Category logger = Category.getInstance(JNDIContext.class); ! ! ! /** Constructor for the JndiServer object */ ! public JNDIContext() ! { ! super(); ! } ! ! ! /** ! * Gets the class name of the context ! * ! * @return The class name string ! */ ! public String getClassName() ! { ! return this.className; ! } ! ! ! /** ! * Gets the JavaBean customizer of the context ! * ! * @return The customizer ! */ ! public Component getComponent() ! { ! // Lazy creation ! if (c == null) ! { ! c = new GenericCustomizer(true, this); ! } ! return (Component) c; ! } ! ! ! /** ! * Gets the name of the context ! * ! * @return The name string ! */ ! public String getName() ! { ! return this.name; ! } ! ! ! /** ! * Get the absolute JNDI path of the context ! * ! * @return The path value ! */ ! public String getPath() ! { ! try ! { ! BeanContext parent = getBeanContext(); ! if (parent != null) ! { ! JNDIContext context = (JNDIContext) parent; ! String path = context.getPath(); ! if ((path == null) || ("".equals(path))) ! { ! return (getName()); ! } ! else ! { ! return (path + "/" + getName()); ! } ! } ! else ! { ! return ""; ! } ! } ! catch (Exception e) ! { ! logger.warn("Oops, not in a JNDIContext"); ! } ! return null; ! } ! ! ! /** ! * 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, ! Object requestor, ! Class serviceClass, ! Object serviceSelector, ! BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException ! { ! Object service = super.getService(child, requestor, serviceClass, serviceSelector, bcsrl); ! ! // If the service requested is not provided by this BeanContext, try the parent ! if (service == null) ! { ! BeanContextServices bcs = null; ! ! try ! { ! bcs = (BeanContextServices) getBeanContext(); ! } ! catch (ClassCastException cce) ! { ! // Ignore it ! return null; ! } ! ! return bcs.getService(this, requestor, serviceClass, serviceSelector, bcsrl); ! } ! ! return service; ! } ! ! ! /** ! * 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; ! } ! ! ! /** ! * Sets the class name of this context ! * ! * @param className The class name ! */ ! protected void setClassName(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the name of this context ! * ! * @param name The name ! */ ! protected void setName(String name) ! { ! this.name = name; ! } ! ! } --- 1,212 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package net.sourceforge.ejtools.jndibrowser.model; ! ! import java.awt.Component; ! import java.beans.Customizer; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChild; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextServiceRevokedListener; ! import java.beans.beancontext.BeanContextServices; ! import java.beans.beancontext.BeanContextServicesSupport; ! import java.util.Iterator; ! import java.util.TooManyListenersException; ! ! import net.sourceforge.ejtools.awt.GenericCustomizer; ! import net.sourceforge.ejtools.util.Sort; ! ! import org.apache.log4j.Category; ! ! /** ! * 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" ! * @beaninfo:property name="name" class="java.lang.String" displayName="Name" shortDescription="Name of the context" ! * @beaninfo:property name="path" class="java.lang.String" displayName="Full Path" shortDescription="Absolute path of the context" ! */ ! 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 = ""; ! /** Description of the Field */ ! private static Category logger = Category.getInstance(JNDIContext.class); ! ! ! /** Constructor for the JndiServer object */ ! public JNDIContext() ! { ! super(); ! } ! ! ! /** ! * Gets the class name of the context ! * ! * @return The class name string ! */ ! public String getClassName() ! { ! return this.className; ! } ! ! ! /** ! * Gets the JavaBean customizer of the context ! * ! * @return The customizer ! */ ! public Component getComponent() ! { ! // Lazy creation ! if (c == null) ! { ! c = new GenericCustomizer(true, this); ! } ! return (Component) c; ! } ! ! ! /** ! * Gets the name of the context ! * ! * @return The name string ! */ ! public String getName() ! { ! return this.name; ! } ! ! ! /** ! * Get the absolute JNDI path of the context ! * ! * @return The path value ! */ ! public String getPath() ! { ! try ! { ! BeanContext parent = getBeanContext(); ! if (parent != null) ! { ! JNDIContext context = (JNDIContext) parent; ! String path = context.getPath(); ! if ((path == null) || ("".equals(path))) ! { ! return (getName()); ! } ! else ! { ! return (path + "/" + getName()); ! } ! } ! else ! { ! return ""; ! } ! } ! catch (Exception e) ! { ! logger.warn("Oops, not in a JNDIContext"); ! } ! return null; ! } ! ! ! /** ! * 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, ! Object requestor, ! Class serviceClass, ! Object serviceSelector, ! BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException ! { ! Object service = super.getService(child, requestor, serviceClass, serviceSelector, bcsrl); ! ! // If the service requested is not provided by this BeanContext, try the parent ! if (service == null) ! { ! BeanContextServices bcs = null; ! ! try ! { ! bcs = (BeanContextServices) getBeanContext(); ! } ! catch (ClassCastException cce) ! { ! // Ignore it ! return null; ! } ! ! return bcs.getService(this, requestor, serviceClass, serviceSelector, bcsrl); ! } ! ! return service; ! } ! ! ! /** ! * 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; ! } ! ! ! /** ! * Sets the class name of this context ! * ! * @param className The class name ! */ ! protected void setClassName(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the name of this context ! * ! * @param name The name ! */ ! protected void setName(String name) ! { ! this.name = name; ! } ! } Index: JNDIEntry.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/JNDIEntry.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JNDIEntry.java 24 May 2002 21:18:55 -0000 1.5 --- JNDIEntry.java 25 May 2002 20:54:47 -0000 1.6 *************** *** 16,25 **** * @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" ! * @beaninfo:property name="path" class="java.lang.String" displayName="Full ! * Path" shortDescription="Absolute path of the context" */ public class JNDIEntry extends JNDIContext --- 16,22 ---- * @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" ! * @beaninfo:property name="path" class="java.lang.String" displayName="Full Path" shortDescription="Absolute path of the context" */ public class JNDIEntry extends JNDIContext Index: Server.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/Server.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Server.java 24 May 2002 21:18:55 -0000 1.6 --- Server.java 25 May 2002 20:54:47 -0000 1.7 *************** *** 40,54 **** * @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 --- 40,48 ---- * @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 *************** *** 202,207 **** * Description of the Method * ! * @beaninfo:method name="refresh" displayName="Refresh" ! * shortDescription="Refresh the JNDI tree" */ public void refresh() --- 196,200 ---- * Description of the Method * ! * @beaninfo:method name="refresh" displayName="Refresh" shortDescription="Refresh the JNDI tree" */ public void refresh() |