// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/io/JTextAreaOutputStream.java
// public class JTextAreaOutputStream extends OutputStream {
// 
//     private JTextArea text;
// 
//     public JTextAreaOutputStream(JTextArea text) {
//         this.text = text;
//     }
// 
//     public void write(int i) throws IOException {
//         write(new byte[] {(byte)i}, 0,1);
//     }
// 
//     public void write(byte[] bytes) throws IOException {
//         write(bytes, 0, bytes.length);
//     }
// 
//     public void write(final byte[] bytes, final int i, final int i1) throws IOException {
// 
//         if(bytes != null && i1 != 0) {
//             final String s = new String(bytes, i, i1);
// 
//             SwingUtilities.invokeLater(new Runnable() {
//                 public void run() {
//                     text.append(s);
//                     text.setCaretPosition(text.getDocument().getLength());
//                     int size = 100000;
//                     int maxOverflow= 500;
//                     int overflow = text.getDocument().getLength() - size;
//                     if (overflow >= maxOverflow) {
//                         text.replaceRange("", 0, overflow);
//                     }
//                 }
//             });
//         }
//     }
// }
// 
// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/io/MultiOutputStream.java
// public class MultiOutputStream extends OutputStream {
// 
//     private List outputStreams = new ArrayList();
// 
//     public MultiOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void addOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void write(int i) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(i);
//         }
//     }
// 
//     public void write(byte[] bytes) throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.write(bytes);
//         }
//     }
// 
//     public void write(byte[] bytes, int i, int i1) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(bytes, i, i1);
//         }
//     }
// 
//     public void flush() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.flush();
//         }
//     }
// 
//     public void close() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.close();
//         }
//     }
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/StartOption.java
// public interface StartOption {
// 
//     String getName();
// 
//     String validate(String arg);
// 
//     String validate();
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/Configuration.java
// public interface Configuration {
// 
//     boolean isHeadless();
// 
//     void setHeadless(boolean headless);
// 
//     String getContextPath();
// 
//     void setContextPath(String contextPath);
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/JettyConsolePlugin.java
// public interface JettyConsolePlugin {
//     
//      List<StartOption> getStartOptions();
//      void beforeStart(WebAppContext context);
//      void beforeStop(WebAppContext context);
// 
//      void customizeServer(Server server);
// 
//      void customizeConnector(ServerConnector connector);
// 
//      void bootstrap();
// 
//      void configureConsole(Configuration configuration);
// }


import org.simplericity.jettyconsole.io.JTextAreaOutputStream;
import org.simplericity.jettyconsole.io.MultiOutputStream;
import org.simplericity.jettyconsole.api.StartOption;
import org.simplericity.jettyconsole.api.Configuration;
import org.simplericity.jettyconsole.api.JettyConsolePlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.kantega.jexmec.PluginManager;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.net.ServerSocket;
import java.util.Properties;

                g2.fillRect(0, 0, getWidth(), getHeight());

                g2.setComposite(comp);
                g2.setColor(c);
            }
        };
        controls.setOpaque(false);

        final JTextArea text = new JTextArea(10, 7) {

            protected void paintComponent(Graphics graphics) {
                Graphics2D g2 = (Graphics2D) graphics;

                Composite comp = g2.getComposite();
                Color c = g2.getColor();


                g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3F));

                g2.setColor(Color.BLACK);

                g2.fillRect(0, 0, getWidth(), getHeight());

                g2.setComposite(comp);
                g2.setColor(c);
                super.paintComponent(graphics);
            }
        };

// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/io/JTextAreaOutputStream.java
// public class JTextAreaOutputStream extends OutputStream {
// 
//     private JTextArea text;
// 
//     public JTextAreaOutputStream(JTextArea text) {
//         this.text = text;
//     }
// 
//     public void write(int i) throws IOException {
//         write(new byte[] {(byte)i}, 0,1);
//     }
// 
//     public void write(byte[] bytes) throws IOException {
//         write(bytes, 0, bytes.length);
//     }
// 
//     public void write(final byte[] bytes, final int i, final int i1) throws IOException {
// 
//         if(bytes != null && i1 != 0) {
//             final String s = new String(bytes, i, i1);
// 
//             SwingUtilities.invokeLater(new Runnable() {
//                 public void run() {
//                     text.append(s);
//                     text.setCaretPosition(text.getDocument().getLength());
//                     int size = 100000;
//                     int maxOverflow= 500;
//                     int overflow = text.getDocument().getLength() - size;
//                     if (overflow >= maxOverflow) {
//                         text.replaceRange("", 0, overflow);
//                     }
//                 }
//             });
//         }
//     }
// }
// 
// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/io/MultiOutputStream.java
// public class MultiOutputStream extends OutputStream {
// 
//     private List outputStreams = new ArrayList();
// 
//     public MultiOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void addOutputStream(OutputStream stream) {
//         outputStreams.add(stream);
//     }
// 
//     public void write(int i) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(i);
//         }
//     }
// 
//     public void write(byte[] bytes) throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.write(bytes);
//         }
//     }
// 
//     public void write(byte[] bytes, int i, int i1) throws IOException {
//         for (int j = 0; j < outputStreams.size(); j++) {
//             OutputStream stream = (OutputStream) outputStreams.get(j);
//             stream.write(bytes, i, i1);
//         }
//     }
// 
//     public void flush() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.flush();
//         }
//     }
// 
//     public void close() throws IOException {
//         for (int i = 0; i < outputStreams.size(); i++) {
//             OutputStream stream = (OutputStream) outputStreams.get(i);
//             stream.close();
//         }
//     }
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/StartOption.java
// public interface StartOption {
// 
//     String getName();
// 
//     String validate(String arg);
// 
//     String validate();
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/Configuration.java
// public interface Configuration {
// 
//     boolean isHeadless();
// 
//     void setHeadless(boolean headless);
// 
//     String getContextPath();
// 
//     void setContextPath(String contextPath);
// }
// 
// Path: jetty-console-api/src/main/java/org/simplericity/jettyconsole/api/JettyConsolePlugin.java
// public interface JettyConsolePlugin {
//     
//      List<StartOption> getStartOptions();
//      void beforeStart(WebAppContext context);
//      void beforeStop(WebAppContext context);
// 
//      void customizeServer(Server server);
// 
//      void customizeConnector(ServerConnector connector);
// 
//      void bootstrap();
// 
//      void configureConsole(Configuration configuration);
// }


// Path: jetty-console-core/src/main/java/org/simplericity/jettyconsole/JettyConsole.java
import org.simplericity.jettyconsole.io.JTextAreaOutputStream;
import org.simplericity.jettyconsole.io.MultiOutputStream;
import org.simplericity.jettyconsole.api.StartOption;
import org.simplericity.jettyconsole.api.Configuration;
import org.simplericity.jettyconsole.api.JettyConsolePlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.kantega.jexmec.PluginManager;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.net.ServerSocket;
import java.util.Properties;


                g2.fillRect(0, 0, getWidth(), getHeight());

                g2.setComposite(comp);
                g2.setColor(c);
            }
        };
        controls.setOpaque(false);

        final JTextArea text = new JTextArea(10, 7) {

            protected void paintComponent(Graphics graphics) {
                Graphics2D g2 = (Graphics2D) graphics;

                Composite comp = g2.getComposite();
                Color c = g2.getColor();


                g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3F));

                g2.setColor(Color.BLACK);

                g2.fillRect(0, 0, getWidth(), getHeight());

                g2.setComposite(comp);
                g2.setColor(c);
                super.paintComponent(graphics);
            }
        };

        OutputStream os = new JTextAreaOutputStream(text);