You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2017/03/17 11:35:04 UTC

camel git commit: CAMEL-11011 Make all Services Closeable - reverted

Repository: camel
Updated Branches:
  refs/heads/master 24d2f4aea -> 0b074a762


CAMEL-11011 Make all Services Closeable - reverted

Decided that this could be revisited for 3.0 as the current tooling
doesn't seem to do method flow analysis and it doesn't detect that
stop() and close() are equivalent.

(reverted from commit 32f39ea17b9d0a292c8a6877089a79ecf8c0479b)


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0b074a76
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0b074a76
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0b074a76

Branch: refs/heads/master
Commit: 0b074a76270a206b706fb43b8296bc234d2ea298
Parents: 24d2f4a
Author: Zoran Regvart <zr...@apache.org>
Authored: Fri Mar 17 12:32:53 2017 +0100
Committer: Zoran Regvart <zr...@apache.org>
Committed: Fri Mar 17 12:34:38 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/Service.java | 22 +-------------------
 1 file changed, 1 insertion(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0b074a76/camel-core/src/main/java/org/apache/camel/Service.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/Service.java b/camel-core/src/main/java/org/apache/camel/Service.java
index da30f43..7ad90ba 100644
--- a/camel-core/src/main/java/org/apache/camel/Service.java
+++ b/camel-core/src/main/java/org/apache/camel/Service.java
@@ -16,15 +16,12 @@
  */
 package org.apache.camel;
 
-import java.io.Closeable;
-import java.io.IOException;
-
 /**
  * Represents the core lifecycle API for POJOs which can be started and stopped
  * 
  * @version 
  */
-public interface Service extends Closeable {
+public interface Service {
 
     /**
      * Starts the service
@@ -39,21 +36,4 @@ public interface Service extends Closeable {
      * @throws Exception is thrown if stopping failed
      */
     void stop() throws Exception;
-
-    /**
-     * Delegates to {@link Service#stop()} so it can be used in
-     * try-with-resources expression.
-     * 
-     * @throws IOException per contract of {@link Closeable} if
-     *             {@link Service#stop()} fails
-     */
-    default void close() throws IOException {
-        try {
-            stop();
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new IOException(e);
-        }
-    }
 }