Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcvs2svn2001-07-18 17:27:47 +0000
committercvs2svn2001-07-18 17:27:47 +0000
commit172b0ea764f0a5e279f16142312b13a5b57fbc5b (patch)
tree4fcf6012124ae09d84e738621cd54a574f883a10
parent86ba926463d96def6146d5037735a040b7b3f0ce (diff)
downloadeclipse.platform.debug-172b0ea764f0a5e279f16142312b13a5b57fbc5b.tar.gz
eclipse.platform.debug-172b0ea764f0a5e279f16142312b13a5b57fbc5b.tar.xz
eclipse.platform.debug-172b0ea764f0a5e279f16142312b13a5b57fbc5b.zip
This commit was manufactured by cvs2svn to create branch
'Jared_Breakpoints'. Sprout from master 2001-07-18 17:27:44 UTC Darin Swanson <darins> '*** empty log message ***' Delete: org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java102
1 files changed, 0 insertions, 102 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
deleted file mode 100644
index b05b0104d..000000000
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java
+++ /dev/null
@@ -1,102 +0,0 @@
-package org.eclipse.debug.internal.core;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-
-/**
- * Writes to an output stream, queueing output if the
- * output stream is blocked.
- */
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Vector;
-
-public class OutputStreamMonitor {
-
- private final static String PREFIX= "output_stream_monitor.";
- private final static String LABEL= PREFIX + "label";
-
- protected OutputStream fStream;
- protected Vector fQueue;
- protected Thread fThread;
- protected Object fLock;
-
- /**
- * Creates an output stream monitor on the
- * given output stream.
- */
- public OutputStreamMonitor(OutputStream stream) {
- fStream= stream;
- fQueue= new Vector();
- fLock= new Object();
- }
-
- /**
- * Appends the given text to the stream, or
- * queues the text to be written at a later time
- * if the stream is blocked.
- */
- public void write(String text) {
- synchronized(fLock) {
- fQueue.add(text);
- fLock.notifyAll();
- }
- }
-
- /**
- * Starts a <code>Thread</code> which writes the stream.
- */
- public void startMonitoring() {
- if (fThread == null) {
- fThread= new Thread(new Runnable() {
- public void run() {
- write();
- }
- }, DebugCoreUtils.getResourceString(LABEL));
- fThread.start();
- }
- }
-
- /**
- * Causes the monitor to close all
- * communications between it and the
- * underlying stream.
- */
- public void close() {
- if (fThread != null) {
- Thread thread= fThread;
- fThread= null;
- thread.interrupt();
- }
- }
-
- protected void write() {
- while (fThread != null) {
- writeNext();
- }
- }
-
- protected void writeNext() {
- while (!fQueue.isEmpty()) {
- String text = (String)fQueue.firstElement();
- fQueue.removeElementAt(0);
- try {
- if (fStream != null) {
- fStream.write(text.getBytes());
- fStream.flush();
- }
- } catch (IOException e) {
- }
- }
- try {
- synchronized(fLock) {
- fLock.wait();
- }
- } catch (InterruptedException e) {
- }
- }
-}
-

Back to the top