Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.gui.threads.GuiLoggingThread Class Reference

List of all members.

Public Member Functions

 GuiLoggingThread (JTextArea loggingTextPane, String host)
String getHost ()
void run ()
void quit ()

Detailed Description

This class defines a GuiLoggingThread

Author:
Nicolas Modrzyk
Version:
1.0

Definition at line 45 of file GuiLoggingThread.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.gui.threads.GuiLoggingThread.GuiLoggingThread JTextArea  loggingTextPane,
String  host
 

Creates a new GuiLoggingThread.java object

Parameters:
loggingTextPane the text area where to store output
host where the log server is running

Definition at line 59 of file GuiLoggingThread.java.

00060   {
00061     super();
00062     this.host = host;
00063     this.loggingTextPane = loggingTextPane;
00064   }


Member Function Documentation

String org.objectweb.cjdbc.console.gui.threads.GuiLoggingThread.getHost  ) 
 

Returns the host value.

Returns:
Returns the host.

Definition at line 71 of file GuiLoggingThread.java.

00072   {
00073     return host;
00074   }

void org.objectweb.cjdbc.console.gui.threads.GuiLoggingThread.quit  ) 
 

Quitting

Definition at line 105 of file GuiLoggingThread.java.

00106   {
00107     if(nodeThread!=null)
00108       nodeThread.interrupt();
00109   }

void org.objectweb.cjdbc.console.gui.threads.GuiLoggingThread.run  ) 
 

See also:
java.lang.Runnable#run()

Definition at line 78 of file GuiLoggingThread.java.

00079   {
00080     try
00081     {
00082       BasicConfigurator.configure();
00083       JTextAreaWriter writer = new JTextAreaWriter(loggingTextPane);
00084       Layout layout = new PatternLayout("%d %-5p %c{3} %m\n");
00085       WriterAppender appender = new WriterAppender(layout, writer);
00086       appender.setImmediateFlush(true);
00087       LogManager.getRootLogger().removeAllAppenders();
00088       LogManager.getRootLogger().addAppender(appender);
00089       logSocket = new Socket(host, 9010);
00090       node = new SocketNode(logSocket, LogManager.getLoggerRepository());
00091       nodeThread = new Thread(node);
00092       nodeThread.start();
00093     }
00094     catch (Exception e)
00095     {
00096       // ignore
00097     }
00098   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:02:38 2005 for C-JDBC by  doxygen 1.3.9.1