FileDocCategorySizeDatePackage
ExceptionHandler.javaAPI DocGlassfish v2 API5170Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans

ExceptionHandler

public class ExceptionHandler extends Object
author
kebbs

Fields Summary
private Logger
_logger
Constructors Summary
public ExceptionHandler(Logger logger)
Create a new exception handler with the specified logger

param
logger

        _logger = logger;
    
Methods Summary
protected java.util.logging.LoggergetLogger()

        return _logger;
    
public com.sun.enterprise.config.ConfigExceptionhandleConfigException(java.lang.Exception ex, java.lang.String messageId, java.lang.String arg)

        return handleConfigException(ex, messageId, new String[] {arg});
    
public com.sun.enterprise.config.ConfigExceptionhandleConfigException(java.lang.Exception ex, java.lang.String messageId, java.lang.String[] args)
Convert an incoming exception to an ConfigException and log if the incoming exception is not a ConfigException

param
ex The exception
param
messageId the resource bundle id of the message to log
param
args arguments to be passed to the log message
return
ConfgException

        ConfigException result = null;
        Level level = Level.FINE;
        if (ex instanceof ConfigException) {                       
            result = (ConfigException)ex;
        } else {  
            level = Level.WARNING;
            result = new ConfigException(ex);
        }
        StringManagerBase sm = StringManagerBase.getStringManager(getLogger().getResourceBundleName());            
        getLogger().log(level, sm.getString(messageId, args), ex);             
        return result;
    
public com.sun.enterprise.admin.servermgmt.InstanceExceptionhandleInstanceException(java.lang.Exception ex, java.lang.String messageId, java.lang.String arg)

        return handleInstanceException(ex, messageId, new String[] {arg});
    
public com.sun.enterprise.admin.servermgmt.InstanceExceptionhandleInstanceException(java.lang.Exception ex, java.lang.String messageId, java.lang.String[] args)
Convert an incoming exception to an InstanceException and log if the incoming exception is not an InstanceException.

param
ex The exception
param
messageId the resource bundle id of the message to log
param
args arguments to be passed to the log message
return
InstanceException

        InstanceException result = null;
        Level level = Level.FINE;
        if (ex instanceof InstanceException) {                       
            result = (InstanceException)ex;            
        } else if (ex instanceof ConfigException) {            
            result = new InstanceException(ex);
        } else {  
            level = Level.WARNING;
            result = new InstanceException(ex);
        }
        StringManagerBase sm = StringManagerBase.getStringManager(getLogger().getResourceBundleName());            
        getLogger().log(level, sm.getString(messageId, args), ex);             
        return result;