/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sun.jini.debug;

import java.io.PrintWriter;
import java.security.PrivilegedAction;

/**
 * Another missing dependency
 * @author peter
 */
public class Debug {
    
    private final PrintWriter writer;
    private static Debug instance = new Debug();
    
    /**
     * This appears to be a static method that returns an PrivilegedAction that
     * returns a Debug instance.
     * 
     * @param string
     * @return 
     */
    public static PrivilegedAction<Debug> getDebugAction(String string){
        return new PrivilegedAction<Debug>(){

            @Override
            public Debug run() {
                return instance;
            }
            
        };
    }
    
    private Debug(){
        writer = new PrintWriter(System.out, true);
    }
    /**
     * I've got no idea what this does.  I imagine it gets the output stream
     * or error stream PrintWriter.
     * 
     * @param string
     * @return 
     */
    public PrintWriter getWriter(String string) {
        writer.println(string);
        return writer;
    }
    
}
