jdk/src/share/classes/java/rmi/server/LogStream.java
changeset 24865 09b1d992ca72
parent 16874 acf47f31a0da
equal deleted inserted replaced
24864:a7bf63ebda64 24865:09b1d992ca72
    30 /**
    30 /**
    31  * <code>LogStream</code> provides a mechanism for logging errors that are
    31  * <code>LogStream</code> provides a mechanism for logging errors that are
    32  * of possible interest to those monitoring a system.
    32  * of possible interest to those monitoring a system.
    33  *
    33  *
    34  * @author  Ann Wollrath (lots of code stolen from Ken Arnold)
    34  * @author  Ann Wollrath (lots of code stolen from Ken Arnold)
    35  * @since   JDK1.1
    35  * @since   1.1
    36  * @deprecated no replacement
    36  * @deprecated no replacement
    37  */
    37  */
    38 @Deprecated
    38 @Deprecated
    39 public class LogStream extends PrintStream {
    39 public class LogStream extends PrintStream {
    40 
    40 
    62      * Create a new LogStream object.  Since this only constructor is
    62      * Create a new LogStream object.  Since this only constructor is
    63      * private, users must have a LogStream created through the "log"
    63      * private, users must have a LogStream created through the "log"
    64      * method.
    64      * method.
    65      * @param name string identifying messages from this log
    65      * @param name string identifying messages from this log
    66      * @out output stream that log messages will be sent to
    66      * @out output stream that log messages will be sent to
    67      * @since JDK1.1
    67      * @since 1.1
    68      * @deprecated no replacement
    68      * @deprecated no replacement
    69      */
    69      */
    70     @Deprecated
    70     @Deprecated
    71     private LogStream(String name, OutputStream out)
    71     private LogStream(String name, OutputStream out)
    72     {
    72     {
    81      * Return the LogStream identified by the given name.  If
    81      * Return the LogStream identified by the given name.  If
    82      * a log corresponding to "name" does not exist, a log using
    82      * a log corresponding to "name" does not exist, a log using
    83      * the default stream is created.
    83      * the default stream is created.
    84      * @param name name identifying the desired LogStream
    84      * @param name name identifying the desired LogStream
    85      * @return log associated with given name
    85      * @return log associated with given name
    86      * @since JDK1.1
    86      * @since 1.1
    87      * @deprecated no replacement
    87      * @deprecated no replacement
    88      */
    88      */
    89     @Deprecated
    89     @Deprecated
    90     public static LogStream log(String name) {
    90     public static LogStream log(String name) {
    91         LogStream stream;
    91         LogStream stream;
   101 
   101 
   102     /**
   102     /**
   103      * Return the current default stream for new logs.
   103      * Return the current default stream for new logs.
   104      * @return default log stream
   104      * @return default log stream
   105      * @see #setDefaultStream
   105      * @see #setDefaultStream
   106      * @since JDK1.1
   106      * @since 1.1
   107      * @deprecated no replacement
   107      * @deprecated no replacement
   108      */
   108      */
   109     @Deprecated
   109     @Deprecated
   110     public static synchronized PrintStream getDefaultStream() {
   110     public static synchronized PrintStream getDefaultStream() {
   111         return defaultStream;
   111         return defaultStream;
   113 
   113 
   114     /**
   114     /**
   115      * Set the default stream for new logs.
   115      * Set the default stream for new logs.
   116      * @param newDefault new default log stream
   116      * @param newDefault new default log stream
   117      * @see #getDefaultStream
   117      * @see #getDefaultStream
   118      * @since JDK1.1
   118      * @since 1.1
   119      * @deprecated no replacement
   119      * @deprecated no replacement
   120      */
   120      */
   121     @Deprecated
   121     @Deprecated
   122     public static synchronized void setDefaultStream(PrintStream newDefault) {
   122     public static synchronized void setDefaultStream(PrintStream newDefault) {
   123         SecurityManager sm = System.getSecurityManager();
   123         SecurityManager sm = System.getSecurityManager();
   132 
   132 
   133     /**
   133     /**
   134      * Return the current stream to which output from this log is sent.
   134      * Return the current stream to which output from this log is sent.
   135      * @return output stream for this log
   135      * @return output stream for this log
   136      * @see #setOutputStream
   136      * @see #setOutputStream
   137      * @since JDK1.1
   137      * @since 1.1
   138      * @deprecated no replacement
   138      * @deprecated no replacement
   139      */
   139      */
   140     @Deprecated
   140     @Deprecated
   141     public synchronized OutputStream getOutputStream()
   141     public synchronized OutputStream getOutputStream()
   142     {
   142     {
   145 
   145 
   146     /**
   146     /**
   147      * Set the stream to which output from this log is sent.
   147      * Set the stream to which output from this log is sent.
   148      * @param out new output stream for this log
   148      * @param out new output stream for this log
   149      * @see #getOutputStream
   149      * @see #getOutputStream
   150      * @since JDK1.1
   150      * @since 1.1
   151      * @deprecated no replacement
   151      * @deprecated no replacement
   152      */
   152      */
   153     @Deprecated
   153     @Deprecated
   154     public synchronized void setOutputStream(OutputStream out)
   154     public synchronized void setOutputStream(OutputStream out)
   155     {
   155     {
   162     /**
   162     /**
   163      * Write a byte of data to the stream.  If it is not a newline, then
   163      * Write a byte of data to the stream.  If it is not a newline, then
   164      * the byte is appended to the internal buffer.  If it is a newline,
   164      * the byte is appended to the internal buffer.  If it is a newline,
   165      * then the currently buffered line is sent to the log's output
   165      * then the currently buffered line is sent to the log's output
   166      * stream, prefixed with the appropriate logging information.
   166      * stream, prefixed with the appropriate logging information.
   167      * @since JDK1.1
   167      * @since 1.1
   168      * @deprecated no replacement
   168      * @deprecated no replacement
   169      */
   169      */
   170     @Deprecated
   170     @Deprecated
   171     public void write(int b)
   171     public void write(int b)
   172     {
   172     {
   206             super.write(b);
   206             super.write(b);
   207     }
   207     }
   208 
   208 
   209     /**
   209     /**
   210      * Write a subarray of bytes.  Pass each through write byte method.
   210      * Write a subarray of bytes.  Pass each through write byte method.
   211      * @since JDK1.1
   211      * @since 1.1
   212      * @deprecated no replacement
   212      * @deprecated no replacement
   213      */
   213      */
   214     @Deprecated
   214     @Deprecated
   215     public void write(byte b[], int off, int len)
   215     public void write(byte b[], int off, int len)
   216     {
   216     {
   221     }
   221     }
   222 
   222 
   223     /**
   223     /**
   224      * Return log name as string representation.
   224      * Return log name as string representation.
   225      * @return log name
   225      * @return log name
   226      * @since JDK1.1
   226      * @since 1.1
   227      * @deprecated no replacement
   227      * @deprecated no replacement
   228      */
   228      */
   229     @Deprecated
   229     @Deprecated
   230     public String toString()
   230     public String toString()
   231     {
   231     {
   242     /**
   242     /**
   243      * Convert a string name of a logging level to its internal
   243      * Convert a string name of a logging level to its internal
   244      * integer representation.
   244      * integer representation.
   245      * @param s name of logging level (e.g., 'SILENT', 'BRIEF', 'VERBOSE')
   245      * @param s name of logging level (e.g., 'SILENT', 'BRIEF', 'VERBOSE')
   246      * @return corresponding integer log level
   246      * @return corresponding integer log level
   247      * @since JDK1.1
   247      * @since 1.1
   248      * @deprecated no replacement
   248      * @deprecated no replacement
   249      */
   249      */
   250     @Deprecated
   250     @Deprecated
   251     public static int parseLevel(String s)
   251     public static int parseLevel(String s)
   252     {
   252     {