Skip to content

Commit

Permalink
Remove 'final' modifiers to allow mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
benjchristensen committed Feb 5, 2013
1 parent c547fbb commit f2fcd4d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private HystrixCollapser(HystrixCollapserKey collapserKey, Scope scope, Collapse
*
* @return {@link HystrixCollapserKey} identifying this {@link HystrixCollapser} instance
*/
public final HystrixCollapserKey getCollapserKey() {
public HystrixCollapserKey getCollapserKey() {
return collapserKey;
}

Expand All @@ -179,7 +179,7 @@ public final HystrixCollapserKey getCollapserKey() {
*
* @return {@link Scope} that collapsing should be performed within.
*/
public final Scope getScope() {
public Scope getScope() {
return scope;
}

Expand Down
42 changes: 21 additions & 21 deletions hystrix-core/src/main/java/com/netflix/hystrix/HystrixCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -334,26 +334,26 @@ protected R getFallback() {
* The {@link HystrixCommandGroupKey} is used to represent a common relationship between commands. For example, a library or team name, the system all related commands interace with,
* common business purpose etc.
*/
public final HystrixCommandGroupKey getCommandGroup() {
public HystrixCommandGroupKey getCommandGroup() {
return commandGroup;
}

/**
* @return {@link HystrixCommandKey} identifying this command instance for statistics, circuit-breaker, properties, etc.
*/
public final HystrixCommandKey getCommandKey() {
public HystrixCommandKey getCommandKey() {
return commandKey;
}

/**
* @return {@link HystrixThreadPoolKey} identifying which thread-pool this command uses (when configured to run on separate threads via
* {@link HystrixCommandProperties#executionIsolationStrategy()}).
*/
public final HystrixThreadPoolKey getThreadPoolKey() {
public HystrixThreadPoolKey getThreadPoolKey() {
return threadPoolKey;
}

/* package */final HystrixCircuitBreaker getCircuitBreaker() {
/* package */HystrixCircuitBreaker getCircuitBreaker() {
return circuitBreaker;
}

Expand All @@ -362,7 +362,7 @@ public final HystrixThreadPoolKey getThreadPoolKey() {
*
* @return HystrixCommandMetrics
*/
public final HystrixCommandMetrics getMetrics() {
public HystrixCommandMetrics getMetrics() {
return metrics;
}

Expand All @@ -371,7 +371,7 @@ public final HystrixCommandMetrics getMetrics() {
*
* @return HystrixCommandProperties
*/
public final HystrixCommandProperties getProperties() {
public HystrixCommandProperties getProperties() {
return properties;
}

Expand All @@ -395,7 +395,7 @@ public final HystrixCommandProperties getProperties() {
* @throws HystrixBadRequestException
* if invalid arguments or state were used representing a user failure, not a system failure
*/
public final R execute() {
public R execute() {
try {
/* used to track userThreadExecutionTime */
if (!invocationStartTime.compareAndSet(-1, System.currentTimeMillis())) {
Expand Down Expand Up @@ -510,7 +510,7 @@ private R executeWithSemaphore() {
* @throws HystrixBadRequestException
* via {@code Future.get()} in {@link ExecutionException#getCause()} if invalid arguments or state were used representing a user failure, not a system failure
*/
public final Future<R> queue() {
public Future<R> queue() {
try {
/* used to track userThreadExecutionTime */
if (!invocationStartTime.compareAndSet(-1, System.currentTimeMillis())) {
Expand Down Expand Up @@ -911,7 +911,7 @@ private void recordExecutedCommand() {
*
* @return boolean
*/
public final boolean isCircuitBreakerOpen() {
public boolean isCircuitBreakerOpen() {
return circuitBreaker.isOpen();
}

Expand All @@ -920,7 +920,7 @@ public final boolean isCircuitBreakerOpen() {
*
* @return boolean
*/
public final boolean isExecutionComplete() {
public boolean isExecutionComplete() {
return isExecutionComplete.get();
}

Expand All @@ -933,7 +933,7 @@ public final boolean isExecutionComplete() {
*
* @return boolean
*/
public final boolean isExecutedInThread() {
public boolean isExecutedInThread() {
return isExecutedInThread.get();
}

Expand All @@ -942,7 +942,7 @@ public final boolean isExecutedInThread() {
*
* @return boolean
*/
public final boolean isSuccessfulExecution() {
public boolean isSuccessfulExecution() {
return executionResult.events.contains(HystrixEventType.SUCCESS);
}

Expand All @@ -951,7 +951,7 @@ public final boolean isSuccessfulExecution() {
*
* @return boolean
*/
public final boolean isFailedExecution() {
public boolean isFailedExecution() {
return executionResult.events.contains(HystrixEventType.FAILURE);
}

Expand All @@ -964,7 +964,7 @@ public final boolean isFailedExecution() {
*
* @return Throwable or null
*/
public final Throwable getFailedExecutionException() {
public Throwable getFailedExecutionException() {
return executionResult.exception;
}

Expand All @@ -974,7 +974,7 @@ public final Throwable getFailedExecutionException() {
*
* @return boolean
*/
public final boolean isResponseFromFallback() {
public boolean isResponseFromFallback() {
return executionResult.events.contains(HystrixEventType.FALLBACK_SUCCESS);
}

Expand All @@ -984,7 +984,7 @@ public final boolean isResponseFromFallback() {
*
* @return boolean
*/
public final boolean isResponseTimedOut() {
public boolean isResponseTimedOut() {
return executionResult.events.contains(HystrixEventType.TIMEOUT);
}

Expand All @@ -994,7 +994,7 @@ public final boolean isResponseTimedOut() {
*
* @return boolean
*/
public final boolean isResponseShortCircuited() {
public boolean isResponseShortCircuited() {
return executionResult.events.contains(HystrixEventType.SHORT_CIRCUITED);
}

Expand All @@ -1003,7 +1003,7 @@ public final boolean isResponseShortCircuited() {
*
* @return boolean
*/
public final boolean isResponseFromCache() {
public boolean isResponseFromCache() {
return executionResult.events.contains(HystrixEventType.RESPONSE_FROM_CACHE);
}

Expand All @@ -1013,7 +1013,7 @@ public final boolean isResponseFromCache() {
*
* @return boolean
*/
public final boolean isResponseRejected() {
public boolean isResponseRejected() {
return executionResult.events.contains(HystrixEventType.THREAD_POOL_REJECTED) || executionResult.events.contains(HystrixEventType.SEMAPHORE_REJECTED);
}

Expand All @@ -1024,7 +1024,7 @@ public final boolean isResponseRejected() {
*
* @return {@code List<HystrixEventType>}
*/
public final List<HystrixEventType> getExecutionEvents() {
public List<HystrixEventType> getExecutionEvents() {
return executionResult.events;
}

Expand All @@ -1033,7 +1033,7 @@ public final List<HystrixEventType> getExecutionEvents() {
*
* @return int
*/
public final int getExecutionTimeInMilliseconds() {
public int getExecutionTimeInMilliseconds() {
return executionResult.executionTime;
}

Expand Down

0 comments on commit f2fcd4d

Please sign in to comment.