From ecf04061e5efbb48144ef5bd37db42ab68e1d167 Mon Sep 17 00:00:00 2001 From: rfeng Date: Thu, 29 Oct 2009 21:35:00 +0000 Subject: Handle service unregistration gracefully git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@831097 13f79535-47bb-0310-9956-ffa450edef68 --- .../implementation/osgi/runtime/OSGiImplementationProvider.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'java') diff --git a/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java b/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java index 7c2b90e601..5c13b3d04e 100644 --- a/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java +++ b/java/sca/modules/implementation-osgi-runtime/src/main/java/org/apache/tuscany/sca/implementation/osgi/runtime/OSGiImplementationProvider.java @@ -127,7 +127,12 @@ public class OSGiImplementationProvider implements ImplementationProvider { public void stop() { for (ServiceRegistration registration : registrations) { - registration.unregister(); + try { + registration.unregister(); + } catch (IllegalStateException e) { + // The service has been unregistered + // Ignore + } } registrations.clear(); try { -- cgit v1.2.3