Author: davsclaus
Date: Tue Aug 30 07:35:38 2011
New Revision: 1163118
URL: http://svn.apache.org/viewvc?rev=1163118&view=rev
Log:
CAMEL-4381: Polished.
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/StatefulService.java
camel/trunk/camel-core/src/main/java/org/apache/camel/WrappedFile.java
camel/trunk/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUCache.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/StatefulService.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/StatefulService.java?rev=1163118&r1=1163117&r2=1163118&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/StatefulService.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/StatefulService.java
Tue Aug 30 07:35:38 2011
@@ -16,49 +16,54 @@
*/
package org.apache.camel;
-
-public interface StatefulService extends Service, ShutdownableService {
-
- void suspend() throws Exception;
-
- void resume() throws Exception;
+/**
+ * A {@link Service} which has all the lifecycles events and offers details
about its current state.
+ */
+public interface StatefulService extends SuspendableService,
ShutdownableService {
/**
* Returns the current status
+ *
+ * @return the current status
*/
ServiceStatus getStatus();
/**
+ * Whether the service is started
+ *
* @return true if this service has been started
*/
boolean isStarted();
/**
+ * Whether the service is starting
+ *
* @return true if this service is being started
*/
boolean isStarting();
/**
+ * Whether the service is stopping
+ *
* @return true if this service is in the process of stopping
*/
boolean isStopping();
/**
+ * Whether the service is stopped
+ *
* @return true if this service is stopped
*/
boolean isStopped();
/**
+ * Whether the service is suspending
+ *
* @return true if this service is in the process of suspending
*/
boolean isSuspending();
/**
- * @return true if this service is suspended
- */
- boolean isSuspended();
-
- /**
* Helper methods so the service knows if it should keep running.
* Returns <tt>false</tt> if the service is being stopped or is stopped.
*
@@ -68,6 +73,8 @@ public interface StatefulService extends
/**
* Returns the version of this service
+ *
+ * @return the version
*/
String getVersion();
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/WrappedFile.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/WrappedFile.java?rev=1163118&r1=1163117&r2=1163118&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/WrappedFile.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/WrappedFile.java Tue
Aug 30 07:35:38 2011
@@ -16,8 +16,16 @@
*/
package org.apache.camel;
+/**
+ * Wraps a file.
+ */
public interface WrappedFile<T> {
+ /**
+ * Gets the file.
+ *
+ * @return the file.
+ */
T getFile();
}
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java?rev=1163118&r1=1163117&r2=1163118&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/support/ServiceSupport.java
Tue Aug 30 07:35:38 2011
@@ -21,7 +21,6 @@ import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.camel.ServiceStatus;
-import org.apache.camel.ShutdownableService;
import org.apache.camel.StatefulService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,7 +34,7 @@ import org.slf4j.LoggerFactory;
*
* @version
*/
-public abstract class ServiceSupport implements ShutdownableService,
StatefulService {
+public abstract class ServiceSupport implements StatefulService {
private static final transient Logger LOG =
LoggerFactory.getLogger(ServiceSupport.class);
protected final AtomicBoolean started = new AtomicBoolean(false);
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUCache.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUCache.java?rev=1163118&r1=1163117&r2=1163118&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUCache.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/LRUCache.java
Tue Aug 30 07:35:38 2011
@@ -55,7 +55,6 @@ public class LRUCache<K, V> implements S
.Builder<K, V>()
.initialCapacity(initialCapacity)
.maximumWeightedCapacity(maximumCacheSize).build();
-// super(initialCapacity, loadFactor, accessOrder);
this.maxCacheSize = maximumCacheSize;
}
@@ -101,6 +100,7 @@ public class LRUCache<K, V> implements S
}
@Override
+ @SuppressWarnings("unchecked")
public void putAll(Map<? extends K, ? extends V> map) {
((AbstractMap)map).putAll(map);
}