FileDocCategorySizeDatePackage
StringManagerFactory.javaAPI DocGlassfish v2 API5065Fri May 04 22:36:22 BST 2007com.sun.enterprise.admin.jmx.remote

StringManagerFactory

public class StringManagerFactory extends Object

Fields Summary
private static Hashtable
managers
cache for all the local string managers (per pkg)
private static final Logger
logger
Constructors Summary
Methods Summary
public static com.sun.enterprise.admin.jmx.remote.IStringManagergetClientStringManager(java.lang.String packageName, java.util.Map env)

        String stringMgrClassName = null;
        if (env != null) 
            stringMgrClassName = (String)env.get(DefaultConfiguration.STRING_MANAGER_CLASS_NAME);
        return getManager(packageName, stringMgrClassName);
    
public static com.sun.enterprise.admin.jmx.remote.IStringManagergetClientStringManager(java.lang.Class inputClass, java.util.Map env)

        String packageName = inputClass.getPackage().getName();
        String stringMgrClassName = null;
        if (env != null) 
            stringMgrClassName = (String)env.get(DefaultConfiguration.STRING_MANAGER_CLASS_NAME);
        return getManager(packageName, stringMgrClassName);
    
public static com.sun.enterprise.admin.jmx.remote.IStringManagergetManager(java.lang.String packageName, java.lang.String stringMgrClassName)

        
        IStringManager mgr = (IStringManager) managers.get(packageName);
        
        if (mgr != null) return mgr;
        
        if (stringMgrClassName == null) mgr = new StringManager(packageName);
        else {
            try {
                Class customClass = Class.forName(stringMgrClassName);
                Constructor constructor = 
                    customClass.getConstructor(new Class[] { String.class });
                mgr = (IStringManager) constructor.newInstance(new Object[] {packageName});
            } catch (Exception e) {
                logger.severe("StringManager could not be configured");
            }
        }
        
        if (mgr != null) managers.put(packageName, mgr);
        else logger.severe("Custom StringManager Class could not be instantiated");
        
        return mgr;
    
public static com.sun.enterprise.admin.jmx.remote.IStringManagergetServerStringManager(java.lang.String packageName)

/*, 
        DefaultConfiguration.LOGGER_RESOURCE_BUNDLE_NAME );
    
    /**
     * packageName stands for the input fully qualified class name against which 
     * a string manager is stored
     */
         
        String stringMgrClassName = System.getProperty(DefaultConfiguration.STRING_MANAGER_CLASS_NAME);
        return getManager(packageName, stringMgrClassName);
    
public static com.sun.enterprise.admin.jmx.remote.IStringManagergetServerStringManager(java.lang.Class inputClass)
inputClass is the Class against whose package a string manager is stored

        String packageName = inputClass.getPackage().getName();
        String stringMgrClassName = System.getProperty(DefaultConfiguration.STRING_MANAGER_CLASS_NAME);
        return getManager(packageName, stringMgrClassName);