Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web
In directory usw-pr-cvs1:/tmp/cvs-serv31461/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/web
Added Files:
Constants.java JNDIContainer.java
Log Message:
Initial import
--- NEW FILE: Constants.java ---
/*
* EJTools, the Enterprise Java Tools
*
* Distributable under LGPL license.
* See terms of license at www.gnu.org.
*/
package net.sourceforge.ejtools.jndibrowser.web;
/**
* Description of the Class
*
* @author letiemble
* @created 28 février 2002
* @todo Javadoc to complete
*/
public final class Constants
{
/** Description of the Field */
public final static String CONNECTOR = "tree";
/** Description of the Field */
public final static String DETAIL = "detail";
/** Description of the Field */
public final static String DETAIL_INFO = "detail.info";
/** Description of the Field */
public final static String DOMAIN = "domain";
/** Description of the Field */
public final static String GLOBAL_TREE = "global";
/** Description of the Field */
public final static String JAVA_TREE = "tree";
/** Description of the Field */
public final static String NUMBER = "number";
/** Description of the Field */
public final static String TREE = "tree";
}
--- NEW FILE: JNDIContainer.java ---
/*
* EJTools, the Enterprise Java Tools
*
* Distributable under LGPL license.
* See terms of license at www.gnu.org.
*/
package net.sourceforge.ejtools.jndibrowser.web;
import java.beans.beancontext.BeanContextServicesSupport;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;
import net.sourceforge.ejtools.jndibrowser.model.JNDIContext;
import net.sourceforge.ejtools.jndibrowser.model.Server;
import org.apache.log4j.Category;
/**
* Description of the Class
*
* @author letiemble
* @created 25 avril 2002
* @todo Javadoc to complete
*/
public class JNDIContainer extends BeanContextServicesSupport
{
/** Description of the Field */
protected Hashtable contexts = new Hashtable();
/** Description of the Field */
protected Server server;
/** Description of the Field */
private static Category logger = Category.getInstance(JNDIContainer.class);
/** Constructor for the JMXTree object */
public JNDIContainer()
{
try
{
server = new Server();
add(server);
}
catch (Exception e)
{
e.printStackTrace();
}
}
/** Description of the Method */
public void connect()
{
server.connect();
registerContent(server);
}
/**
* Getter for the server attribute
*
* @return The value of server attribute
*/
public Collection getServer()
{
return server;
}
/** Description of the Method */
public void refresh()
{
server.refresh();
}
/**
* Description of the Method
*
* @param path Description of the Parameter
* @return Description of the Return Value
*/
public JNDIContext searchContext(String path)
{
if (path != null)
{
return (JNDIContext) contexts.get(path);
}
return null;
}
/**
* Sets the context attribute of the JNDIContainer object
*
* @param context The new context value
*/
public void setContext(String context)
{
server.setContext(context);
}
/**
* Description of the Method
*
* @param context Description of the Parameter
*/
protected void registerContent(JNDIContext context)
{
logger.debug("In registerContent");
Iterator it = context.iterator();
while (it.hasNext())
{
JNDIContext subctx = (JNDIContext) it.next();
contexts.put(subctx.getPath(), subctx);
logger.debug("Registering " + subctx.getPath());
registerContent(subctx);
}
}
}
|