FileDocCategorySizeDatePackage
DebugOutImpl.javaAPI DocGlassfish v2 API4094Fri May 04 22:31:06 BST 2007com.sun.appserv.management.util.misc

DebugOutImpl

public class DebugOutImpl extends Object implements DebugOut

Fields Summary
private final String
mID
private boolean
mDebug
private DebugSink
mSink
Constructors Summary
public DebugOutImpl(String id, boolean debug, DebugSink sink)

        mID     = id;
        mDebug  = debug;
        
        mSink   = sink == null ? new DebugSinkImpl( System.out ) : sink ;
    
public DebugOutImpl(String id, boolean debug)

        this( id, debug, null );
    
Methods Summary
public voiddebug(java.lang.Object args)

	    if ( getDebug() )
	    {
	        mSink.println( toString( args ) );
	    }
	
public voiddebugMethod(java.lang.String methodName, java.lang.Object args)

	    if ( getDebug() )
	    {
	        debug( methodString( methodName, args ) );
	    }
	
public voiddebugMethod(java.lang.String msg, java.lang.String methodName, java.lang.Object args)

	    if ( getDebug() )
	    {
	        debug( methodString( methodName, args ) + ": " + msg );
	    }
	
public booleangetDebug()

	    return mDebug;
	
public java.lang.StringgetID()

        return mID;
    
public static java.lang.StringmethodString(java.lang.String name, java.lang.Object args)

        String  result  = null;
        
        if ( args == null || args.length == 0 )
        {
            result  = name + "()";
        }
        else
        {
            final String    argsString  = StringUtil.toString( ", ", args );
            result  = StringUtil.toString( "", name, "(", argsString, ")" );
        }
        
        return result;
    
public voidprint(java.lang.Object o)

	    mSink.print( "" + o );
	
public voidprintln(java.lang.Object o)

	    mSink.println( "" + o );
	
public voidsetDebug(boolean debug)

	    mDebug  = debug;
	
public java.lang.StringtoString(java.lang.Object args)

	    return StringUtil.toString( ", ", args );