diff options
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/OptionalCodeSafeRunnable.java')
-rw-r--r-- | framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/OptionalCodeSafeRunnable.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/OptionalCodeSafeRunnable.java b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/OptionalCodeSafeRunnable.java new file mode 100644 index 000000000..463eb2bee --- /dev/null +++ b/framework/bundles/org.eclipse.ecf.identity/src/org/eclipse/ecf/core/util/OptionalCodeSafeRunnable.java @@ -0,0 +1,21 @@ +package org.eclipse.ecf.core.util; + +import org.eclipse.core.runtime.*; +import org.eclipse.ecf.internal.core.identity.Activator; + +/** + * @since 3.3 + */ +public abstract class OptionalCodeSafeRunnable implements ISafeRunnable { + + public void handleException(Throwable exception) { + Activator a = Activator.getDefault(); + if (a != null) + a.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, + IStatus.WARNING, + "Warning: optional code cannot be run", exception)); //$NON-NLS-1$ + } + + public abstract void run() throws Exception; + +} |