summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-30 03:53:37 (EDT)
committerEike Stepper2007-07-30 03:53:37 (EDT)
commitf9a96e3a8877d5e353c7d0be1ff3cd4117d450fd (patch)
treec755c23f7bf125b6f5249f1ad783c3bc4aa1a065
parent65c3fdb017d247612e4bc94feec1c3588fbdbb3d (diff)
downloadcdo-f9a96e3a8877d5e353c7d0be1ff3cd4117d450fd.zip
cdo-f9a96e3a8877d5e353c7d0be1ff3cd4117d450fd.tar.gz
cdo-f9a96e3a8877d5e353c7d0be1ff3cd4117d450fd.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacyTest.java49
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java3
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MonitorTest.java66
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java3
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MonitorCanceledException.java (renamed from plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/InternalOMMonitor.java)27
5 files changed, 74 insertions, 74 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacyTest.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacyTest.java
index e3405d1..b0d1438 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacyTest.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/LegacyTest.java
@@ -11,16 +11,63 @@
package org.eclipse.net4j.internal.util.om.monitor;
import org.eclipse.net4j.util.om.monitor.MonitorUtil;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
+import org.eclipse.net4j.util.om.monitor.OMSubMonitor;
/**
* @author Eike Stepper
*/
-public class LegacyTest extends MonitorTest
+public class LegacyTest
{
+ private static final String[] CLASSES = { "Pair", "Triple" };
+
+ private static final String[][] FIELDS = { { "x", "y" }, { "x", "y", "z" } };
+
public static void main(String[] args)
{
MonitorUtil.Legacy.startMonitoring();
readClasses();
MonitorUtil.Legacy.stopMonitoring();
}
+
+ /**
+ * Supports {@link MonitorUtil progress monitoring}.
+ */
+ public static void readClasses()
+ {
+ int num = CLASSES.length;
+ OMMonitor monitor = MonitorUtil.begin(2 * num, "Reading " + num + " classes");
+ for (int c = 0; c < num; c++)
+ {
+ // Create class buffer
+ monitor.worked(1, "Created class buffer for " + CLASSES[c]);
+
+ // Read class
+ OMSubMonitor subMonitor = monitor.fork();
+ try
+ {
+ readFields(c);
+ }
+ finally
+ {
+ subMonitor.join("Read class " + CLASSES[c]);
+ }
+ }
+ }
+
+ /**
+ * Supports {@link MonitorUtil progress monitoring}.
+ *
+ * @param i2
+ */
+ public static void readFields(int c)
+ {
+ int num = FIELDS[c].length;
+ OMMonitor monitor = MonitorUtil.begin(num, "Reading " + num + " fields");
+ for (int f = 0; f < num; f++)
+ {
+ // Read field
+ monitor.worked(1, "Read field " + FIELDS[c][f]);
+ }
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
index fc19c90..d4013ef 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/Monitor.java
@@ -1,13 +1,14 @@
package org.eclipse.net4j.internal.util.om.monitor;
import org.eclipse.net4j.util.om.monitor.MonitorCanceledException;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMSubMonitor;
import org.eclipse.net4j.util.om.monitor.TotalWorkExceededException;
/**
* @author Eike Stepper
*/
-public abstract class Monitor implements InternalOMMonitor
+public abstract class Monitor implements OMMonitor, OMSubMonitor
{
private static final int UNINITIALIZED = 0;
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MonitorTest.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MonitorTest.java
deleted file mode 100644
index c0bc521..0000000
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/MonitorTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2004 - 2007 Eike Stepper, Germany.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Eike Stepper - initial API and implementation
- **************************************************************************/
-package org.eclipse.net4j.internal.util.om.monitor;
-
-import org.eclipse.net4j.util.om.monitor.MonitorUtil;
-import org.eclipse.net4j.util.om.monitor.OMMonitor;
-import org.eclipse.net4j.util.om.monitor.OMSubMonitor;
-
-/**
- * @author Eike Stepper
- */
-public abstract class MonitorTest
-{
- private static final String[] CLASSES = { "Pair", "Triple" };
-
- private static final String[][] FIELDS = { { "x", "y" }, { "x", "y", "z" } };
-
- /**
- * Supports {@link MonitorUtil progress monitoring}.
- */
- public static void readClasses()
- {
- int num = CLASSES.length;
- OMMonitor monitor = MonitorUtil.begin(2 * num, "Reading " + num + " classes");
- for (int c = 0; c < num; c++)
- {
- // Create class buffer
- monitor.worked(1, "Created class buffer for " + CLASSES[c]);
-
- // Read class
- OMSubMonitor subMonitor = monitor.fork();
- try
- {
- readFields(c);
- }
- finally
- {
- subMonitor.join("Read class " + CLASSES[c]);
- }
- }
- }
-
- /**
- * Supports {@link MonitorUtil progress monitoring}.
- *
- * @param i2
- */
- public static void readFields(int c)
- {
- int num = FIELDS[c].length;
- OMMonitor monitor = MonitorUtil.begin(num, "Reading " + num + " fields");
- for (int f = 0; f < num; f++)
- {
- // Read field
- monitor.worked(1, "Read field " + FIELDS[c][f]);
- }
- }
-}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
index 783a668..09867f5 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/NullMonitor.java
@@ -10,12 +10,13 @@
**************************************************************************/
package org.eclipse.net4j.internal.util.om.monitor;
+import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.OMSubMonitor;
/**
* @author Eike Stepper
*/
-public class NullMonitor implements InternalOMMonitor
+public class NullMonitor implements OMMonitor, OMSubMonitor
{
public NullMonitor()
{
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/InternalOMMonitor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MonitorCanceledException.java
index e1fa825..df6f430 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/internal/util/om/monitor/InternalOMMonitor.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/om/monitor/MonitorCanceledException.java
@@ -8,14 +8,31 @@
* Contributors:
* Eike Stepper - initial API and implementation
**************************************************************************/
-package org.eclipse.net4j.internal.util.om.monitor;
-
-import org.eclipse.net4j.util.om.monitor.OMMonitor;
-import org.eclipse.net4j.util.om.monitor.OMSubMonitor;
+package org.eclipse.net4j.util.om.monitor;
/**
* @author Eike Stepper
*/
-public interface InternalOMMonitor extends OMMonitor, OMSubMonitor
+public class MonitorCanceledException extends MonitorException
{
+ private static final long serialVersionUID = 1L;
+
+ public MonitorCanceledException()
+ {
+ }
+
+ public MonitorCanceledException(String s)
+ {
+ super(s);
+ }
+
+ public MonitorCanceledException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public MonitorCanceledException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
}