Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model
In directory usw-pr-cvs1:/tmp/cvs-serv29379/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model
Added Files:
JNDIContext.java JNDIEntry.java
Log Message:
Initial Import
--- NEW FILE: JNDIContext.java ---
/*
* 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.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;
// Other Imports
//import com.dreambean.awt.GenericCustomizer;
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()
{
super();
}
/**
* 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()
{
return this.className;
}
/**
* Gets the component attribute of the JNDINode object
*
* @return The component value
*/
public Component getComponent()
{
if (c == null)
{
c = new GenericCustomizer(true, this);
}
return (Component) c;
}
/**
* 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,
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)
{
return null;
}
return bcs.getService(this, requestor, serviceClass, serviceSelector, bcsrl);
}
return service;
}
/**
* 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());
}
}
--- NEW FILE: JNDIEntry.java ---
/*
* EJTools, the Enterprise Java Tools
*
* Distributable under LGPL license.
* See terms of license at www.gnu.org.
*/
package net.sourceforge.ejtools.jndibrowser.model;
// Other Imports
import org.apache.log4j.Category;
/**
*Description of the Class
*
* @author letiembl
* @created 13 décembre 2001
* @todo Javadoc to complete
*/
public class JNDIEntry extends JNDIContext
{
}
|