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:45 UTC
[40/51] [partial] cxf git commit: Remove all trailing whitespaces
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java b/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
index 9b25298..a81bdfb 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/LoggingMessage.java
@@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
public final class LoggingMessage {
public static final String ID_KEY = LoggingMessage.class.getName() + ".ID";
private static final AtomicInteger ID = new AtomicInteger();
-
+
private final String heading;
private final StringBuilder address;
private final StringBuilder contentType;
@@ -34,7 +34,7 @@ public final class LoggingMessage {
private final StringBuilder payload;
private final StringBuilder responseCode;
private final String id;
-
+
public LoggingMessage(String h, String i) {
heading = h;
@@ -49,16 +49,16 @@ public final class LoggingMessage {
payload = new StringBuilder();
responseCode = new StringBuilder();
}
-
+
public String getId() {
return id;
}
-
+
public static String nextId() {
return Integer.toString(ID.incrementAndGet());
}
-
-
+
+
public StringBuilder getAddress() {
return address;
}
@@ -70,7 +70,7 @@ public final class LoggingMessage {
public StringBuilder getHeader() {
return header;
}
-
+
public StringBuilder getHttpMethod() {
return httpMethod;
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
index 043aa37..fb31ea0 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java
@@ -43,14 +43,14 @@ import org.apache.cxf.phase.Phase;
public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
private static final Logger LOG = LogUtils.getLogger(LoggingOutInterceptor.class);
private static final String LOG_SETUP = LoggingOutInterceptor.class.getName() + ".log-setup";
-
+
public LoggingOutInterceptor(String phase) {
super(phase);
addBefore(StaxOutInterceptor.class.getName());
}
public LoggingOutInterceptor() {
this(Phase.PRE_STREAM);
- }
+ }
public LoggingOutInterceptor(int lim) {
this();
limit = lim;
@@ -60,7 +60,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
this();
this.writer = w;
}
-
+
public void handleMessage(Message message) throws Fault {
final OutputStream os = message.getContent(OutputStream.class);
@@ -90,26 +90,26 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
}
}
}
-
+
private LoggingMessage setupBuffer(Message message) {
String id = (String)message.getExchange().get(LoggingMessage.ID_KEY);
if (id == null) {
id = LoggingMessage.nextId();
message.getExchange().put(LoggingMessage.ID_KEY, id);
}
- final LoggingMessage buffer
+ final LoggingMessage buffer
= new LoggingMessage("Outbound Message\n---------------------------",
id);
-
+
Integer responseCode = (Integer)message.get(Message.RESPONSE_CODE);
if (responseCode != null) {
buffer.getResponseCode().append(responseCode);
}
-
+
String encoding = (String)message.get(Message.ENCODING);
if (encoding != null) {
buffer.getEncoding().append(encoding);
- }
+ }
String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);
if (httpMethod != null) {
buffer.getHttpMethod().append(httpMethod);
@@ -135,14 +135,14 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
}
return buffer;
}
-
+
private class LogWriter extends FilterWriter {
StringWriter out2;
int count;
Logger logger; //NOPMD
Message message;
final int lim;
-
+
LogWriter(Logger logger, Message message, Writer writer) {
super(writer);
this.logger = logger;
@@ -184,7 +184,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
}
String ct = (String)message.get(Message.CONTENT_TYPE);
try {
- writePayload(buffer.getPayload(), w2, ct);
+ writePayload(buffer.getPayload(), w2, ct);
} catch (Exception ex) {
//ignore
}
@@ -199,12 +199,12 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
}
class LoggingCallback implements CachedOutputStreamCallback {
-
+
private final Message message;
private final OutputStream origStream;
private final Logger logger; //NOPMD
private final int lim;
-
+
LoggingCallback(final Logger logger, final Message msg, final OutputStream os) {
this.logger = logger;
this.message = msg;
@@ -212,10 +212,10 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
this.lim = limit == -1 ? Integer.MAX_VALUE : limit;
}
- public void onFlush(CachedOutputStream cos) {
-
+ public void onFlush(CachedOutputStream cos) {
+
}
-
+
public void onClose(CachedOutputStream cos) {
LoggingMessage buffer = setupBuffer(message);
@@ -230,7 +230,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
log(logger, formatLoggingMessage(buffer));
return;
}
-
+
if (cos.getTempFile() == null) {
//buffer.append("Outbound Message:\n");
if (cos.size() >= lim) {
@@ -245,7 +245,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
}
try {
String encoding = (String)message.get(Message.ENCODING);
- writePayload(buffer.getPayload(), cos, encoding, ct);
+ writePayload(buffer.getPayload(), cos, encoding, ct);
} catch (Exception ex) {
//ignore
}
@@ -265,7 +265,7 @@ public class LoggingOutInterceptor extends AbstractLoggingInterceptor {
@Override
protected Logger getLogger() {
return LOG;
-
+
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
index e7278ea..d2558cd 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/MessageSenderInterceptor.java
@@ -35,8 +35,8 @@ import org.apache.cxf.transport.Conduit;
public class MessageSenderInterceptor extends AbstractPhaseInterceptor<Message> {
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(MessageSenderInterceptor.class);
private MessageSenderEndingInterceptor ending = new MessageSenderEndingInterceptor();
-
-
+
+
public MessageSenderInterceptor() {
super(Phase.PREPARE_SEND);
}
@@ -46,12 +46,12 @@ public class MessageSenderInterceptor extends AbstractPhaseInterceptor<Message>
getConduit(message).prepare(message);
} catch (IOException ex) {
throw new Fault(new org.apache.cxf.common.i18n.Message("COULD_NOT_SEND", BUNDLE), ex);
- }
-
+ }
+
// Add a final interceptor to close the conduit
message.getInterceptorChain().add(ending);
}
-
+
public static class MessageSenderEndingInterceptor extends AbstractPhaseInterceptor<Message> {
public MessageSenderEndingInterceptor() {
super(Phase.PREPARE_SEND_ENDING);
@@ -65,7 +65,7 @@ public class MessageSenderInterceptor extends AbstractPhaseInterceptor<Message>
}
}
}
-
+
public static Conduit getConduit(Message message) {
Exchange exchange = message.getExchange();
Conduit conduit = exchange.getConduit(message);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
index 1ae2e94..7764f94 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/OneWayProcessorInterceptor.java
@@ -39,13 +39,13 @@ import org.apache.cxf.workqueue.WorkQueueManager;
/**
- *
+ *
*/
public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message> {
- public static final String USE_ORIGINAL_THREAD
- = OneWayProcessorInterceptor.class.getName() + ".USE_ORIGINAL_THREAD";
+ public static final String USE_ORIGINAL_THREAD
+ = OneWayProcessorInterceptor.class.getName() + ".USE_ORIGINAL_THREAD";
private static final Logger LOG = LogUtils.getL7dLogger(OneWayProcessorInterceptor.class);
-
+
public OneWayProcessorInterceptor() {
super(Phase.PRE_LOGICAL);
}
@@ -53,7 +53,7 @@ public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message
super(phase);
}
public void handleFault(Message message) {
- if (message.getExchange().isOneWay()
+ if (message.getExchange().isOneWay()
&& !isRequestor(message)) {
//in a one way, if an exception is thrown, the stream needs to be closed
InputStream in = message.getContent(InputStream.class);
@@ -64,37 +64,37 @@ public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message
//ignore
}
}
-
+
}
}
public void handleMessage(Message message) throws Fault {
-
- if (message.getExchange().isOneWay()
+
+ if (message.getExchange().isOneWay()
&& !isRequestor(message)
&& message.get(OneWayProcessorInterceptor.class) == null
- && message.getExchange().get(Executor.class) == null) {
+ && message.getExchange().get(Executor.class) == null) {
//one way on server side, fork the rest of this chain onto the
//workqueue, call the Outgoing chain directly.
-
+
message.put(OneWayProcessorInterceptor.class, this);
final InterceptorChain chain = message.getInterceptorChain();
- boolean robust =
+ boolean robust =
MessageUtils.isTrue(message.getContextualProperty(Message.ROBUST_ONEWAY));
- boolean useOriginalThread =
+ boolean useOriginalThread =
MessageUtils.isTrue(message.getContextualProperty(USE_ORIGINAL_THREAD));
-
+
if (!useOriginalThread && !robust) {
//need to suck in all the data from the input stream as
- //the transport might discard any data on the stream when this
+ //the transport might discard any data on the stream when this
//thread unwinds or when the empty response is sent back
DelegatingInputStream in = message.getContent(DelegatingInputStream.class);
if (in != null) {
in.cacheInput();
}
}
-
+
if (robust) {
// continue to invoke the chain
chain.pause();
@@ -104,7 +104,7 @@ public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message
return;
}
}
-
+
try {
Message partial = createMessage(message.getExchange());
partial.remove(Message.CONTENT_TYPE);
@@ -122,7 +122,7 @@ public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message
} catch (IOException e) {
//IGNORE
}
-
+
if (!useOriginalThread && !robust) {
chain.pause();
try {
@@ -138,13 +138,13 @@ public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message
}
});
//wait a few milliseconds for the background thread to start processing
- //Mostly just to make an attempt at keeping the ordering of the
+ //Mostly just to make an attempt at keeping the ordering of the
//messages coming in from a client. Not guaranteed though.
lock.wait(20);
}
} catch (RejectedExecutionException e) {
LOG.warning(
- "Executor queue is full, run the oneway invocation task in caller thread."
+ "Executor queue is full, run the oneway invocation task in caller thread."
+ " Users can specify a larger executor queue to avoid this.");
// only block the thread if the prop is unset or set to false, otherwise let it go
if (!MessageUtils.isTrue(
@@ -153,14 +153,14 @@ public class OneWayProcessorInterceptor extends AbstractPhaseInterceptor<Message
//the executor queue is full, so run the task in the caller thread
chain.unpause();
}
-
+
} catch (InterruptedException e) {
//ignore - likely a busy work queue so we'll just let the one-way go
}
}
}
}
-
+
private static Message createMessage(Exchange exchange) {
Endpoint ep = exchange.getEndpoint();
Message msg = null;
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/OutFaultChainInitiatorObserver.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/OutFaultChainInitiatorObserver.java b/core/src/main/java/org/apache/cxf/interceptor/OutFaultChainInitiatorObserver.java
index 60fadc8..022a356 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/OutFaultChainInitiatorObserver.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/OutFaultChainInitiatorObserver.java
@@ -51,19 +51,19 @@ public class OutFaultChainInitiatorObserver extends AbstractFaultChainInitiatorO
if (e.getService().getDataBinding() instanceof InterceptorProvider) {
chain.add(((InterceptorProvider)e.getService().getDataBinding()).getOutFaultInterceptors());
}
-
+
addToChain(chain, ex.getInMessage());
addToChain(chain, ex.getOutFaultMessage());
}
private void addToChain(PhaseInterceptorChain chain, Message m) {
- Collection<InterceptorProvider> providers
+ Collection<InterceptorProvider> providers
= CastUtils.cast((Collection<?>)m.get(Message.INTERCEPTOR_PROVIDERS));
if (providers != null) {
for (InterceptorProvider p : providers) {
chain.add(p.getOutFaultInterceptors());
}
}
- Collection<Interceptor<? extends Message>> is
+ Collection<Interceptor<? extends Message>> is
= CastUtils.cast((Collection<?>)m.get(Message.FAULT_OUT_INTERCEPTORS));
if (is != null) {
chain.add(is);
@@ -72,7 +72,7 @@ public class OutFaultChainInitiatorObserver extends AbstractFaultChainInitiatorO
chain.add(((InterceptorProvider)m.getDestination()).getOutFaultInterceptors());
}
}
-
+
protected SortedSet<Phase> getPhases() {
return getBus().getExtension(PhaseManager.class).getOutPhases();
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/OutFaultInterceptors.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/OutFaultInterceptors.java b/core/src/main/java/org/apache/cxf/interceptor/OutFaultInterceptors.java
index 408f88a..7e5493a 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/OutFaultInterceptors.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/OutFaultInterceptors.java
@@ -27,16 +27,16 @@ import java.lang.annotation.Target;
import org.apache.cxf.message.Message;
/**
- * Specifies a list of classes that are added to the outbound fault
- * interceptor chain. This annotation effects SEI classes and service
+ * Specifies a list of classes that are added to the outbound fault
+ * interceptor chain. This annotation effects SEI classes and service
* implementation classes.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface OutFaultInterceptors {
-
+
String[] interceptors() default { };
-
+
Class<? extends Interceptor<? extends Message>>[] classes() default { };
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/OutInterceptors.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/OutInterceptors.java b/core/src/main/java/org/apache/cxf/interceptor/OutInterceptors.java
index 63d7310..4885da2 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/OutInterceptors.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/OutInterceptors.java
@@ -28,16 +28,16 @@ import org.apache.cxf.message.Message;
/**
- * Specifies a list of classes that are added to the outbound
- * interceptor chain. This annotation effects SEI classes and service
+ * Specifies a list of classes that are added to the outbound
+ * interceptor chain. This annotation effects SEI classes and service
* implementation classes.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface OutInterceptors {
-
+
String[] interceptors() default { };
-
+
Class<? extends Interceptor<? extends Message>>[] classes() default { };
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
index 2382a25..715291e 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/OutgoingChainInterceptor.java
@@ -49,7 +49,7 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
private static final Logger LOG = LogUtils.getL7dLogger(OutgoingChainInterceptor.class);
private static final String CACHE_INPUT_PROPERTY = "cxf.io.cacheinput";
private PhaseChainCache chainCache = new PhaseChainCache();
-
+
public OutgoingChainInterceptor() {
super(Phase.POST_INVOKE);
}
@@ -58,8 +58,8 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
Exchange ex = message.getExchange();
BindingOperationInfo binding = ex.getBindingOperationInfo();
//if we get this far, we're going to be outputting some valid content, but we COULD
- //also be "echoing" some of the content from the input. Thus, we need to
- //mark it as requiring the input to be cached.
+ //also be "echoing" some of the content from the input. Thus, we need to
+ //mark it as requiring the input to be cached.
if (message.getExchange().get(CACHE_INPUT_PROPERTY) == null) {
message.put(CACHE_INPUT_PROPERTY, Boolean.TRUE);
}
@@ -74,7 +74,7 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
out.put(MessageInfo.class, binding.getOperationInfo().getOutput());
out.put(BindingMessageInfo.class, binding.getOutput());
}
-
+
InterceptorChain outChain = out.getInterceptorChain();
if (outChain == null) {
outChain = OutgoingChainInterceptor.getChain(ex, chainCache);
@@ -84,10 +84,10 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
return;
}
outChain.doIntercept(out);
-
+
}
}
-
+
private void closeInput(Message message) {
InputStream is = message.getContent(InputStream.class);
if (is != null) {
@@ -107,7 +107,7 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
&& ex.getDestination() != null) {
try {
conduit = ex.getDestination().getBackChannel(ex.getInMessage());
- ex.put(ConduitSelector.class,
+ ex.put(ConduitSelector.class,
new PreexistingConduitSelector(conduit, ex.getEndpoint()));
} catch (IOException e) {
// TODO Auto-generated catch block
@@ -116,13 +116,13 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
}
return conduit;
}
-
+
public static InterceptorChain getOutInterceptorChain(Exchange ex) {
Bus bus = ex.getBus();
Binding binding = ex.getBinding();
PhaseManager pm = bus.getExtension(PhaseManager.class);
PhaseInterceptorChain chain = new PhaseInterceptorChain(pm.getOutPhases());
-
+
Endpoint ep = ex.getEndpoint();
List<Interceptor<? extends Message>> il = ep.getOutInterceptors();
if (LOG.isLoggable(Level.FINE)) {
@@ -138,7 +138,7 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Interceptors contributed by bus: " + il);
}
- chain.add(il);
+ chain.add(il);
if (binding != null) {
il = binding.getOutInterceptors();
if (LOG.isLoggable(Level.FINE)) {
@@ -158,14 +158,14 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
if (m == null) {
return;
}
- Collection<InterceptorProvider> providers
+ Collection<InterceptorProvider> providers
= CastUtils.cast((Collection<?>)m.get(Message.INTERCEPTOR_PROVIDERS));
if (providers != null) {
for (InterceptorProvider p : providers) {
chain.add(p.getOutInterceptors());
}
}
- Collection<Interceptor<? extends Message>> is
+ Collection<Interceptor<? extends Message>> is
= CastUtils.cast((Collection<?>)m.get(Message.OUT_INTERCEPTORS));
if (is != null) {
chain.add(is);
@@ -174,13 +174,13 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
chain.add(((InterceptorProvider)m.getDestination()).getOutInterceptors());
}
}
-
+
private static PhaseInterceptorChain getChain(Exchange ex, PhaseChainCache chainCache) {
Bus bus = ex.getBus();
Binding binding = ex.getBinding();
-
+
Endpoint ep = ex.getEndpoint();
-
+
List<Interceptor<? extends Message>> i1 = bus.getOutInterceptors();
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Interceptors contributed by bus: " + i1);
@@ -222,12 +222,12 @@ public class OutgoingChainInterceptor extends AbstractPhaseInterceptor<Message>
chain = chainCache.get(bus.getExtension(PhaseManager.class).getOutPhases(),
i1, i2, i3);
}
-
+
modifyChain(chain, ex);
chain.setFaultObserver(ep.getOutFaultObserver());
return chain;
}
-
-
+
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
index 7057a31..5fee966 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/ServiceInvokerInterceptor.java
@@ -41,7 +41,7 @@ import org.apache.cxf.service.invoker.Invoker;
* the Exchange.
*/
public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message> {
-
+
public ServiceInvokerInterceptor() {
super(Phase.INVOKE);
}
@@ -50,7 +50,7 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
final Exchange exchange = message.getExchange();
final Endpoint endpoint = exchange.getEndpoint();
final Service service = endpoint.getService();
- final Invoker invoker = service.getInvoker();
+ final Invoker invoker = service.getInvoker();
Runnable invocation = new Runnable() {
@@ -59,7 +59,7 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
Object result = invoker.invoke(runableEx, getInvokee(message));
if (!exchange.isOneWay()) {
Endpoint ep = exchange.getEndpoint();
-
+
Message outMessage = runableEx.getOutMessage();
if (outMessage == null) {
outMessage = new MessageImpl();
@@ -77,17 +77,17 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
} else if (result.getClass().isArray()) {
resList = new MessageContentsList((Object[])result);
} else {
- outMessage.setContent(Object.class, result);
+ outMessage.setContent(Object.class, result);
}
if (resList != null) {
outMessage.setContent(List.class, resList);
}
- }
+ }
}
}
};
-
+
Executor executor = getExecutor(endpoint);
Executor executor2 = exchange.get(Executor.class);
if (executor2 == executor || executor == null
@@ -101,9 +101,9 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
// synchronized PhaseInterceptorChain methods the current thread
// needs to release the chain lock and re-acquire it after the
// executor thread is done
-
+
final PhaseInterceptorChain chain = (PhaseInterceptorChain)message.getInterceptorChain();
- final AtomicBoolean contextSwitched = new AtomicBoolean();
+ final AtomicBoolean contextSwitched = new AtomicBoolean();
final FutureTask<Object> o = new FutureTask<Object>(invocation, null) {
@Override
protected void done() {
@@ -114,14 +114,14 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
}
chain.releaseChain();
}
-
+
@Override
public void run() {
if (PhaseInterceptorChain.setCurrentMessage(chain, message)) {
contextSwitched.set(true);
message.put(Message.THREAD_CONTEXT_SWITCHED, true);
}
-
+
synchronized (chain) {
super.run();
}
@@ -146,7 +146,7 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
}
}
}
-
+
private Object getInvokee(Message message) {
Object invokee = message.getContent(List.class);
if (invokee == null) {
@@ -162,12 +162,12 @@ public class ServiceInvokerInterceptor extends AbstractPhaseInterceptor<Message>
private Executor getExecutor(final Endpoint endpoint) {
return endpoint.getService().getExecutor();
}
-
- private void copyJaxwsProperties(Message inMsg, Message outMsg) {
+
+ private void copyJaxwsProperties(Message inMsg, Message outMsg) {
outMsg.put(Message.WSDL_OPERATION, inMsg.get(Message.WSDL_OPERATION));
outMsg.put(Message.WSDL_SERVICE, inMsg.get(Message.WSDL_SERVICE));
outMsg.put(Message.WSDL_INTERFACE, inMsg.get(Message.WSDL_INTERFACE));
outMsg.put(Message.WSDL_PORT, inMsg.get(Message.WSDL_PORT));
outMsg.put(Message.WSDL_DESCRIPTION, inMsg.get(Message.WSDL_DESCRIPTION));
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java
index 87006cf..14818f8 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/StaxInEndingInterceptor.java
@@ -32,9 +32,9 @@ public class StaxInEndingInterceptor extends AbstractPhaseInterceptor<Message> {
//certain usages of CXF may require the Stax stream to remain open (example: streaming the stax stuff
//directly to the client applications). Provide a flag to turn off.
public static final String STAX_IN_NOCLOSE = StaxInEndingInterceptor.class.getName() + ".dontClose";
-
+
public static final StaxInEndingInterceptor INSTANCE = new StaxInEndingInterceptor();
-
+
public StaxInEndingInterceptor() {
super(Phase.PRE_INVOKE);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
index 2893212..8c1e035 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
@@ -47,10 +47,10 @@ import org.apache.cxf.staxutils.StaxUtils;
* Creates an XMLStreamReader from the InputStream on the Message.
*/
public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
-
- private static final Logger LOG = LogUtils.getL7dLogger(StaxInInterceptor.class);
- private static Map<Object, XMLInputFactory> factories = new HashMap<Object, XMLInputFactory>();
+ private static final Logger LOG = LogUtils.getL7dLogger(StaxInInterceptor.class);
+
+ private static Map<Object, XMLInputFactory> factories = new HashMap<Object, XMLInputFactory>();
public StaxInInterceptor() {
super(Phase.POST_STREAM);
@@ -73,8 +73,8 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
}
}
String contentType = (String)message.get(Message.CONTENT_TYPE);
-
- if (contentType != null
+
+ if (contentType != null
&& contentType.contains("text/html")
&& MessageUtils.isRequestor(message)) {
StringBuilder htmlMessage = new StringBuilder(1024);
@@ -108,7 +108,7 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
.getHeader(m, HttpHeaderHelper.TRANSFER_ENCODING);
if ((StringUtils.isEmpty(contentLen) || "0".equals(contentLen.get(0)))
&& StringUtils.isEmpty(contentTE)
- && (StringUtils.isEmpty(transferEncoding)
+ && (StringUtils.isEmpty(transferEncoding)
|| !"chunked".equalsIgnoreCase(transferEncoding.get(0)))) {
return;
}
@@ -133,7 +133,7 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
} else {
xreader = factory.createXMLStreamReader(is, encoding);
}
- }
+ }
}
xreader = StaxUtils.configureReader(xreader, message);
} catch (XMLStreamException e) {
@@ -145,7 +145,7 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
message.getInterceptorChain().add(StaxInEndingInterceptor.INSTANCE);
}
-
+
public static XMLInputFactory getXMLInputFactory(Message m) throws Fault {
Object o = m.getContextualProperty(XMLInputFactory.class.getName());
if (o instanceof XMLInputFactory) {
@@ -164,7 +164,7 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
}
} else {
throw new Fault(
- new org.apache.cxf.common.i18n.Message("INVALID_INPUT_FACTORY",
+ new org.apache.cxf.common.i18n.Message("INVALID_INPUT_FACTORY",
LOG, o));
}
@@ -178,7 +178,7 @@ public class StaxInInterceptor extends AbstractPhaseInterceptor<Message> {
}
}
return xif;
- }
+ }
return null;
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/StaxOutEndingInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/StaxOutEndingInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/StaxOutEndingInterceptor.java
index 889ee86..ed6bfa6 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/StaxOutEndingInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/StaxOutEndingInterceptor.java
@@ -34,10 +34,10 @@ import org.apache.cxf.staxutils.StaxUtils;
public class StaxOutEndingInterceptor extends AbstractPhaseInterceptor<Message> {
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(StaxOutEndingInterceptor.class);
-
+
private String outStreamHolder;
private String writerHolder;
-
+
public StaxOutEndingInterceptor(String outStreamHolder) {
this(outStreamHolder, null);
}
@@ -57,9 +57,9 @@ public class StaxOutEndingInterceptor extends AbstractPhaseInterceptor<Message>
xtw.flush();
} finally {
StaxUtils.close(xtw);
- }
+ }
}
-
+
OutputStream os = (OutputStream)message.get(outStreamHolder);
if (os != null) {
message.setContent(OutputStream.class, os);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
index e90f2b52..a4505bc 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/StaxOutInterceptor.java
@@ -48,13 +48,13 @@ public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
public static final String OUTPUT_STREAM_HOLDER = StaxOutInterceptor.class.getName() + ".outputstream";
public static final String WRITER_HOLDER = StaxOutInterceptor.class.getName() + ".writer";
public static final String FORCE_START_DOCUMENT = "org.apache.cxf.stax.force-start-document";
- public static final StaxOutEndingInterceptor ENDING
+ public static final StaxOutEndingInterceptor ENDING
= new StaxOutEndingInterceptor(OUTPUT_STREAM_HOLDER, WRITER_HOLDER);
-
+
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(StaxOutInterceptor.class);
private static Map<Object, XMLOutputFactory> factories = new HashMap<Object, XMLOutputFactory>();
-
+
public StaxOutInterceptor() {
super(Phase.PRE_STREAM);
addAfter(AttachmentOutInterceptor.class.getName());
@@ -73,7 +73,7 @@ public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
}
String encoding = getEncoding(message);
-
+
try {
XMLOutputFactory factory = getXMLOutputFactory(message);
if (factory == null) {
@@ -108,7 +108,7 @@ public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
// Add a final interceptor to write end elements
message.getInterceptorChain().add(ENDING);
}
-
+
private OutputStream setupOutputStream(OutputStream os) {
if (!(os instanceof AbstractWrappedOutputStream)) {
os = new AbstractWrappedOutputStream(os) { };
@@ -137,7 +137,7 @@ public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
encoding = (String) ex.getInMessage().get(Message.ENCODING);
message.put(Message.ENCODING, encoding);
}
-
+
if (encoding == null) {
encoding = StandardCharsets.UTF_8.name();
message.put(Message.ENCODING, encoding);
@@ -165,7 +165,7 @@ public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
throw new Fault(e);
}
} else {
- throw new Fault(new org.apache.cxf.common.i18n.Message("INVALID_INPUT_FACTORY",
+ throw new Fault(new org.apache.cxf.common.i18n.Message("INVALID_INPUT_FACTORY",
BUNDLE, o));
}
@@ -185,5 +185,5 @@ public class StaxOutInterceptor extends AbstractPhaseInterceptor<Message> {
}
return null;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java
index e1b323e..7528763 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractAuthorizingInInterceptor.java
@@ -38,7 +38,7 @@ public abstract class AbstractAuthorizingInInterceptor extends AbstractPhaseInte
private static final Logger LOG = LogUtils.getL7dLogger(AbstractAuthorizingInInterceptor.class);
private static final String ALL_ROLES = "*";
private boolean allowAnonymousUsers = true;
-
+
public AbstractAuthorizingInInterceptor() {
this(true);
}
@@ -55,18 +55,18 @@ public abstract class AbstractAuthorizingInInterceptor extends AbstractPhaseInte
} else if (!isMethodProtected(method) && isAllowAnonymousUsers()) {
return;
}
-
-
+
+
throw new AccessDeniedException("Unauthorized");
}
-
+
protected Method getTargetMethod(Message m) {
BindingOperationInfo bop = m.getExchange().getBindingOperationInfo();
if (bop != null) {
- MethodDispatcher md = (MethodDispatcher)
+ MethodDispatcher md = (MethodDispatcher)
m.getExchange().getService().get(MethodDispatcher.class.getName());
return md.getMethod(bop);
- }
+ }
Method method = (Method)m.get("org.apache.cxf.resource.method");
if (method != null) {
return method;
@@ -77,12 +77,12 @@ public abstract class AbstractAuthorizingInInterceptor extends AbstractPhaseInte
protected boolean authorize(SecurityContext sc, Method method) {
List<String> expectedRoles = getExpectedRoles(method);
if (expectedRoles.isEmpty()) {
-
+
List<String> denyRoles = getDenyRoles(method);
-
+
return denyRoles.isEmpty() ? true : isUserInRole(sc, denyRoles, true);
}
-
+
if (isUserInRole(sc, expectedRoles, false)) {
return true;
}
@@ -94,13 +94,13 @@ public abstract class AbstractAuthorizingInInterceptor extends AbstractPhaseInte
protected boolean isMethodProtected(Method method) {
return !getExpectedRoles(method).isEmpty() || !getDenyRoles(method).isEmpty();
}
-
+
protected boolean isUserInRole(SecurityContext sc, List<String> roles, boolean deny) {
-
+
if (roles.size() == 1 && ALL_ROLES.equals(roles.get(0))) {
return !deny;
}
-
+
for (String role : roles) {
if (sc.isUserInRole(role)) {
return !deny;
@@ -108,17 +108,17 @@ public abstract class AbstractAuthorizingInInterceptor extends AbstractPhaseInte
}
return deny;
}
-
+
/**
- * Returns a list of expected roles for a given method.
+ * Returns a list of expected roles for a given method.
* @param method Method
* @return list, empty if no roles are available
*/
protected abstract List<String> getExpectedRoles(Method method);
-
-
+
+
/**
- * Returns a list of roles to be denied for a given method.
+ * Returns a list of roles to be denied for a given method.
* @param method Method
* @return list, empty if no roles are available
*/
@@ -133,5 +133,5 @@ public abstract class AbstractAuthorizingInInterceptor extends AbstractPhaseInte
public void setAllowAnonymousUsers(boolean allowAnonymousUsers) {
this.allowAnonymousUsers = allowAnonymousUsers;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
index 4dbc474..76fd924 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractSecurityContextInInterceptor.java
@@ -34,40 +34,40 @@ import org.apache.cxf.security.SecurityContext;
public abstract class AbstractSecurityContextInInterceptor extends AbstractPhaseInterceptor<Message> {
- private static final Logger LOG =
+ private static final Logger LOG =
LogUtils.getL7dLogger(AbstractSecurityContextInInterceptor.class);
-
+
public AbstractSecurityContextInInterceptor() {
super(Phase.PRE_INVOKE);
}
-
+
public void handleMessage(Message message) throws Fault {
SecurityToken token = message.get(SecurityToken.class);
if (token == null) {
reportSecurityException("Security Token is not available on the current message");
}
-
+
SecurityContext context = message.get(SecurityContext.class);
if (context == null || context.getUserPrincipal() == null) {
reportSecurityException("User Principal is not available on the current message");
}
-
+
Subject subject = null;
try {
subject = createSubject(token);
} catch (Exception ex) {
- reportSecurityException("Failed Authentication : Subject has not been created, "
- + ex.getMessage());
+ reportSecurityException("Failed Authentication : Subject has not been created, "
+ + ex.getMessage());
}
if (subject == null || subject.getPrincipals().size() == 0) {
reportSecurityException("Failed Authentication : Invalid Subject");
}
-
- Principal principal = getPrincipal(context.getUserPrincipal(), subject);
+
+ Principal principal = getPrincipal(context.getUserPrincipal(), subject);
SecurityContext sc = createSecurityContext(principal, subject);
message.put(SecurityContext.class, sc);
}
-
+
protected Principal getPrincipal(Principal originalPrincipal, Subject subject) {
Principal[] ps = subject.getPrincipals().toArray(new Principal[subject.getPrincipals().size()]);
if (ps != null && ps.length > 0 && !(ps[0] instanceof Group)) {
@@ -76,13 +76,13 @@ public abstract class AbstractSecurityContextInInterceptor extends AbstractPhase
return originalPrincipal;
}
}
-
+
protected SecurityContext createSecurityContext(Principal p, Subject subject) {
return new DefaultSecurityContext(p, subject);
}
-
+
protected abstract Subject createSubject(SecurityToken token);
-
+
protected void reportSecurityException(String errorMessage) {
LOG.severe(errorMessage);
throw new SecurityException(errorMessage);
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/AbstractUsernameTokenInInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractUsernameTokenInInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractUsernameTokenInInterceptor.java
index 1c30cc0..e908579 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/AbstractUsernameTokenInInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/AbstractUsernameTokenInInterceptor.java
@@ -25,7 +25,7 @@ import org.apache.cxf.common.security.TokenType;
import org.apache.cxf.common.security.UsernameToken;
public abstract class AbstractUsernameTokenInInterceptor extends AbstractSecurityContextInInterceptor {
-
+
protected Subject createSubject(SecurityToken token) {
if (token.getTokenType() != TokenType.UsernameToken) {
reportSecurityException("Unsupported token type " + token.getTokenType().toString());
@@ -33,8 +33,8 @@ public abstract class AbstractUsernameTokenInInterceptor extends AbstractSecurit
UsernameToken ut = (UsernameToken)token;
return createSubject(ut);
}
-
+
protected abstract Subject createSubject(UsernameToken token);
-
-
+
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java b/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
index 809344a..b6a9d17 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/AuthenticationException.java
@@ -23,7 +23,7 @@ public class AuthenticationException extends SecurityException {
public AuthenticationException() {
}
-
+
public AuthenticationException(String reason) {
super(reason);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/DefaultSecurityContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/DefaultSecurityContext.java b/core/src/main/java/org/apache/cxf/interceptor/security/DefaultSecurityContext.java
index 1a3b3ad..225298e 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/DefaultSecurityContext.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/DefaultSecurityContext.java
@@ -32,24 +32,24 @@ import org.apache.cxf.security.LoginSecurityContext;
* SecurityContext which implements isUserInRole using the
* following approach : skip the first Subject principal, and then checks
* Groups the principal is a member of
- *
+ *
* TODO : consider moving this class into a rt-core-security module
*/
public class DefaultSecurityContext implements LoginSecurityContext {
private Principal p;
- private Subject subject;
-
+ private Subject subject;
+
public DefaultSecurityContext(Subject subject) {
this.p = findPrincipal(null, subject);
this.subject = subject;
}
-
+
public DefaultSecurityContext(String principalName, Subject subject) {
this.p = findPrincipal(principalName, subject);
this.subject = subject;
}
-
+
public DefaultSecurityContext(Principal p, Subject subject) {
this.p = p;
this.subject = subject;
@@ -57,35 +57,35 @@ public class DefaultSecurityContext implements LoginSecurityContext {
this.p = findPrincipal(null, subject);
}
}
-
+
private static Principal findPrincipal(String principalName, Subject subject) {
if (subject == null) {
return null;
}
-
+
for (Principal principal : subject.getPrincipals()) {
- if (!(principal instanceof Group)
+ if (!(principal instanceof Group)
&& (principalName == null || principal.getName().equals(principalName))) {
return principal;
}
}
-
+
// No match for the principalName. Just return first non-Group Principal
if (principalName != null) {
for (Principal principal : subject.getPrincipals()) {
- if (!(principal instanceof Group)) {
+ if (!(principal instanceof Group)) {
return principal;
}
}
}
-
+
return null;
}
-
+
public Principal getUserPrincipal() {
return p;
}
-
+
public boolean isUserInRole(String role) {
if (subject != null) {
for (Principal principal : subject.getPrincipals()) {
@@ -104,19 +104,19 @@ public class DefaultSecurityContext implements LoginSecurityContext {
if (group.getName().equals(role)) {
return true;
}
-
+
for (Enumeration<? extends Principal> members = group.members(); members.hasMoreElements();) {
// this might be a plain role but could represent a group consisting of other groups/roles
Principal member = members.nextElement();
- if (member.getName().equals(role)
+ if (member.getName().equals(role)
|| member instanceof Group && checkGroup((Group)member, role)) {
return true;
}
}
- return false;
+ return false;
}
-
+
public Subject getSubject() {
return subject;
}
@@ -125,7 +125,7 @@ public class DefaultSecurityContext implements LoginSecurityContext {
Set<Principal> roles = new HashSet<>();
if (subject != null) {
for (Principal principal : subject.getPrincipals()) {
- if (principal != p) {
+ if (principal != p) {
roles.add(principal);
}
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/DelegatingAuthenticationInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/DelegatingAuthenticationInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/DelegatingAuthenticationInterceptor.java
index 3a9b5ae..fe42b1f 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/DelegatingAuthenticationInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/DelegatingAuthenticationInterceptor.java
@@ -29,33 +29,33 @@ import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
public class DelegatingAuthenticationInterceptor extends AbstractPhaseInterceptor<Message> {
-
+
private static final String AUTHORIZATION_HEADER = "Authorization";
-
- private Map<String, Interceptor<Message>> authenticationHandlers = Collections.emptyMap();
-
+
+ private Map<String, Interceptor<Message>> authenticationHandlers = Collections.emptyMap();
+
public DelegatingAuthenticationInterceptor() {
super(Phase.UNMARSHAL);
}
-
+
public DelegatingAuthenticationInterceptor(String phase) {
super(phase);
}
-
+
public void handleMessage(Message message) throws Fault {
-
+
String scheme = getAuthenticationScheme(message);
Interceptor<Message> handler = authenticationHandlers.get(scheme);
if (handler == null) {
throw new AuthenticationException();
- }
+ }
handler.handleMessage(message);
}
public void setSchemeHandlers(Map<String, Interceptor<Message>> handlers) {
this.authenticationHandlers = handlers;
}
-
+
protected String getAuthenticationScheme(Message message) {
Map<String, String> headers = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
if (headers == null || !headers.containsKey(AUTHORIZATION_HEADER)) {
@@ -63,5 +63,5 @@ public class DelegatingAuthenticationInterceptor extends AbstractPhaseIntercepto
}
return headers.get(AUTHORIZATION_HEADER).split(" ")[0].trim();
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
index 8dcb3cf..c3b9383 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/DepthRestrictingStreamInterceptor.java
@@ -41,36 +41,36 @@ public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<
private int elementCountThreshold = 2000;
private int innerElementLevelThreshold = 20;
private int innerElementCountThreshold = 50;
-
+
public DepthRestrictingStreamInterceptor() {
this(Phase.POST_STREAM);
addAfter(StaxInInterceptor.class.getName());
}
-
+
public DepthRestrictingStreamInterceptor(String phase) {
super(phase);
}
-
+
public DepthRestrictingStreamInterceptor(String phase, List<String> after) {
super(phase);
if (after != null) {
addAfter(after);
}
}
-
+
public DepthRestrictingStreamInterceptor(String phase, List<String> before, List<String> after) {
this(phase, after);
if (before != null) {
addBefore(before);
}
}
-
+
public void handleMessage(Message message) {
-
+
if (canBeIgnored(message)) {
return;
}
-
+
XMLStreamReader reader = message.getContent(XMLStreamReader.class);
if (reader == null) {
InputStream is = message.getContent(InputStream.class);
@@ -82,9 +82,9 @@ public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<
return;
}
}
- DepthRestrictingStreamReader dr =
+ DepthRestrictingStreamReader dr =
new DepthRestrictingStreamReader(reader,
- elementCountThreshold,
+ elementCountThreshold,
innerElementLevelThreshold,
innerElementCountThreshold);
message.setContent(XMLStreamReader.class, dr);
@@ -95,9 +95,9 @@ public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<
String ct = (String)message.get(Message.CONTENT_TYPE);
return ct != null && !ct.contains(XML_SUB_TYPE);
}
-
+
/**
- * Sets the acceptable total number of elements in the XML payload
+ * Sets the acceptable total number of elements in the XML payload
* @param elementCountThreshold
*/
public void setElementCountThreshold(int elementCountThreshold) {
@@ -109,7 +109,7 @@ public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<
}
/**
- * Sets the acceptable total stack depth in the XML payload
+ * Sets the acceptable total stack depth in the XML payload
* @param elementLevelThreshold
*/
public void setInnerElementLevelThreshold(int elementLevelThreshold) {
@@ -121,7 +121,7 @@ public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<
}
/**
- * Sets the acceptable total number of child elements for the current XML element
+ * Sets the acceptable total number of child elements for the current XML element
* @param innerElementCountThreshold
*/
public void setInnerElementCountThreshold(int innerElementCountThreshold) {
@@ -131,5 +131,5 @@ public class DepthRestrictingStreamInterceptor extends AbstractPhaseInterceptor<
public int getInnerElementCountThreshold() {
return innerElementCountThreshold;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/JAASAuthenticationFeature.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/JAASAuthenticationFeature.java b/core/src/main/java/org/apache/cxf/interceptor/security/JAASAuthenticationFeature.java
index 2a2d985..1b8aa91 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/JAASAuthenticationFeature.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/JAASAuthenticationFeature.java
@@ -1,58 +1,58 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.interceptor.security;
-
-import org.apache.cxf.Bus;
-import org.apache.cxf.feature.AbstractFeature;
-import org.apache.cxf.interceptor.InterceptorProvider;
-
-/**
- * Feature to do JAAS authentication with defaults for karaf integration
- */
-public class JAASAuthenticationFeature extends AbstractFeature {
- public static final String ID = "jaas";
-
- private String contextName = "karaf";
- private boolean reportFault;
-
- @Override
- public String getID() {
- return ID;
- }
-
- @Override
- protected void initializeProvider(InterceptorProvider provider, Bus bus) {
- JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
- jaasLoginInterceptor.setRoleClassifierType(JAASLoginInterceptor.ROLE_CLASSIFIER_CLASS_NAME);
- jaasLoginInterceptor.setRoleClassifier("org.apache.karaf.jaas.boot.principal.RolePrincipal");
- jaasLoginInterceptor.setContextName(contextName);
- jaasLoginInterceptor.setReportFault(reportFault);
- provider.getInInterceptors().add(jaasLoginInterceptor);
- super.initializeProvider(provider, bus);
- }
-
- public void setContextName(String contextName) {
- this.contextName = contextName;
- }
-
- public void setReportFault(boolean reportFault) {
- this.reportFault = reportFault;
- }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.interceptor.security;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.interceptor.InterceptorProvider;
+
+/**
+ * Feature to do JAAS authentication with defaults for karaf integration
+ */
+public class JAASAuthenticationFeature extends AbstractFeature {
+ public static final String ID = "jaas";
+
+ private String contextName = "karaf";
+ private boolean reportFault;
+
+ @Override
+ public String getID() {
+ return ID;
+ }
+
+ @Override
+ protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+ JAASLoginInterceptor jaasLoginInterceptor = new JAASLoginInterceptor();
+ jaasLoginInterceptor.setRoleClassifierType(JAASLoginInterceptor.ROLE_CLASSIFIER_CLASS_NAME);
+ jaasLoginInterceptor.setRoleClassifier("org.apache.karaf.jaas.boot.principal.RolePrincipal");
+ jaasLoginInterceptor.setContextName(contextName);
+ jaasLoginInterceptor.setReportFault(reportFault);
+ provider.getInInterceptors().add(jaasLoginInterceptor);
+ super.initializeProvider(provider, bus);
+ }
+
+ public void setContextName(String contextName) {
+ this.contextName = contextName;
+ }
+
+ public void setReportFault(boolean reportFault) {
+ this.reportFault = reportFault;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java b/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
index b3fa291..f91f96e 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/JAASLoginInterceptor.java
@@ -48,7 +48,7 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
public static final String ROLE_CLASSIFIER_CLASS_NAME = "classname";
private static final Logger LOG = LogUtils.getL7dLogger(JAASLoginInterceptor.class);
-
+
private String contextName = "";
private Configuration loginConfig;
private String roleClassifier;
@@ -58,39 +58,39 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
private List<CallbackHandlerProvider> callbackHandlerProviders;
private boolean allowAnonymous = true;
private boolean allowNamedPrincipals;
-
+
public JAASLoginInterceptor() {
this(Phase.UNMARSHAL);
}
-
+
public JAASLoginInterceptor(String phase) {
super(phase);
this.callbackHandlerProviders = new ArrayList<>();
this.callbackHandlerProviders.add(new CallbackHandlerProviderAuthPol());
this.callbackHandlerProviders.add(new CallbackHandlerProviderUsernameToken());
}
-
+
public void setContextName(String name) {
contextName = name;
}
-
+
public String getContextName() {
return contextName;
}
-
+
@Deprecated
public void setRolePrefix(String name) {
setRoleClassifier(name);
}
-
+
public void setRoleClassifier(String value) {
roleClassifier = value;
}
-
+
public String getRoleClassifier() {
return roleClassifier;
}
-
+
public void setRoleClassifierType(String value) {
if (!ROLE_CLASSIFIER_PREFIX.equals(value)
&& !ROLE_CLASSIFIER_CLASS_NAME.equals(value)) {
@@ -98,19 +98,19 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
}
roleClassifierType = value;
}
-
+
public String getRoleClassifierType() {
return roleClassifierType;
}
-
+
public void setReportFault(boolean reportFault) {
this.reportFault = reportFault;
}
-
+
public void setUseDoAs(boolean useDoAs) {
this.useDoAs = useDoAs;
}
-
+
private CallbackHandler getFirstCallbackHandler(Message message) {
for (CallbackHandlerProvider cbp : callbackHandlerProviders) {
CallbackHandler cbh = cbp.create(message);
@@ -124,12 +124,12 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
public void handleMessage(final Message message) throws Fault {
if (allowNamedPrincipals) {
SecurityContext sc = message.get(SecurityContext.class);
- if (sc != null && sc.getUserPrincipal() != null
+ if (sc != null && sc.getUserPrincipal() != null
&& sc.getUserPrincipal().getName() != null) {
return;
}
}
-
+
CallbackHandler handler = getFirstCallbackHandler(message);
if (handler == null && !allowAnonymous) {
@@ -137,12 +137,12 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
}
try {
- LoginContext ctx = new LoginContext(getContextName(), null, handler, loginConfig);
+ LoginContext ctx = new LoginContext(getContextName(), null, handler, loginConfig);
ctx.login();
Subject subject = ctx.getSubject();
String name = getUsername(handler);
message.put(SecurityContext.class, createSecurityContext(name, subject));
-
+
// Run the further chain in the context of this subject.
// This allows other code to retrieve the subject using pure JAAS
if (useDoAs) {
@@ -166,7 +166,7 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
AuthenticationException aex = new AuthenticationException(errorMessage);
aex.initCause(ex);
throw aex;
-
+
} else {
throw new AuthenticationException("Authentication failed (details can be found in server log)");
}
@@ -189,7 +189,7 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
protected CallbackHandler getCallbackHandler(String name, String password) {
return new NamePasswordCallbackHandler(name, password);
}
-
+
protected SecurityContext createSecurityContext(String name, Subject subject) {
if (getRoleClassifier() != null) {
return new RolePrefixSecurityContextImpl(subject, getRoleClassifier(),
@@ -215,7 +215,7 @@ public class JAASLoginInterceptor extends AbstractPhaseInterceptor<Message> {
this.callbackHandlerProviders.clear();
this.callbackHandlerProviders.addAll(callbackHandlerProviders);
}
-
+
public void addCallbackHandlerProviders(List<CallbackHandlerProvider> callbackHandlerProviders2) {
this.callbackHandlerProviders.addAll(callbackHandlerProviders2);
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java b/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
index 8b61574..5380b56 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/NameDigestPasswordCallbackHandler.java
@@ -32,67 +32,67 @@ import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.common.logging.LogUtils;
-public class NameDigestPasswordCallbackHandler implements CallbackHandler {
-
+public class NameDigestPasswordCallbackHandler implements CallbackHandler {
+
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(NameDigestPasswordCallbackHandler.class);
private static final Logger LOG = LogUtils.getL7dLogger(NameDigestPasswordCallbackHandler.class);
private static final String PASSWORD_CALLBACK_NAME = "setObject";
- private static final Class<?>[] PASSWORD_CALLBACK_TYPES =
+ private static final Class<?>[] PASSWORD_CALLBACK_TYPES =
new Class[]{Object.class, char[].class, String.class};
-
- private String username;
- private String password;
+
+ private String username;
+ private String password;
private String nonce;
private String createdTime;
-
+
private String passwordCallbackName;
-
- public NameDigestPasswordCallbackHandler(String username, String password, String nonce, String createdTime) {
- this(username, password, nonce, createdTime, null);
- }
-
- public NameDigestPasswordCallbackHandler(String username,
- String password,
- String nonce,
- String createdTime,
- String passwordCallbackName) {
- this.username = username;
+
+ public NameDigestPasswordCallbackHandler(String username, String password, String nonce, String createdTime) {
+ this(username, password, nonce, createdTime, null);
+ }
+
+ public NameDigestPasswordCallbackHandler(String username,
+ String password,
+ String nonce,
+ String createdTime,
+ String passwordCallbackName) {
+ this.username = username;
this.password = password;
this.nonce = nonce;
this.createdTime = createdTime;
this.passwordCallbackName = passwordCallbackName;
- }
+ }
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
Callback callback = callbacks[i];
if (handleCallback(callback)) {
continue;
- } else if (callback instanceof NameCallback) {
- ((NameCallback) callback).setName(username);
- } else if (callback instanceof PasswordCallback) {
- PasswordCallback pwCallback = (PasswordCallback) callback;
+ } else if (callback instanceof NameCallback) {
+ ((NameCallback) callback).setName(username);
+ } else if (callback instanceof PasswordCallback) {
+ PasswordCallback pwCallback = (PasswordCallback) callback;
pwCallback.setPassword(password.toCharArray());
} else if (!invokePasswordCallback(callback)) {
- org.apache.cxf.common.i18n.Message errorMsg =
- new org.apache.cxf.common.i18n.Message("UNSUPPORTED_CALLBACK_TYPE",
- BUNDLE,
+ org.apache.cxf.common.i18n.Message errorMsg =
+ new org.apache.cxf.common.i18n.Message("UNSUPPORTED_CALLBACK_TYPE",
+ BUNDLE,
callbacks[i].getClass().getName());
LOG.info(errorMsg.toString());
- throw new UnsupportedCallbackException(callbacks[i], errorMsg.toString());
- }
- }
- }
-
+ throw new UnsupportedCallbackException(callbacks[i], errorMsg.toString());
+ }
+ }
+ }
+
protected boolean handleCallback(Callback callback) {
return false;
}
-
+
/*
- * This method is called from the handle(Callback[]) method when the specified callback
- * did not match any of the known callback classes. It looks for the callback method
+ * This method is called from the handle(Callback[]) method when the specified callback
+ * did not match any of the known callback classes. It looks for the callback method
* having the specified method name with one of the suppported parameter types.
- * If found, it invokes the callback method on the object and returns true.
+ * If found, it invokes the callback method on the object and returns true.
* If not, it returns false.
*/
private boolean invokePasswordCallback(Callback callback) {
@@ -110,13 +110,13 @@ public class NameDigestPasswordCallbackHandler implements CallbackHandler {
}
return false;
}
-
+
public String getNonce() {
return this.nonce;
}
-
+
public String getCreatedTime() {
return this.createdTime;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java b/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
index 0aa999a..f03dd0f 100644
--- a/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
+++ b/core/src/main/java/org/apache/cxf/interceptor/security/NamePasswordCallbackHandler.java
@@ -32,59 +32,59 @@ import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.cxf.common.i18n.BundleUtils;
import org.apache.cxf.common.logging.LogUtils;
-public class NamePasswordCallbackHandler implements CallbackHandler {
-
+public class NamePasswordCallbackHandler implements CallbackHandler {
+
private static final ResourceBundle BUNDLE = BundleUtils.getBundle(NamePasswordCallbackHandler.class);
private static final Logger LOG = LogUtils.getL7dLogger(NamePasswordCallbackHandler.class);
private static final String PASSWORD_CALLBACK_NAME = "setObject";
- private static final Class<?>[] PASSWORD_CALLBACK_TYPES =
+ private static final Class<?>[] PASSWORD_CALLBACK_TYPES =
new Class[]{Object.class, char[].class, String.class};
-
- private String username;
- private String password;
-
+
+ private String username;
+ private String password;
+
private String passwordCallbackName;
-
- public NamePasswordCallbackHandler(String username, String password) {
- this(username, password, null);
- }
-
- public NamePasswordCallbackHandler(String username, String password, String passwordCallbackName) {
- this.username = username;
+
+ public NamePasswordCallbackHandler(String username, String password) {
+ this(username, password, null);
+ }
+
+ public NamePasswordCallbackHandler(String username, String password, String passwordCallbackName) {
+ this.username = username;
this.password = password;
this.passwordCallbackName = passwordCallbackName;
- }
+ }
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
- for (int i = 0; i < callbacks.length; i++) {
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+ for (int i = 0; i < callbacks.length; i++) {
Callback callback = callbacks[i];
if (handleCallback(callback)) {
continue;
- } else if (callback instanceof NameCallback) {
- ((NameCallback) callback).setName(username);
- } else if (callback instanceof PasswordCallback) {
- PasswordCallback pwCallback = (PasswordCallback) callback;
+ } else if (callback instanceof NameCallback) {
+ ((NameCallback) callback).setName(username);
+ } else if (callback instanceof PasswordCallback) {
+ PasswordCallback pwCallback = (PasswordCallback) callback;
pwCallback.setPassword(password.toCharArray());
} else if (!invokePasswordCallback(callback)) {
- org.apache.cxf.common.i18n.Message errorMsg =
- new org.apache.cxf.common.i18n.Message("UNSUPPORTED_CALLBACK_TYPE",
- BUNDLE,
+ org.apache.cxf.common.i18n.Message errorMsg =
+ new org.apache.cxf.common.i18n.Message("UNSUPPORTED_CALLBACK_TYPE",
+ BUNDLE,
callbacks[i].getClass().getName());
LOG.info(errorMsg.toString());
- throw new UnsupportedCallbackException(callbacks[i], errorMsg.toString());
- }
- }
- }
-
+ throw new UnsupportedCallbackException(callbacks[i], errorMsg.toString());
+ }
+ }
+ }
+
protected boolean handleCallback(Callback callback) {
return false;
}
-
+
/*
- * This method is called from the handle(Callback[]) method when the specified callback
- * did not match any of the known callback classes. It looks for the callback method
+ * This method is called from the handle(Callback[]) method when the specified callback
+ * did not match any of the known callback classes. It looks for the callback method
* having the specified method name with one of the suppported parameter types.
- * If found, it invokes the callback method on the object and returns true.
+ * If found, it invokes the callback method on the object and returns true.
* If not, it returns false.
*/
private boolean invokePasswordCallback(Callback callback) {
@@ -102,5 +102,5 @@ public class NamePasswordCallbackHandler implements CallbackHandler {
}
return false;
}
-
+
}