diff options
author | Markus Alexander Kuppe | 2013-07-04 08:08:25 +0000 |
---|---|---|
committer | Markus Alexander Kuppe | 2013-07-04 12:06:00 +0000 |
commit | 4e252b22a27185acf76a2a641ec2396afa55581c (patch) | |
tree | fba630d6705b2f67d5b3d6d83da4a4ec5c7ce22f /server-side/bundles | |
parent | f4756887baf1a54d54d63b84e3d796d0394ebe54 (diff) | |
download | org.eclipse.ecf-4e252b22a27185acf76a2a641ec2396afa55581c.tar.gz org.eclipse.ecf-4e252b22a27185acf76a2a641ec2396afa55581c.tar.xz org.eclipse.ecf-4e252b22a27185acf76a2a641ec2396afa55581c.zip |
NEW - bug 412261: [Distributed EventAdmin] Allow to only log
serialization failures
https://bugs.eclipse.org/bugs/show_bug.cgi?id=412261
Diffstat (limited to 'server-side/bundles')
2 files changed, 28 insertions, 4 deletions
diff --git a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/META-INF/MANIFEST.MF b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/META-INF/MANIFEST.MF index 46028e21a..a60680409 100644 --- a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/META-INF/MANIFEST.MF +++ b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.ecf.remoteservice.eventadmin -Bundle-Version: 1.1.100.qualifier +Bundle-Version: 1.2.0.qualifier Bundle-Vendor: %bundleProvider Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1, J2SE-1.4 diff --git a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/DistributedEventAdmin.java b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/DistributedEventAdmin.java index c3d84ae5c..63c5cbd65 100644 --- a/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/DistributedEventAdmin.java +++ b/server-side/bundles/org.eclipse.ecf.remoteservice.eventadmin/src/org/eclipse/ecf/remoteservice/eventadmin/DistributedEventAdmin.java @@ -8,6 +8,7 @@ * Contributors: * Composent, Inc. - initial API and implementation * IBM Corporation - initial API and implementation (non-distributed EventAdmin) + * Markus Alexander Kuppe - https://bugs.eclipse.org/412261 *****************************************************************************/ package org.eclipse.ecf.remoteservice.eventadmin; @@ -43,6 +44,15 @@ import org.osgi.service.log.LogService; public class DistributedEventAdmin extends BaseSharedObject implements EventAdmin { + /** + * @since 1.2 + * @noreference + * protected non-final for unit tests only!!! + */ + protected static boolean ignoreSerializationExceptions = Boolean + .getBoolean(DistributedEventAdmin.class.getName() + + ".IgnoreSerialzationFailures"); + private LogTracker logTracker; private LogService log; private EventHandlerTracker eventHandlerTracker; @@ -51,6 +61,13 @@ public class DistributedEventAdmin extends BaseSharedObject implements private static final String SHARED_OBJECT_MESSAGE_METHOD = "__handlePostEventSharedObjectMsg"; /** + * @noreference + */ + protected DistributedEventAdmin() { + // nop + } + + /** * Create a Distributed EventAdmin implementation. * * @param context @@ -300,9 +317,16 @@ public class DistributedEventAdmin extends BaseSharedObject implements + " messageParams=" + ((messageParams == null) ? null : Arrays .asList(messageParams)); - logError(exceptionMessage, exception); - // By default we throw a runtime exception - throw new ServiceException(exceptionMessage, exception); + + // By default we throw a runtime exception, but + // only throw an exception if not explicitly turned off + if (!(exception instanceof NotSerializableException) + || !ignoreSerializationExceptions) { + logError(exceptionMessage, exception); + throw new ServiceException(exceptionMessage, exception); + } else { + logWarning(exceptionMessage, exception); + } } /** |