summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-02-19 10:35:41 (EST)
committerEike Stepper2007-02-19 10:35:41 (EST)
commite67743ae73da7e330e6e202b00dba8fc56a2ad83 (patch)
treec823066e5cf881431a65caa4fe2505d4f9e82762
parent9d5050bc444a2a8ede9695d191c64234cd043225 (diff)
downloadcdo-e67743ae73da7e330e6e202b00dba8fc56a2ad83.zip
cdo-e67743ae73da7e330e6e202b00dba8fc56a2ad83.tar.gz
cdo-e67743ae73da7e330e6e202b00dba8fc56a2ad83.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java2
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleException.java38
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java31
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java2
4 files changed, 67 insertions, 6 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
index ca22795..425d813 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/Lifecycle.java
@@ -15,7 +15,7 @@ package org.eclipse.net4j.util.lifecycle;
*/
public interface Lifecycle
{
- public void activate() throws Exception;
+ public void activate() throws LifecycleException;
public Exception deactivate();
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleException.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleException.java
new file mode 100644
index 0000000..e0ead1d
--- /dev/null
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleException.java
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * 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.util.lifecycle;
+
+/**
+ * @author Eike Stepper
+ */
+public class LifecycleException extends RuntimeException
+{
+ private static final long serialVersionUID = 1L;
+
+ public LifecycleException()
+ {
+ }
+
+ public LifecycleException(String message)
+ {
+ super(message);
+ }
+
+ public LifecycleException(Throwable cause)
+ {
+ super(cause);
+ }
+
+ public LifecycleException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java
index 1cea11e..1c5dd68 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleImpl.java
@@ -50,7 +50,7 @@ public class LifecycleImpl implements Lifecycle, LifecycleNotifier
listeners.remove(listener);
}
- public final synchronized void activate() throws Exception
+ public final synchronized void activate() throws LifecycleException
{
if (!active)
{
@@ -59,16 +59,39 @@ public class LifecycleImpl implements Lifecycle, LifecycleNotifier
TRACER.trace("Activating " + this);//$NON-NLS-1$
}
- onAboutToActivate();
+ try
+ {
+ onAboutToActivate();
+ }
+ catch (RuntimeException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new LifecycleException(ex);
+ }
+
fireLifecycleAboutToActivate();
if (DUMPER.isEnabled())
{
DUMPER.trace("DUMP" + ReflectUtil.toString(this)); //$NON-NLS-1$
}
- onActivate();
+ try
+ {
+ onActivate();
+ }
+ catch (RuntimeException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ throw new LifecycleException(ex);
+ }
+
active = true;
-
fireLifecycleActivated();
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
index 4be6d44..159c834 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/util/lifecycle/LifecycleUtil.java
@@ -68,7 +68,7 @@ public final class LifecycleUtil
/**
* @see Activator
*/
- public static void activate(Object object, boolean useAnnotation) throws Exception
+ public static void activate(Object object, boolean useAnnotation) throws LifecycleException
{
if (object instanceof Lifecycle)
{