You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2017/02/14 09:49:10 UTC
[05/51] [partial] cxf git commit: Remove all trailing whitespaces
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
index 467d2fc..cf8d791 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
@@ -39,8 +39,8 @@ import org.apache.cxf.transport.Conduit;
/**
- * Implements a target selection strategy based on failover to an
- * alternate target endpoint when a transport level failure is
+ * Implements a target selection strategy based on failover to an
+ * alternate target endpoint when a transport level failure is
* encountered.
* Note that this feature changes the conduit on the fly and thus makes
* the Client not thread safe.
@@ -48,10 +48,10 @@ import org.apache.cxf.transport.Conduit;
public class FailoverTargetSelector extends AbstractConduitSelector {
private static final Logger LOG = LogUtils.getL7dLogger(FailoverTargetSelector.class);
- private static final String COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY =
+ private static final String COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY =
"org.apache.cxf.transport.complete_if_service_not_available";
- protected ConcurrentHashMap<InvocationKey, InvocationContext> inProgress
+ protected ConcurrentHashMap<InvocationKey, InvocationContext> inProgress
= new ConcurrentHashMap<InvocationKey, InvocationContext>();
protected FailoverStrategy failoverStrategy;
private boolean supportNotAvailableErrorsOnly = true;
@@ -62,24 +62,24 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
public FailoverTargetSelector() {
super();
}
-
+
public FailoverTargetSelector(String clientBootstrapAddress) {
super();
this.clientBootstrapAddress = clientBootstrapAddress;
}
-
+
/**
* Constructor, allowing a specific conduit to override normal selection.
- *
+ *
* @param c specific conduit
*/
public FailoverTargetSelector(Conduit c) {
super(c);
}
-
+
/**
* Called prior to the interceptor chain being traversed.
- *
+ *
* @param message the current Message
*/
public void prepare(Message message) {
@@ -88,27 +88,27 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
Exchange exchange = message.getExchange();
setupExchangeExceptionProperties(exchange);
-
+
InvocationKey key = new InvocationKey(exchange);
if (getInvocationContext(key) == null) {
-
+
if (getClientBootstrapAddress() != null
&& getClientBootstrapAddress().equals(message.get(Message.ENDPOINT_ADDRESS))) {
- List<String> addresses = failoverStrategy.getAlternateAddresses(exchange);
+ List<String> addresses = failoverStrategy.getAlternateAddresses(exchange);
if (addresses != null && !addresses.isEmpty()) {
getEndpoint().getEndpointInfo().setAddress(addresses.get(0));
message.put(Message.ENDPOINT_ADDRESS, addresses.get(0));
}
}
-
+
Endpoint endpoint = exchange.getEndpoint();
BindingOperationInfo bindingOperationInfo =
exchange.getBindingOperationInfo();
Object[] params = message.getContent(List.class).toArray();
Map<String, Object> context =
CastUtils.cast((Map<?, ?>)message.get(Message.INVOCATION_CONTEXT));
- InvocationContext invocation =
- new InvocationContext(endpoint,
+ InvocationContext invocation =
+ new InvocationContext(endpoint,
bindingOperationInfo,
params,
context);
@@ -122,10 +122,10 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
ex.put(COMPLETE_IF_SERVICE_NOT_AVAIL_PROPERTY, true);
}
-
+
/**
* Called when a Conduit is actually required.
- *
+ *
* @param message
* @return the Conduit to use for mediation of the message
*/
@@ -137,13 +137,13 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
return getSelectedConduit(message);
}
- protected InvocationContext getInvocationContext(InvocationKey key) {
+ protected InvocationContext getInvocationContext(InvocationKey key) {
return inProgress.get(key);
}
-
+
/**
* Called on completion of the MEP for which the Conduit was required.
- *
+ *
* @param exchange represents the completed MEP
*/
public void complete(Exchange exchange) {
@@ -153,13 +153,13 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
super.complete(exchange);
return;
}
-
+
boolean failover = false;
final Exception ex = getExceptionIfPresent(exchange);
if (requiresFailover(exchange, ex)) {
onFailure(invocation, ex);
Conduit old = (Conduit)exchange.getOutMessage().remove(Conduit.class.getName());
-
+
Endpoint failoverTarget = getFailoverTarget(exchange, invocation);
if (failoverTarget != null) {
setEndpoint(failoverTarget);
@@ -173,28 +173,28 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
getLogger().fine("FAILOVER_NOT_REQUIRED");
onSuccess(invocation);
}
-
+
if (!failover) {
inProgress.remove(key);
doComplete(exchange);
}
}
-
+
protected void doComplete(Exchange exchange) {
super.complete(exchange);
}
-
+
protected void setOriginalEndpoint(InvocationContext invocation) {
setEndpoint(invocation.retrieveOriginalEndpoint(endpoint));
}
-
+
protected boolean performFailover(Exchange exchange, InvocationContext invocation) {
Exception prevExchangeFault = (Exception)exchange.remove(Exception.class.getName());
Message outMessage = exchange.getOutMessage();
Exception prevMessageFault = outMessage.getContent(Exception.class);
outMessage.setContent(Exception.class, null);
overrideAddressProperty(invocation.getContext());
-
+
Retryable retry = exchange.get(Retryable.class);
exchange.clear();
boolean failover = false;
@@ -221,13 +221,13 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
return failover;
}
-
+
protected void onSuccess(InvocationContext context) {
}
-
+
protected void onFailure(InvocationContext context, Exception ex) {
}
-
+
/**
* @param strategy the FailoverStrategy to use
*/
@@ -237,10 +237,10 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
failoverStrategy = strategy;
}
}
-
+
/**
* @return strategy the FailoverStrategy to use
- */
+ */
public synchronized FailoverStrategy getStrategy() {
if (failoverStrategy == null) {
failoverStrategy = new SequentialStrategy();
@@ -270,10 +270,10 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
//perhaps supporting FailoverTargetSelector specific property can make sense too
return 0;
}
-
+
/**
* Check if the exchange is suitable for a failover.
- *
+ *
* @param exchange the current Exchange
* @return boolean true if a failover should be attempted
*/
@@ -307,10 +307,10 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
: exchange.get(Exception.class);
return ex;
}
-
+
/**
* Get the failover target endpoint, if a suitable one is available.
- *
+ *
* @param exchange the current Exchange
* @param invocation the current InvocationContext
* @return a failover endpoint if one is available
@@ -320,7 +320,7 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
List<String> alternateAddresses = updateContextAlternatives(exchange, invocation);
Endpoint failoverTarget = null;
if (alternateAddresses != null) {
- String alternateAddress =
+ String alternateAddress =
getStrategy().selectAlternateAddress(alternateAddresses);
if (alternateAddress != null) {
// re-use current endpoint
@@ -337,7 +337,7 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
/**
- * Fetches and updates the alternative address or/and alternative endpoints
+ * Fetches and updates the alternative address or/and alternative endpoints
* (depending on the strategy) for current invocation context.
* @param exchange the current Exchange
* @param invocation the current InvocationContext
@@ -348,7 +348,7 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
if (!invocation.hasAlternates()) {
// no previous failover attempt on this invocation
//
- alternateAddresses =
+ alternateAddresses =
getStrategy().getAlternateAddresses(exchange);
if (alternateAddresses != null) {
invocation.setAlternateAddresses(alternateAddresses);
@@ -361,16 +361,16 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
return alternateAddresses;
}
-
+
/**
* Override the ENDPOINT_ADDRESS property in the request context
- *
+ *
* @param context the request context
*/
protected void overrideAddressProperty(Map<String, Object> context) {
overrideAddressProperty(context, getEndpoint().getEndpointInfo().getAddress());
}
-
+
protected void overrideAddressProperty(Map<String, Object> context,
String address) {
Map<String, Object> requestContext =
@@ -380,12 +380,12 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
requestContext.put("javax.xml.ws.service.endpoint.address", address);
}
}
-
+
// Some conduits may replace the endpoint address after it has already been prepared
// but before the invocation has been done (ex, org.apache.cxf.clustering.LoadDistributorTargetSelector)
- // which may affect JAX-RS clients where actual endpoint address property may include additional path
- // segments.
- protected boolean replaceEndpointAddressPropertyIfNeeded(Message message,
+ // which may affect JAX-RS clients where actual endpoint address property may include additional path
+ // segments.
+ protected boolean replaceEndpointAddressPropertyIfNeeded(Message message,
String endpointAddress,
Conduit cond) {
String requestURI = (String)message.get(Message.REQUEST_URI);
@@ -415,7 +415,7 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
return false;
}
-
+
public boolean isSupportNotAvailableErrorsOnly() {
return supportNotAvailableErrorsOnly;
}
@@ -440,16 +440,16 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
*/
protected static class InvocationKey {
private Exchange exchange;
-
+
InvocationKey(Exchange ex) {
- exchange = ex;
+ exchange = ex;
}
-
+
@Override
public int hashCode() {
return System.identityHashCode(exchange);
}
-
+
@Override
public boolean equals(Object o) {
return o instanceof InvocationKey
@@ -465,14 +465,14 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
private Endpoint originalEndpoint;
private String originalAddress;
private BindingOperationInfo bindingOperationInfo;
- private Object[] params;
+ private Object[] params;
private Map<String, Object> context;
private List<Endpoint> alternateEndpoints;
private List<String> alternateAddresses;
-
+
InvocationContext(Endpoint endpoint,
BindingOperationInfo boi,
- Object[] prms,
+ Object[] prms,
Map<String, Object> ctx) {
originalEndpoint = endpoint;
originalAddress = endpoint.getEndpointInfo().getAddress();
@@ -497,19 +497,19 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
}
return originalEndpoint;
}
-
+
BindingOperationInfo getBindingOperationInfo() {
return bindingOperationInfo;
}
-
+
Object[] getParams() {
return params;
}
-
+
Map<String, Object> getContext() {
return context;
}
-
+
List<Endpoint> getAlternateEndpoints() {
return alternateEndpoints;
}
@@ -529,5 +529,5 @@ public class FailoverTargetSelector extends AbstractConduitSelector {
boolean hasAlternates() {
return !(alternateEndpoints == null && alternateAddresses == null);
}
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorFeature.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorFeature.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorFeature.java
index 97840f2..ade09ac 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorFeature.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorFeature.java
@@ -29,14 +29,14 @@ import org.apache.cxf.common.injection.NoJSR250Annotations;
@NoJSR250Annotations
public class LoadDistributorFeature extends FailoverFeature {
-
+
public LoadDistributorFeature() {
-
+
}
public LoadDistributorFeature(String clientBootstrapAddress) {
super(clientBootstrapAddress);
}
-
+
@Override
public FailoverTargetSelector getTargetSelector() {
return new LoadDistributorTargetSelector(getClientBootstrapAddress());
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorTargetSelector.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorTargetSelector.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorTargetSelector.java
index 53a7582..5ef66f5 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorTargetSelector.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/LoadDistributorTargetSelector.java
@@ -31,7 +31,7 @@ import org.apache.cxf.transport.Conduit;
* The LoadDistributorTargetSelector attempts to do the same job as the
* FailoverTargetSelector, but to choose an alternate target on every request
* rather than just when a fault occurs.
- * The LoadDistributorTargetSelector uses the same FailoverStrategy interface as
+ * The LoadDistributorTargetSelector uses the same FailoverStrategy interface as
* the FailoverTargetSelector, but has a few significant limitations:
* 1. Because the LoadDistributorTargetSelector needs to maintain a list of targets
* between calls it has to obtain that list without reference to a Message.
@@ -42,7 +42,7 @@ import org.apache.cxf.transport.Conduit;
* discarded after this message has been processed. As a consequence, if the
* strategy chosen is a simple sequential one the first item in the list will
* be chosen every time.
- * Conclusion: Be aware that if you are working with targets that are
+ * Conclusion: Be aware that if you are working with targets that are
* dependent on the Message the process will be less efficient and that the
* SequentialStrategy will not distribute the load at all.
* 2. The AbstractStaticFailoverStrategy base class excludes the 'default' endpoint
@@ -54,7 +54,7 @@ import org.apache.cxf.transport.Conduit;
public class LoadDistributorTargetSelector extends FailoverTargetSelector {
private static final Logger LOG = LogUtils.getL7dLogger(
LoadDistributorTargetSelector.class);
- private static final String IS_DISTRIBUTED =
+ private static final String IS_DISTRIBUTED =
"org.apache.cxf.clustering.LoadDistributorTargetSelector.IS_DISTRIBUTED";
private List<String> addressList;
@@ -67,7 +67,7 @@ public class LoadDistributorTargetSelector extends FailoverTargetSelector {
public LoadDistributorTargetSelector() {
super();
}
-
+
public LoadDistributorTargetSelector(String clientBootstrapAddress) {
super(clientBootstrapAddress);
}
@@ -127,7 +127,7 @@ public class LoadDistributorTargetSelector extends FailoverTargetSelector {
* @param exchange the current Exchange
* @param invocation the current InvocationContext
* @return a failover endpoint if one is available
- *
+ *
* Note: The only difference between this and the super implementation is
* that the current (failed) address is removed from the list set of alternates,
* it could be argued that that change should be in the super implementation
@@ -139,7 +139,7 @@ public class LoadDistributorTargetSelector extends FailoverTargetSelector {
if (!invocation.hasAlternates()) {
// no previous failover attempt on this invocation
//
- alternateAddresses =
+ alternateAddresses =
getStrategy().getAlternateAddresses(exchange);
if (alternateAddresses != null) {
alternateAddresses.remove(exchange.getEndpoint().getEndpointInfo().getAddress());
@@ -154,7 +154,7 @@ public class LoadDistributorTargetSelector extends FailoverTargetSelector {
Endpoint failoverTarget = null;
if (alternateAddresses != null) {
- String alternateAddress =
+ String alternateAddress =
getStrategy().selectAlternateAddress(alternateAddresses);
if (alternateAddress != null) {
// re-use current endpoint
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RandomStrategy.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RandomStrategy.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RandomStrategy.java
index 29aba0a..676c47e 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RandomStrategy.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RandomStrategy.java
@@ -24,13 +24,13 @@ import java.util.Random;
/**
* Failover strategy based on a randomized walk through the
- * static cluster represented by multiple endpoints associated
+ * static cluster represented by multiple endpoints associated
* with the same service instance.
*/
public class RandomStrategy extends AbstractStaticFailoverStrategy {
-
+
private Random random;
-
+
/**
* Constructor.
*/
@@ -40,8 +40,8 @@ public class RandomStrategy extends AbstractStaticFailoverStrategy {
/**
* Get next alternate endpoint.
- *
- * @param alternates non-empty List of alternate endpoints
+ *
+ * @param alternates non-empty List of alternate endpoints
* @return
*/
protected <T> T getNextAlternate(List<T> alternates) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java
index feada0e..a6cb801 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java
@@ -31,7 +31,7 @@ public class RetryStrategy extends SequentialStrategy {
private int maxNumberOfRetries;
private int counter;
-
+
/* (non-Javadoc)
* @see org.apache.cxf.clustering.AbstractStaticFailoverStrategy#getAlternateEndpoints(
* org.apache.cxf.message.Exchange)
@@ -40,7 +40,7 @@ public class RetryStrategy extends SequentialStrategy {
public List<Endpoint> getAlternateEndpoints(Exchange exchange) {
return getEndpoints(exchange, stillTheSameAddress());
}
-
+
protected <T> T getNextAlternate(List<T> alternates) {
return stillTheSameAddress() ? alternates.get(0) : alternates.remove(0);
}
@@ -52,13 +52,13 @@ public class RetryStrategy extends SequentialStrategy {
// let the target selector move to the next address
// and then stay on the same address for maxNumberOfRetries
if (++counter <= maxNumberOfRetries) {
- return true;
+ return true;
} else {
counter = 0;
return false;
}
}
-
+
public void setMaxNumberOfRetries(int maxNumberOfRetries) {
if (maxNumberOfRetries < 0) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/SequentialStrategy.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/SequentialStrategy.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/SequentialStrategy.java
index 6a7e883..6ef077c 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/SequentialStrategy.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/SequentialStrategy.java
@@ -23,15 +23,15 @@ import java.util.List;
/**
* Failover strategy based on a sequential walk through the
- * static cluster represented by multiple endpoints associated
+ * static cluster represented by multiple endpoints associated
* with the same service instance.
*/
public class SequentialStrategy extends AbstractStaticFailoverStrategy {
/**
* Get next alternate endpoint.
- *
- * @param alternates non-empty List of alternate endpoints
+ *
+ * @param alternates non-empty List of alternate endpoints
* @return
*/
protected <T> T getNextAlternate(List<T> alternates) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
index b5367d1..d03a52d 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/blueprint/ClusteringBPBeanDefinitionParser.java
@@ -28,7 +28,7 @@ public class ClusteringBPBeanDefinitionParser extends SimpleBPBeanDefinitionPars
public ClusteringBPBeanDefinitionParser(Class<?> cls) {
super(cls);
}
-
+
@Override
protected void mapElement(ParserContext ctx, MutableBeanMetadata bean, Element el, String name) {
setFirstChildAsProperty(el, ctx, bean, name);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreaker.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreaker.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreaker.java
index 4a4e3e0..00ed187 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreaker.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreaker.java
@@ -28,14 +28,14 @@ public interface CircuitBreaker {
* @return "false" if circuit breaker is open, "true" otherwise
*/
boolean allowRequest();
-
+
/**
* Reports about failure conditions to circuit breaker.
* @param cause exception happened (could be null in case the error is deducted
* from response status/code).
*/
void markFailure(Throwable cause);
-
+
/**
* Reports about successful invocation to circuit breaker.
*/
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java
index bc37632..317d880 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/CircuitBreakerFailoverFeature.java
@@ -28,18 +28,18 @@ public class CircuitBreakerFailoverFeature extends FailoverFeature {
private int threshold;
private long timeout;
private FailoverTargetSelector targetSelector;
-
+
public CircuitBreakerFailoverFeature() {
- this(CircuitBreakerTargetSelector.DEFAULT_THESHOLD,
+ this(CircuitBreakerTargetSelector.DEFAULT_THESHOLD,
CircuitBreakerTargetSelector.DEFAULT_TIMEOUT);
}
-
+
public CircuitBreakerFailoverFeature(String clientBootstrapAddress) {
- this(CircuitBreakerTargetSelector.DEFAULT_THESHOLD,
+ this(CircuitBreakerTargetSelector.DEFAULT_THESHOLD,
CircuitBreakerTargetSelector.DEFAULT_TIMEOUT,
clientBootstrapAddress);
}
-
+
public CircuitBreakerFailoverFeature(int threshold, long timeout) {
this.threshold = threshold;
this.timeout = timeout;
@@ -50,28 +50,28 @@ public class CircuitBreakerFailoverFeature extends FailoverFeature {
this.threshold = threshold;
this.timeout = timeout;
}
-
+
@Override
public FailoverTargetSelector getTargetSelector() {
if (this.targetSelector == null) {
- this.targetSelector = new CircuitBreakerTargetSelector(threshold, timeout,
+ this.targetSelector = new CircuitBreakerTargetSelector(threshold, timeout,
super.getClientBootstrapAddress());
}
return this.targetSelector;
}
-
+
public int getThreshold() {
return threshold;
}
-
+
public long getTimeout() {
return timeout;
}
-
+
public void setThreshold(int threshold) {
this.threshold = threshold;
}
-
+
public void setTimeout(long timeout) {
this.timeout = timeout;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/ZestCircuitBreaker.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/ZestCircuitBreaker.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/ZestCircuitBreaker.java
index a64936d..2d6e524 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/ZestCircuitBreaker.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/circuitbreaker/ZestCircuitBreaker.java
@@ -21,25 +21,25 @@ package org.apache.cxf.clustering.circuitbreaker;
import org.qi4j.library.circuitbreaker.CircuitBreaker;
-public class ZestCircuitBreaker extends CircuitBreaker
+public class ZestCircuitBreaker extends CircuitBreaker
implements org.apache.cxf.clustering.circuitbreaker.CircuitBreaker {
-
+
private final CircuitBreaker delegate;
-
+
public ZestCircuitBreaker(final int threshold, final long timeout) {
delegate = new CircuitBreaker(threshold, timeout);
}
-
+
@Override
public boolean allowRequest() {
return delegate.isOn();
}
-
+
@Override
public void markFailure(Throwable cause) {
delegate.throwable(cause);
}
-
+
@Override
public void markSuccess() {
delegate.success();
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/CircuitBreakerFailoverBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/CircuitBreakerFailoverBeanDefinitionParser.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/CircuitBreakerFailoverBeanDefinitionParser.java
index d3a8288..67d5cf8 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/CircuitBreakerFailoverBeanDefinitionParser.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/CircuitBreakerFailoverBeanDefinitionParser.java
@@ -30,7 +30,7 @@ public class CircuitBreakerFailoverBeanDefinitionParser extends AbstractBeanDefi
protected Class<?> getBeanClass(Element element) {
return CircuitBreakerFailoverFeature.class;
}
-
+
@Override
protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, Element e, String name) {
setFirstChildAsProperty(e, ctx, bean, name);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/FailoverBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/FailoverBeanDefinitionParser.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/FailoverBeanDefinitionParser.java
index 231a149..87d43d9 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/FailoverBeanDefinitionParser.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/FailoverBeanDefinitionParser.java
@@ -31,7 +31,7 @@ public class FailoverBeanDefinitionParser extends AbstractBeanDefinitionParser {
protected Class<?> getBeanClass(Element element) {
return FailoverFeature.class;
}
-
+
@Override
protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, Element e, String name) {
setFirstChildAsProperty(e, ctx, bean, name);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/LoadDistributorBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/LoadDistributorBeanDefinitionParser.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/LoadDistributorBeanDefinitionParser.java
index 86000a6..9c5f379 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/LoadDistributorBeanDefinitionParser.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/LoadDistributorBeanDefinitionParser.java
@@ -31,7 +31,7 @@ public class LoadDistributorBeanDefinitionParser extends AbstractBeanDefinitionP
protected Class<?> getBeanClass(Element element) {
return LoadDistributorFeature.class;
}
-
+
@Override
protected void mapElement(ParserContext ctx, BeanDefinitionBuilder bean, Element e, String name) {
setFirstChildAsProperty(e, ctx, bean, name);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/NamespaceHandler.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/NamespaceHandler.java b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/NamespaceHandler.java
index 156356b..6081b54 100644
--- a/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/NamespaceHandler.java
+++ b/rt/features/clustering/src/main/java/org/apache/cxf/clustering/spring/NamespaceHandler.java
@@ -27,6 +27,6 @@ public class NamespaceHandler extends NamespaceHandlerSupport {
registerBeanDefinitionParser("loadDistributor",
new LoadDistributorBeanDefinitionParser());
registerBeanDefinitionParser("circuit-breaker-failover",
- new CircuitBreakerFailoverBeanDefinitionParser());
+ new CircuitBreakerFailoverBeanDefinitionParser());
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/clustering/src/test/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandlerTest.java
----------------------------------------------------------------------
diff --git a/rt/features/clustering/src/test/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandlerTest.java b/rt/features/clustering/src/test/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandlerTest.java
index 226e2ec..004b802 100644
--- a/rt/features/clustering/src/test/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandlerTest.java
+++ b/rt/features/clustering/src/test/java/org/apache/cxf/clustering/blueprint/ClusteringBPNamespaceHandlerTest.java
@@ -23,13 +23,13 @@ import org.junit.Assert;
import org.junit.Test;
/**
- *
+ *
*/
public class ClusteringBPNamespaceHandlerTest extends Assert {
@Test
public void testGetSchemaLocation() {
ClusteringBPNamespaceHandler handler = new ClusteringBPNamespaceHandler();
-
+
assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/clustering"));
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java
index cdc8618..a64c39c 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/AbstractLoggingInterceptor.java
@@ -42,7 +42,7 @@ public abstract class AbstractLoggingInterceptor extends AbstractPhaseIntercepto
super(phase);
this.sender = sender;
}
-
+
public void setLimit(int lim) {
this.limit = lim;
}
@@ -64,21 +64,21 @@ public abstract class AbstractLoggingInterceptor extends AbstractPhaseIntercepto
((PrettyLoggingFilter)this.sender).setPrettyLogging(prettyLogging);
}
}
-
+
protected boolean shouldLogContent(LogEvent event) {
- return event.isBinaryContent() && logBinary
+ return event.isBinaryContent() && logBinary
|| event.isMultipartContent() && logMultipart
|| !event.isBinaryContent() && !event.isMultipartContent();
}
-
+
public void setLogBinary(boolean logBinary) {
this.logBinary = logBinary;
}
-
+
public void setLogMultipart(boolean logMultipart) {
this.logMultipart = logMultipart;
}
-
+
public void createExchangeId(Message message) {
Exchange exchange = message.getExchange();
String exchangeId = (String)exchange.get(LogEvent.KEY_EXCHANGE_ID);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java
index 1e34887..77287df 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java
@@ -29,7 +29,7 @@ import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.interceptor.InterceptorProvider;
/**
- * This class is used to control message-on-the-wire logging.
+ * This class is used to control message-on-the-wire logging.
* By attaching this feature to an endpoint, you
* can specify logging. If this feature is present, an endpoint will log input
* and output of ordinary and log messages.
@@ -59,10 +59,10 @@ public class LoggingFeature extends AbstractFeature {
in = new LoggingInInterceptor(prettyFilter);
out = new LoggingOutInterceptor(prettyFilter);
}
-
+
@Override
protected void initializeProvider(InterceptorProvider provider, Bus bus) {
-
+
provider.getInInterceptors().add(wireTapIn);
provider.getInInterceptors().add(in);
provider.getInFaultInterceptors().add(in);
@@ -76,13 +76,13 @@ public class LoggingFeature extends AbstractFeature {
out.setLimit(limit);
wireTapIn.setLimit(limit);
}
-
+
public void setInMemThreshold(long inMemThreshold) {
in.setInMemThreshold(inMemThreshold);
out.setInMemThreshold(inMemThreshold);
wireTapIn.setThreshold(inMemThreshold);
}
-
+
public void setSender(LogEventSender sender) {
this.prettyFilter.setNext(sender);
}
@@ -90,18 +90,18 @@ public class LoggingFeature extends AbstractFeature {
public void setPrettyLogging(boolean prettyLogging) {
this.prettyFilter.setPrettyLogging(prettyLogging);
}
-
+
/**
* Log binary content?
- * @param logBinary defaults to false
+ * @param logBinary defaults to false
*/
public void setLogBinary(boolean logBinary) {
in.setLogBinary(logBinary);
out.setLogBinary(logBinary);
}
-
+
/**
- * Log multipart content?
+ * Log multipart content?
* @param logMultipart defaults to true
*/
public void setLogMultipart(boolean logMultipart) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
index 6c19109..a3f3ee4 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingInInterceptor.java
@@ -44,7 +44,7 @@ import org.apache.cxf.phase.Phase;
import org.apache.cxf.phase.PhaseInterceptor;
/**
- *
+ *
*/
@NoJSR250Annotations
public class LoggingInInterceptor extends AbstractLoggingInterceptor {
@@ -62,9 +62,9 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
message.remove(LogEvent.class);
sender.send(event);
}
- }
+ }
}
-
+
public LoggingInInterceptor() {
this(new Slf4jEventSender());
}
@@ -77,8 +77,8 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
public Collection<PhaseInterceptor<? extends Message>> getAdditionalInterceptors() {
return Collections.singleton(new SendLogEventInterceptor());
}
-
-
+
+
public void handleFault(Message message) {
LogEvent event = message.get(LogEvent.class);
if (event != null) {
@@ -99,8 +99,8 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
} else {
event.setPayload(AbstractLoggingInterceptor.CONTENT_SUPPRESSED);
}
- // at this point, we have the payload. However, we may not have the endpoint yet. Delay sending
- // the event till a little bit later
+ // at this point, we have the payload. However, we may not have the endpoint yet. Delay sending
+ // the event till a little bit later
message.put(LogEvent.class, event);
}
}
@@ -116,7 +116,7 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
}
}
}
-
+
protected void logInputStream(Message message, InputStream is, LogEvent event) {
CachedOutputStream bos = new CachedOutputStream();
if (threshold > 0) {
@@ -125,16 +125,16 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
String encoding = event.getEncoding();
try {
// use the appropriate input stream and restore it later
- InputStream bis = is instanceof DelegatingInputStream
+ InputStream bis = is instanceof DelegatingInputStream
? ((DelegatingInputStream)is).getInputStream() : is;
-
+
//only copy up to the limit since that's all we need to log
//we can stream the rest
IOUtils.copyAtLeast(bis, bos, limit == -1 ? Integer.MAX_VALUE : limit);
bos.flush();
bis = new SequenceInputStream(bos.getInputStream(), bis);
-
+
// restore the delegating input stream or the input stream
if (is instanceof DelegatingInputStream) {
((DelegatingInputStream)is).setInputStream(bis);
@@ -149,7 +149,7 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
if (bos.size() > limit && limit != -1) {
event.setTruncated(true);
}
-
+
StringBuilder builder = new StringBuilder(limit);
if (StringUtils.isEmpty(encoding)) {
bos.writeCacheTo(builder, limit);
@@ -168,7 +168,7 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
CachedWriter writer = new CachedWriter();
IOUtils.copyAndCloseInput(reader, writer);
message.setContent(Reader.class, writer.getReader());
-
+
if (writer.getTempFile() != null) {
//large thing on disk...
event.setFullContentFile(writer.getTempFile());
@@ -179,7 +179,7 @@ public class LoggingInInterceptor extends AbstractLoggingInterceptor {
int max = writer.size() > limit ? (int)limit : (int)writer.size();
StringBuilder b = new StringBuilder(max);
writer.writeCacheTo(b);
- event.setPayload(b.toString());
+ event.setPayload(b.toString());
} catch (Exception e) {
throw new Fault(e);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java
index 2885f6e..7d25139 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java
@@ -41,7 +41,7 @@ import org.apache.cxf.message.Message;
import org.apache.cxf.phase.Phase;
/**
- *
+ *
*/
@NoJSR250Annotations
public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
@@ -65,7 +65,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
message.setContent(OutputStream.class, createCachingOut(message, os, callback));
} else {
final Writer iowriter = message.getContent(Writer.class);
- if (iowriter != null) {
+ if (iowriter != null) {
message.setContent(Writer.class, new LogEventSendingWriter(sender, message, iowriter, limit));
}
}
@@ -130,7 +130,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
if (w2 == null) {
w2 = (StringWriter)out;
}
-
+
String payload = shouldLogContent(event) ? getPayload(event, w2) : CONTENT_SUPPRESSED;
event.setPayload(payload);
sender.send(event);
@@ -148,7 +148,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
}
return payload.toString();
}
-
+
protected void writePayload(StringBuilder builder, StringWriter stringWriter, String contentType)
throws Exception {
StringBuffer buffer = stringWriter.getBuffer();
@@ -207,7 +207,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
// ignore
}
}
-
+
protected void writePayload(StringBuilder builder, CachedOutputStream cos, String encoding,
String contentType) throws Exception {
if (StringUtils.isEmpty(encoding)) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/WireTapIn.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/WireTapIn.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/WireTapIn.java
index e6b8508..f7d4d66 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/WireTapIn.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/WireTapIn.java
@@ -38,7 +38,7 @@ public class WireTapIn extends AbstractPhaseInterceptor<Message> {
/**
* Instantiates a new WireTapIn
- * @param limit
+ * @param limit
*
* @param logMessageContent the log message content
*/
@@ -94,13 +94,13 @@ public class WireTapIn extends AbstractPhaseInterceptor<Message> {
message.setContent(CachedOutputStream.class, bos);
}
-
+
public void setLimit(int limit) {
this.limit = limit;
}
-
+
public void setThreshold(long threshold) {
this.threshold = threshold;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
index 7829b2e..030cd8c 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/DefaultLogEventMapper.java
@@ -170,7 +170,7 @@ public class DefaultLogEventMapper implements LogEventMapper {
String contentType = safeGet(message, Message.CONTENT_TYPE);
return contentType != null && BINARY_CONTENT_MEDIA_TYPES.contains(contentType);
}
-
+
private boolean isMultipartContent(Message message) {
String contentType = safeGet(message, Message.CONTENT_TYPE);
return contentType != null && contentType.startsWith(MULTIPART_CONTENT_MEDIA_TYPE);
@@ -189,7 +189,7 @@ public class DefaultLogEventMapper implements LogEventMapper {
/**
* Get MessageId from WS Addressing properties
- *
+ *
* @param message
* @return message id
*/
@@ -245,7 +245,7 @@ public class DefaultLogEventMapper implements LogEventMapper {
}
return new StringBuffer().append(httpMethod).append('[').append(path).append(']').toString();
}
-
+
private static String safeGet(Message message, String key) {
if (message == null || !message.containsKey(key)) {
return null;
@@ -285,7 +285,7 @@ public class DefaultLogEventMapper implements LogEventMapper {
/**
* For REST we also consider a response to be a fault if the operation is not found or the response code
* is an error
- *
+ *
* @param message
* @return
*/
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java
index 2ce1b83..cc7084d 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java
@@ -64,15 +64,15 @@ public final class LogEvent {
public void setExchangeId(String exchangeId) {
this.exchangeId = exchangeId;
}
-
+
public EventType getType() {
return type;
}
-
+
public void setType(EventType type) {
this.type = type;
}
-
+
public String getAddress() {
return address;
}
@@ -112,15 +112,15 @@ public final class LogEvent {
public void setResponseCode(String responseCode) {
this.responseCode = responseCode;
}
-
+
public String getPrincipal() {
return principal;
}
-
+
public void setPrincipal(String principal) {
this.principal = principal;
}
-
+
public QName getServiceName() {
return serviceName;
}
@@ -144,11 +144,11 @@ public final class LogEvent {
public void setPortTypeName(QName portTypeName) {
this.portTypeName = portTypeName;
}
-
+
public String getOperationName() {
return operationName;
}
-
+
public void setOperationName(String operationName) {
this.operationName = operationName;
}
@@ -168,11 +168,11 @@ public final class LogEvent {
public void setBinaryContent(boolean binaryContent) {
this.binaryContent = binaryContent;
}
-
+
public boolean isMultipartContent() {
return multipartContent;
}
-
+
public void setMultipartContent(boolean multipartContent) {
this.multipartContent = multipartContent;
}
@@ -184,7 +184,7 @@ public final class LogEvent {
public void setPayload(String payload) {
this.payload = payload;
}
-
+
public boolean isTruncated() {
return truncated;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
index db42fd4..27ed7e4 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrettyLoggingFilter.java
@@ -51,9 +51,9 @@ public class PrettyLoggingFilter implements LogEventSender {
}
private boolean shouldPrettyPrint(LogEvent event) {
- String contentType = event.getContentType();
- return prettyLogging
- && contentType != null
+ String contentType = event.getContentType();
+ return prettyLogging
+ && contentType != null
&& contentType.indexOf("xml") >= 0
&& contentType.toLowerCase().indexOf("multipart/related") < 0
&& event.getPayload().length() > 0;
@@ -90,7 +90,7 @@ public class PrettyLoggingFilter implements LogEventSender {
public void setNext(LogEventSender next) {
this.next = next;
}
-
+
public void setPrettyLogging(boolean prettyLogging) {
this.prettyLogging = prettyLogging;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrintWriterEventSender.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrintWriterEventSender.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrintWriterEventSender.java
index b34133d..d618028 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrintWriterEventSender.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/PrintWriterEventSender.java
@@ -25,25 +25,25 @@ import java.time.Instant;
import javax.xml.namespace.QName;
/**
- *
+ *
*/
public class PrintWriterEventSender implements LogEventSender {
PrintWriter writer;
-
+
public PrintWriterEventSender(PrintWriter writer) {
this.writer = writer;
}
-
+
void setPrintWriter(PrintWriter w) {
writer = w;
}
-
-
+
+
/** {@inheritDoc}*/
@Override
public void send(LogEvent event) {
StringBuilder b = new StringBuilder();
-
+
b.append(Instant.now().toString()).append(" - PrintWriterEventSender\n");
put(b, "type", event.getType().toString());
put(b, "address", event.getAddress());
@@ -68,7 +68,7 @@ public class PrintWriterEventSender implements LogEventSender {
protected String localPart(QName name) {
return name == null ? null : name.getLocalPart();
}
-
+
protected void put(StringBuilder b, String key, String value) {
if (value != null) {
b.append(" ").append(key).append(": ").append(value).append("\n");
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
index 815f7b9..7bc1faa 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/osgi/Activator.java
@@ -48,7 +48,7 @@ public class Activator implements BundleActivator {
public void stop(BundleContext context) throws Exception {
}
-
+
private static final class ConfigUpdater implements ManagedService {
private BundleContext bundleContext;
private ServiceRegistration serviceReg;
@@ -84,7 +84,7 @@ public class Activator implements BundleActivator {
properties.put("org.apache.cxf.dosgi.IntentName", "logging");
bundleContext.registerService(AbstractFeature.class.getName(), logging, properties);
}
-
+
if (enabled) {
if (serviceReg == null) {
Dictionary<String, Object> properties = new Hashtable<>();
@@ -98,7 +98,7 @@ public class Activator implements BundleActivator {
}
}
}
-
+
@SuppressWarnings("rawtypes")
private String getValue(Dictionary config, String key, String defaultValue) {
if (config == null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
index 4515c1a..57795a2 100644
--- a/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
+++ b/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/slf4j/Slf4jEventSender.java
@@ -45,7 +45,7 @@ public class Slf4jEventSender implements LogEventSender {
String cat = logCategory != null ? logCategory
: "org.apache.cxf.services." + event.getPortTypeName().getLocalPart() + "." + event.getType();
Logger log = LoggerFactory.getLogger(cat);
- Set<String> keys = new HashSet<>();
+ Set<String> keys = new HashSet<>();
try {
put(keys, "type", event.getType().toString());
put(keys, "address", event.getAddress());
@@ -68,9 +68,9 @@ public class Slf4jEventSender implements LogEventSender {
MDC.remove(key);
}
}
-
+
}
-
+
private String localPart(QName name) {
return name == null ? null : name.getLocalPart();
}
@@ -78,7 +78,7 @@ public class Slf4jEventSender implements LogEventSender {
private String getLogMessage(LogEvent event) {
return event.getPayload();
}
-
+
private void put(Set<String> keys, String key, String value) {
if (value != null) {
MDC.put(key, value);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/DefaultLogEventMapperTest.java
----------------------------------------------------------------------
diff --git a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/DefaultLogEventMapperTest.java b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/DefaultLogEventMapperTest.java
index 8792e23..eed4de1 100644
--- a/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/DefaultLogEventMapperTest.java
+++ b/rt/features/logging/src/test/java/org/apache/cxf/ext/logging/DefaultLogEventMapperTest.java
@@ -40,7 +40,7 @@ public class DefaultLogEventMapperTest {
LogEvent event = mapper.map(message);
Assert.assertEquals("GET[test]", event.getOperationName());
}
-
+
/**
* Test for NPE described in CXF-6436
*/
@@ -55,6 +55,6 @@ public class DefaultLogEventMapperTest {
LogEvent event = mapper.map(message);
Assert.assertEquals("", event.getOperationName());
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/ExchangeMetrics.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/ExchangeMetrics.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/ExchangeMetrics.java
index 342d921..c8df47c 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/ExchangeMetrics.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/ExchangeMetrics.java
@@ -27,14 +27,14 @@ import org.apache.cxf.metrics.interceptors.CountingInputStream;
import org.apache.cxf.metrics.interceptors.CountingOutputStream;
/**
- *
+ *
*/
public class ExchangeMetrics {
Deque<MetricsContext> contexts = new LinkedList<MetricsContext>();
Exchange exchange;
boolean started;
long startTime = -1;
-
+
public ExchangeMetrics(Exchange e) {
exchange = e;
}
@@ -46,7 +46,7 @@ public class ExchangeMetrics {
}
return this;
}
-
+
public void start() {
started = true;
startTime = System.nanoTime();
@@ -54,7 +54,7 @@ public class ExchangeMetrics {
ctx.start(exchange);
}
}
-
+
public void stop() {
started = false;
if (startTime == -1) {
@@ -75,5 +75,5 @@ public class ExchangeMetrics {
ctx.stop(l, inSize, outSize, exchange);
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsContext.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsContext.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsContext.java
index 2c28b2e..21c461f 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsContext.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsContext.java
@@ -27,17 +27,17 @@ import org.apache.cxf.message.Exchange;
* Class to hold all the various metric pieces for a given context (Endpoint, Customer, Operation, etc...)
*/
public interface MetricsContext {
-
+
/**
* Will be called at the start of invoke (or when added to a started MessageMetrics). This is
- * when the metrics should increment "inFlight" counts and other stats. There is no need to
+ * when the metrics should increment "inFlight" counts and other stats. There is no need to
* record a "start time" as the invoke time will be passed into the stop method.
*/
void start(Exchange m);
-
+
/**
* Called when the invocation is complete.
- *
+ *
* @param timeInNS
* @param inSize
* @param outSize
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsFeature.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsFeature.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsFeature.java
index 45719a9..958644f 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsFeature.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsFeature.java
@@ -42,13 +42,13 @@ import org.apache.cxf.metrics.interceptors.MetricsMessageInPreInvokeInterceptor;
import org.apache.cxf.metrics.interceptors.MetricsMessageOutInterceptor;
/**
- *
+ *
*/
@NoJSR250Annotations
@Provider(Type.Feature)
public class MetricsFeature extends AbstractFeature {
MetricsProvider[] providers;
-
+
public MetricsFeature() {
this.providers = null;
}
@@ -58,7 +58,7 @@ public class MetricsFeature extends AbstractFeature {
public MetricsFeature(MetricsProvider ... providers) {
this.providers = providers.length > 0 ? providers : null;
}
-
+
@Override
public void initialize(Server server, Bus bus) {
createDefaultProvidersIfNeeded(bus);
@@ -66,24 +66,24 @@ public class MetricsFeature extends AbstractFeature {
Endpoint provider = server.getEndpoint();
MetricsMessageOutInterceptor out = new MetricsMessageOutInterceptor(providers);
CountingOutInterceptor countingOut = new CountingOutInterceptor();
-
+
provider.getInInterceptors().add(new MetricsMessageInInterceptor(providers));
provider.getInInterceptors().add(new MetricsMessageInOneWayInterceptor(providers));
provider.getInInterceptors().add(new MetricsMessageInPreInvokeInterceptor(providers));
-
+
provider.getOutInterceptors().add(countingOut);
provider.getOutInterceptors().add(out);
provider.getOutFaultInterceptors().add(countingOut);
provider.getOutFaultInterceptors().add(out);
}
-
+
@Override
public void initialize(Client client, Bus bus) {
createDefaultProvidersIfNeeded(bus);
//can optimize for client case and just put interceptors it needs
MetricsMessageOutInterceptor out = new MetricsMessageOutInterceptor(providers);
CountingOutInterceptor countingOut = new CountingOutInterceptor();
-
+
client.getInInterceptors().add(new MetricsMessageInInterceptor(providers));
client.getInInterceptors().add(new MetricsMessageInPostInvokeInterceptor(providers));
client.getInFaultInterceptors().add(new MetricsMessageInPostInvokeInterceptor(providers));
@@ -91,22 +91,22 @@ public class MetricsFeature extends AbstractFeature {
client.getOutInterceptors().add(out);
client.getOutInterceptors().add(new MetricsMessageClientOutInterceptor(providers));
}
-
-
+
+
@Override
protected void initializeProvider(InterceptorProvider provider, Bus bus) {
createDefaultProvidersIfNeeded(bus);
//if feature is added to the bus, we need to add all the interceptors
MetricsMessageOutInterceptor out = new MetricsMessageOutInterceptor(providers);
CountingOutInterceptor countingOut = new CountingOutInterceptor();
-
+
provider.getInInterceptors().add(new MetricsMessageInInterceptor(providers));
provider.getInInterceptors().add(new MetricsMessageInOneWayInterceptor(providers));
provider.getInInterceptors().add(new MetricsMessageInPreInvokeInterceptor(providers));
provider.getInInterceptors().add(new MetricsMessageInPostInvokeInterceptor(providers));
provider.getInFaultInterceptors().add(new MetricsMessageInPreInvokeInterceptor(providers));
provider.getInFaultInterceptors().add(new MetricsMessageInPostInvokeInterceptor(providers));
-
+
provider.getOutInterceptors().add(countingOut);
provider.getOutInterceptors().add(out);
provider.getOutInterceptors().add(new MetricsMessageClientOutInterceptor(providers));
@@ -125,7 +125,7 @@ public class MetricsFeature extends AbstractFeature {
}
if (providers == null) {
try {
- Class<?> cls = ClassLoaderUtils.loadClass("org.apache.cxf.metrics.codahale.CodahaleMetricsProvider",
+ Class<?> cls = ClassLoaderUtils.loadClass("org.apache.cxf.metrics.codahale.CodahaleMetricsProvider",
MetricsFeature.class);
Constructor<?> c = cls.getConstructor(Bus.class);
providers = new MetricsProvider[] {(MetricsProvider)c.newInstance(bus)};
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsProvider.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsProvider.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsProvider.java
index 0184723..6eb076f 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsProvider.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/MetricsProvider.java
@@ -23,7 +23,7 @@ import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.service.model.BindingOperationInfo;
/**
- *
+ *
*/
public interface MetricsProvider {
String CLIENT_ID = "MetricsProvider.CLIENT_ID";
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
index 27dbc80..ccce93b 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsContext.java
@@ -33,7 +33,7 @@ import org.apache.cxf.message.FaultMode;
import org.apache.cxf.metrics.MetricsContext;
/**
- *
+ *
*/
public class CodahaleMetricsContext implements MetricsContext, Closeable {
protected Counter inFlight;
@@ -44,15 +44,15 @@ public class CodahaleMetricsContext implements MetricsContext, Closeable {
protected Timer logicalRuntimeFaults;
protected Meter incomingData;
protected Meter outgoingData;
-
+
protected final String baseName;
protected final MetricRegistry registry;
-
+
public CodahaleMetricsContext(String prefix, MetricRegistry registry) {
baseName = prefix;
this.registry = registry;
totals = registry.timer(baseName + "Attribute=Totals");
- uncheckedApplicationFaults = registry.timer(baseName
+ uncheckedApplicationFaults = registry.timer(baseName
+ "Attribute=Unchecked Application Faults");
checkedApplicationFaults = registry.timer(baseName + "Attribute=Checked Application Faults");
runtimeFaults = registry.timer(baseName + "Attribute=Runtime Faults");
@@ -74,11 +74,11 @@ public class CodahaleMetricsContext implements MetricsContext, Closeable {
registry.remove(baseName + "Attribute=Data Written");
}
-
+
public void start(Exchange ex) {
inFlight.inc();
}
-
+
public void stop(long timeInNS, long inSize, long outSize, Exchange ex) {
totals.update(timeInNS, TimeUnit.NANOSECONDS);
@@ -89,7 +89,7 @@ public class CodahaleMetricsContext implements MetricsContext, Closeable {
outgoingData.mark(outSize);
}
FaultMode fm = ex.get(FaultMode.class);
- if (fm == null && ex.getOutFaultMessage() != null) {
+ if (fm == null && ex.getOutFaultMessage() != null) {
fm = ex.getOutFaultMessage().get(FaultMode.class);
}
if (fm == null && ex.getInMessage() != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsProvider.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsProvider.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsProvider.java
index 3858032..fd5187f 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsProvider.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/codahale/CodahaleMetricsProvider.java
@@ -37,18 +37,18 @@ import org.apache.cxf.service.Service;
import org.apache.cxf.service.model.BindingOperationInfo;
/**
- *
+ *
*/
@NoJSR250Annotations
-public class CodahaleMetricsProvider implements MetricsProvider {
+public class CodahaleMetricsProvider implements MetricsProvider {
private static final String QUESTION_MARK = "?";
private static final String ESCAPED_QUESTION_MARK = "\\?";
protected Bus bus;
protected MetricRegistry registry;
-
+
/**
- *
+ *
*/
public CodahaleMetricsProvider(Bus b) {
this.bus = b;
@@ -60,7 +60,7 @@ public class CodahaleMetricsProvider implements MetricsProvider {
}
}
-
+
public static void setupJMXReporter(Bus b, MetricRegistry reg) {
InstrumentationManager im = b.getExtension(InstrumentationManager.class);
if (im != null) {
@@ -114,8 +114,8 @@ public class CodahaleMetricsProvider implements MetricsProvider {
}
return buffer;
}
-
-
+
+
/** {@inheritDoc}*/
@Override
public MetricsContext createEndpointContext(final Endpoint endpoint, boolean isClient, String clientId) {
@@ -135,7 +135,7 @@ public class CodahaleMetricsProvider implements MetricsProvider {
/** {@inheritDoc}*/
@Override
- public MetricsContext createResourceContext(Endpoint endpoint, String resourceName,
+ public MetricsContext createResourceContext(Endpoint endpoint, String resourceName,
boolean asClient, String clientId) {
StringBuilder buffer = getBaseServiceName(endpoint, asClient, clientId);
buffer.append("Operation=").append(resourceName).append(',');
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/AbstractMetricsInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/AbstractMetricsInterceptor.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/AbstractMetricsInterceptor.java
index ec10739..5b08747 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/AbstractMetricsInterceptor.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/AbstractMetricsInterceptor.java
@@ -49,7 +49,7 @@ public abstract class AbstractMetricsInterceptor extends AbstractPhaseIntercepto
super(phase);
providers = p;
}
-
+
protected Collection<? extends MetricsProvider> getMetricProviders(Bus bus) {
if (providers != null) {
return Arrays.asList(providers);
@@ -60,13 +60,13 @@ public abstract class AbstractMetricsInterceptor extends AbstractPhaseIntercepto
}
return b.getBeansOfType(MetricsProvider.class);
}
-
+
protected ExchangeMetrics getExchangeMetrics(Message m, boolean create) {
ExchangeMetrics ctx = m.getExchange().get(ExchangeMetrics.class);
if (ctx == null && create) {
ctx = new ExchangeMetrics(m.getExchange());
m.getExchange().put(ExchangeMetrics.class, ctx);
-
+
addEndpointMetrics(ctx, m);
}
return ctx;
@@ -157,7 +157,7 @@ public abstract class AbstractMetricsInterceptor extends AbstractPhaseIntercepto
ctx.addContext((MetricsContext)metrics);
}
}
-
+
private synchronized Object createMetricsContextForRestResource(Message message, String resource) {
Map<String, Object> restMap = getRestMetricsMap(message.getExchange().getEndpoint());
Object o = restMap.get(resource);
@@ -208,7 +208,7 @@ public abstract class AbstractMetricsInterceptor extends AbstractPhaseIntercepto
}
return o;
}
-
+
public void stop(Message m) {
ExchangeMetrics ctx = getExchangeMetrics(m, false);
if (ctx != null) {
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutInterceptor.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutInterceptor.java
index ce103ca..0986e06 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutInterceptor.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutInterceptor.java
@@ -38,5 +38,5 @@ public class CountingOutInterceptor extends AbstractPhaseInterceptor<Message> {
message.setContent(OutputStream.class, newOut);
message.getExchange().put(CountingOutputStream.class, newOut);
}
- }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutputStream.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutputStream.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutputStream.java
index 5247e21..673a503 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutputStream.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/CountingOutputStream.java
@@ -28,7 +28,7 @@ public final class CountingOutputStream extends FilterOutputStream {
public CountingOutputStream(OutputStream out) {
super(out);
}
-
+
public long getCount() {
return count;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInOneWayInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInOneWayInterceptor.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInOneWayInterceptor.java
index 1ded851..59a8977 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInOneWayInterceptor.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInOneWayInterceptor.java
@@ -36,5 +36,5 @@ public class MetricsMessageInOneWayInterceptor extends AbstractMetricsIntercepto
if (ex.isOneWay() && !isRequestor(message)) {
stop(message);
}
- }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPostInvokeInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPostInvokeInterceptor.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPostInvokeInterceptor.java
index f1b5027..ce73338 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPostInvokeInterceptor.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPostInvokeInterceptor.java
@@ -33,5 +33,5 @@ public class MetricsMessageInPostInvokeInterceptor extends AbstractMetricsInterc
if (isRequestor(message)) {
stop(message);
}
- }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPreInvokeInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPreInvokeInterceptor.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPreInvokeInterceptor.java
index cdb92d8..2b1d3c7 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPreInvokeInterceptor.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageInPreInvokeInterceptor.java
@@ -40,5 +40,5 @@ public class MetricsMessageInPreInvokeInterceptor extends AbstractMetricsInterce
addOperationMetrics(ctx, message, ex.getBindingOperationInfo());
}
}
- }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageOutInterceptor.java b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageOutInterceptor.java
index 78dd8de..3aede6a 100644
--- a/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageOutInterceptor.java
+++ b/rt/features/metrics/src/main/java/org/apache/cxf/metrics/interceptors/MetricsMessageOutInterceptor.java
@@ -36,5 +36,5 @@ public class MetricsMessageOutInterceptor extends AbstractMetricsInterceptor {
//one way on the client, it's sent, now stop
stop(message);
}
- }
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/throttling/src/main/java/org/apache/cxf/throttling/SimpleThrottlingManager.java
----------------------------------------------------------------------
diff --git a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/SimpleThrottlingManager.java b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/SimpleThrottlingManager.java
index 7c5ec84..39f580a 100644
--- a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/SimpleThrottlingManager.java
+++ b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/SimpleThrottlingManager.java
@@ -29,10 +29,10 @@ import org.apache.cxf.phase.Phase;
*/
public class SimpleThrottlingManager extends ThrottleResponse implements ThrottlingManager {
private static final String THROTTLED_KEY = "THROTTLED";
-
+
private int threshold;
private ThrottlingCounter counter = new ThrottlingCounter();
-
+
@Override
public List<String> getDecisionPhases() {
return Collections.singletonList(Phase.PRE_STREAM);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottleResponse.java
----------------------------------------------------------------------
diff --git a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottleResponse.java b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottleResponse.java
index af0bcbd..a0cd975 100644
--- a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottleResponse.java
+++ b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottleResponse.java
@@ -23,22 +23,22 @@ import java.util.HashMap;
import java.util.Map;
/**
- *
+ *
*/
public class ThrottleResponse {
protected long delay;
protected Map<String, String> responseHeaders = new HashMap<>();
protected int responseCode = -1;
protected String errorMessage;
-
+
public ThrottleResponse() {
-
+
}
-
+
public ThrottleResponse(int responceCode) {
this.responseCode = responceCode;
}
-
+
public ThrottleResponse(int responceCode, long delay) {
this(responceCode);
this.delay = delay;
@@ -73,7 +73,7 @@ public class ThrottleResponse {
}
/**
- * Delay processing for specified milliseconds.
+ * Delay processing for specified milliseconds.
* Should be "small" to prevent the client from timing out unless the client request is
* aborted with the HTTP error code.
* @return
@@ -85,5 +85,5 @@ public class ThrottleResponse {
public ThrottleResponse setDelay(long d) {
this.delay = d;
return this;
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingFeature.java
----------------------------------------------------------------------
diff --git a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingFeature.java b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingFeature.java
index 4276564..f171b94 100644
--- a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingFeature.java
+++ b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingFeature.java
@@ -24,11 +24,11 @@ import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.interceptor.InterceptorProvider;
/**
- *
+ *
*/
public class ThrottlingFeature extends AbstractFeature {
final ThrottlingManager manager;
-
+
public ThrottlingFeature() {
manager = null;
}
@@ -36,7 +36,7 @@ public class ThrottlingFeature extends AbstractFeature {
public ThrottlingFeature(ThrottlingManager manager) {
this.manager = manager;
}
-
+
@Override
protected void initializeProvider(InterceptorProvider provider, Bus bus) {
ThrottlingManager m = manager;
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingInterceptor.java b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingInterceptor.java
index a6cf392..90c2b6f 100644
--- a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingInterceptor.java
+++ b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingInterceptor.java
@@ -31,11 +31,11 @@ import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
/**
- *
+ *
*/
public class ThrottlingInterceptor extends AbstractPhaseInterceptor<Message> {
- public static final Logger LOG = LogUtils.getL7dLogger(ThrottlingInterceptor.class);
-
+ public static final Logger LOG = LogUtils.getL7dLogger(ThrottlingInterceptor.class);
+
final ThrottlingManager manager;
public ThrottlingInterceptor(String phase, ThrottlingManager manager) {
super(ThrottlingInterceptor.class.getName() + "-" + phase, phase);
@@ -55,7 +55,7 @@ public class ThrottlingInterceptor extends AbstractPhaseInterceptor<Message> {
OutgoingChainInterceptor.class.getName());
return;
}
-
+
long l = rsp.getDelay();
if (l > 0) {
ContinuationProvider cp = message.get(ContinuationProvider.class);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingManager.java
----------------------------------------------------------------------
diff --git a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingManager.java b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingManager.java
index 86094a9..d0a8695 100644
--- a/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingManager.java
+++ b/rt/features/throttling/src/main/java/org/apache/cxf/throttling/ThrottlingManager.java
@@ -24,18 +24,18 @@ import java.util.List;
import org.apache.cxf.message.Message;
/**
- *
+ *
*/
public interface ThrottlingManager {
-
+
/**
* Get the list of phases where this manager will expect to have to make throttling decisions.
- * For example: using BasicAuth or other protocol based header, it can be a very early in the
- * chain, but for WS-Security based authentication, it would be later.
+ * For example: using BasicAuth or other protocol based header, it can be a very early in the
+ * chain, but for WS-Security based authentication, it would be later.
* @return
*/
List<String> getDecisionPhases();
-
+
/**
* Use information in the message to determine what throttling measures should be taken
* @param phase