Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DE789200C2A for ; Tue, 14 Feb 2017 10:49:15 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DD1DF160B6D; Tue, 14 Feb 2017 09:49:15 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5A441160B85 for ; Tue, 14 Feb 2017 10:49:13 +0100 (CET) Received: (qmail 13010 invoked by uid 500); 14 Feb 2017 09:49:10 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 10647 invoked by uid 99); 14 Feb 2017 09:49:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2017 09:49:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EF971E0A2C; Tue, 14 Feb 2017 09:49:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: coheigea@apache.org To: commits@cxf.apache.org Date: Tue, 14 Feb 2017 09:49:42 -0000 Message-Id: In-Reply-To: <5a3d5dd07bd54c18b7b93676f5b3fbcd@git.apache.org> References: <5a3d5dd07bd54c18b7b93676f5b3fbcd@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [37/51] [partial] cxf git commit: Remove all trailing whitespaces archived-at: Tue, 14 Feb 2017 09:49:16 -0000 http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java b/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java index d2e0ea1..cfb45ff 100644 --- a/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java +++ b/core/src/main/java/org/apache/cxf/service/factory/AnnotationsFactoryBeanListener.java @@ -61,12 +61,12 @@ import org.apache.cxf.service.model.OperationInfo; import org.apache.cxf.transport.common.gzip.GZIPFeature; /** - * + * */ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { - - private static final String EXTRA_DOCUMENTATION - = AnnotationsFactoryBeanListener.class.getName() + ".EXTRA_DOCS"; + + private static final String EXTRA_DOCUMENTATION + = AnnotationsFactoryBeanListener.class.getName() + ".EXTRA_DOCS"; /** {@inheritDoc}*/ public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) { @@ -118,7 +118,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { InterfaceInfo i = ep.getEndpointInfo().getInterface(); List docs = CastUtils.cast((List)i.removeProperty(EXTRA_DOCUMENTATION)); if (docs != null) { - addDocumentation(ep, + addDocumentation(ep, WSDLDocumentation.Placement.SERVICE, docs.toArray(new WSDLDocumentation[docs.size()])); } @@ -139,7 +139,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { } } } - break; + break; } case SERVER_CREATED: { Class cls = (Class)args[2]; @@ -217,7 +217,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { } ((FactoryInvoker)i).setFactory(f); } - + } } @@ -239,9 +239,9 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { } else { obj = s; } - ep.getEndpointInfo().setProperty(prop.key(), obj); + ep.getEndpointInfo().setProperty(prop.key(), obj); } - + } private Object createObject(Class cls, Endpoint ep, Bus bus) { @@ -253,7 +253,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { return cls.getConstructor(Endpoint.class).newInstance(ep); } catch (NoSuchMethodException e2) { return cls.newInstance(); - } + } } } catch (Exception ex) { throw new ServiceConstructionException(ex); @@ -262,7 +262,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { private void setDataBinding(AbstractServiceFactoryBean factory, DataBinding annotation) { - if (annotation != null && factory.getDataBinding(false) == null) { + if (annotation != null && factory.getDataBinding(false) == null) { try { if (!StringUtils.isEmpty(annotation.ref())) { factory.setDataBinding(factory.getBus().getExtension(ResourceManager.class) @@ -365,7 +365,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { inf.setProperty(Message.SCHEMA_VALIDATION_TYPE, annotation.type()); } } - + private void addDocumentation(OperationInfo inf, Placement defPlace, WSDLDocumentation ... values) { List later = new ArrayList<>(); for (WSDLDocumentation doc : values) { @@ -383,7 +383,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { case PORT_TYPE_OPERATION_OUTPUT: inf.getOutput().setDocumentation(doc.value()); break; - case FAULT_MESSAGE: + case FAULT_MESSAGE: case PORT_TYPE_OPERATION_FAULT: { for (FaultInfo f : inf.getFaults()) { if (doc.faultClass().equals(f.getProperty(Class.class.getName()))) { @@ -417,7 +417,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { } } - private void addDocumentation(InterfaceInfo interfaceInfo, + private void addDocumentation(InterfaceInfo interfaceInfo, WSDLDocumentation.Placement defPlace, WSDLDocumentation ... values) { List later = new ArrayList<>(); @@ -450,7 +450,7 @@ public class AnnotationsFactoryBeanListener implements FactoryBeanListener { } } } - private void addDocumentation(Endpoint ep, + private void addDocumentation(Endpoint ep, WSDLDocumentation.Placement defPlace, WSDLDocumentation ... values) { for (WSDLDocumentation doc : values) { http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java b/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java index a523fbf..b16d21c 100644 --- a/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java +++ b/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java @@ -20,7 +20,7 @@ package org.apache.cxf.service.factory; /** - * + * */ public interface FactoryBeanListener { enum Event { @@ -29,7 +29,7 @@ public interface FactoryBeanListener { * for setting up any state the listener may need to maintain. */ START_CREATE, - + /** * Event fired at the very end of processing. One parameter is passed * in which is the Service object that was created. @@ -42,104 +42,104 @@ public interface FactoryBeanListener { * of the URL of the wsdl. */ CREATE_FROM_WSDL, - + /** * Called at the start of processing when it detects that the service * is to be created based on a Java class. One Class parameter * of the class that is being analyzed. */ CREATE_FROM_CLASS, - + /** * Called after the wsdl is loaded/parsed. Single parameter of the * WSS4J Definition of the WSDL. */ WSDL_LOADED, - + /** * Called after the Service is set into the Factory after which the getService() * call will return a valid value. One parameter of the Service object. */ - SERVICE_SET, - - + SERVICE_SET, + + /** * OperationInfo, Method */ INTERFACE_OPERATION_BOUND, - + /** * OperationInfo, Method, MessageInfo */ OPERATIONINFO_IN_MESSAGE_SET, OPERATIONINFO_OUT_MESSAGE_SET, - + /** * OperationInfo, Class, FaultInfo */ OPERATIONINFO_FAULT, - + /** * InterfaceInfo, Class */ INTERFACE_CREATED, - + /** * DataBinding */ DATABINDING_INITIALIZED, - + /** * EndpointInfo, Endpoint, Class */ ENDPOINT_CREATED, - + /** * Server, targetObject, Class */ - PRE_SERVER_CREATE, + PRE_SERVER_CREATE, /** * Server, targetObject, Class */ - SERVER_CREATED, - + SERVER_CREATED, + /** * BindingInfo, BindingOperationInfo, Implementation Method */ BINDING_OPERATION_CREATED, - + /** * BindingInfo */ - BINDING_CREATED, - + BINDING_CREATED, + /** * Endpoint */ - PRE_CLIENT_CREATE, + PRE_CLIENT_CREATE, /** * Endpoint, Client */ - CLIENT_CREATED, - + CLIENT_CREATED, + /** - * EndpointInfo, Endpoint, SEI Class, Class + * EndpointInfo, Endpoint, SEI Class, Class */ ENDPOINT_SELECTED, - + /** * EndpointInfo */ - ENDPOINTINFO_CREATED, - + ENDPOINTINFO_CREATED, + /** * Class[], InvokationHandler, Proxy */ PROXY_CREATED, }; - + void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object ... args); } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java b/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java index e91000b..af07871 100644 --- a/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java +++ b/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListenerManager.java @@ -29,15 +29,15 @@ import org.apache.cxf.common.injection.NoJSR250Annotations; import org.apache.cxf.configuration.ConfiguredBeanLocator; /** - * + * */ @NoJSR250Annotations(unlessNull = "bus") public class FactoryBeanListenerManager { Bus bus; - + CopyOnWriteArrayList listeners = new CopyOnWriteArrayList(); - + public FactoryBeanListenerManager() { listeners.add(new AnnotationsFactoryBeanListener()); } @@ -45,13 +45,13 @@ public class FactoryBeanListenerManager { this(); setBus(b); } - + @Resource public final void setBus(Bus bus) { this.bus = bus; - + this.bus.setExtension(this, FactoryBeanListenerManager.class); - + ConfiguredBeanLocator loc = bus.getExtension(ConfiguredBeanLocator.class); if (loc != null) { for (FactoryBeanListener f : loc.getBeansOfType(FactoryBeanListener.class)) { @@ -59,17 +59,17 @@ public class FactoryBeanListenerManager { } } } - + public List getListeners() { return listeners; } - + public void addListener(FactoryBeanListener l) { listeners.addIfAbsent(l); } - + public void removeListener(FactoryBeanListener l) { listeners.remove(l); } - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java b/core/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java index 8e9b308..ed48454 100644 --- a/core/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java +++ b/core/src/main/java/org/apache/cxf/service/factory/SimpleMethodDispatcher.java @@ -27,32 +27,32 @@ import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.OperationInfo; -public class SimpleMethodDispatcher +public class SimpleMethodDispatcher implements org.apache.cxf.service.invoker.MethodDispatcher { - private Map> infoMap = + private Map> infoMap = new ConcurrentHashMap>(16, 0.75f, 2); - private Map opToMethod = + private Map opToMethod = new ConcurrentHashMap(16, 0.75f, 2); - private Map methodToOp = + private Map methodToOp = new ConcurrentHashMap(16, 0.75f, 2); public SimpleMethodDispatcher() { //complete } - + public void bind(OperationInfo o, Method... methods) { Method primary = methods[0]; for (Method m : methods) { - methodToOp.put(m, o); - - Map biToBop + methodToOp.put(m, o); + + Map biToBop = new ConcurrentHashMap(4, 0.75f, 2); infoMap.put(m, biToBop); } - + opToMethod.put(o, primary); - + if (o.isUnwrappedCapable()) { opToMethod.put(o.getUnwrappedOperation(), primary); } @@ -63,19 +63,19 @@ public class SimpleMethodDispatcher if (bops == null) { return null; } - + BindingOperationInfo bop = bops.get(endpoint.getEndpointInfo().getBinding()); if (bop == null) { OperationInfo o = methodToOp.get(method); if (o == null) { return null; } - + BindingInfo b = endpoint.getEndpointInfo().getBinding(); for (BindingOperationInfo bop2 : b.getOperations()) { if (bop2.getOperationInfo().equals(o)) { bop2 = getRealOperation(o, bop2); - + bops.put(b, bop2); return bop2; } @@ -96,7 +96,7 @@ public class SimpleMethodDispatcher public Method getMethod(BindingOperationInfo op) { return opToMethod.get(op.getOperationInfo()); } - + public Method getPrimaryMethod(OperationInfo op) { return opToMethod.get(op); } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java b/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java index f201571..2f2bd60 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/AbstractInvoker.java @@ -43,19 +43,19 @@ import org.apache.cxf.service.model.BindingOperationInfo; */ public abstract class AbstractInvoker implements Invoker { private static final Logger LOG = LogUtils.getL7dLogger(AbstractInvoker.class); - + public Object invoke(Exchange exchange, Object o) { final Object serviceObject = getServiceObject(exchange); try { BindingOperationInfo bop = exchange.getBindingOperationInfo(); - MethodDispatcher md = (MethodDispatcher) + MethodDispatcher md = (MethodDispatcher) exchange.getService().get(MethodDispatcher.class.getName()); Method m = bop == null ? null : md.getMethod(bop); if (m == null && bop == null) { LOG.severe(new Message("MISSING_BINDING_OPERATION", LOG).toString()); - throw new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG, + throw new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG, "No binding operation info", "unknown method", "unknown")); } List params = null; @@ -64,13 +64,13 @@ public abstract class AbstractInvoker implements Invoker { } else if (o != null) { params = new MessageContentsList(o); } - + m = adjustMethodAndParams(m, exchange, params, serviceObject.getClass()); - + //Method m = (Method)bop.getOperationInfo().getProperty(Method.class.getName()); m = matchMethod(m, serviceObject); - - + + return invoke(exchange, serviceObject, m, params); } finally { releaseServiceObject(exchange, serviceObject); @@ -94,35 +94,35 @@ public abstract class AbstractInvoker implements Invoker { } res = performInvocation(exchange, serviceObject, m, paramArray); - + if (exchange.isOneWay()) { return null; } - + return new MessageContentsList(res); } catch (InvocationTargetException e) { - + Throwable t = e.getCause(); - + if (t == null) { t = e; } - + checkSuspendedInvocation(exchange, serviceObject, m, params, t); - + exchange.getInMessage().put(FaultMode.class, FaultMode.UNCHECKED_APPLICATION_FAULT); - - + + for (Class cl : m.getExceptionTypes()) { if (cl.isInstance(t)) { - exchange.getInMessage().put(FaultMode.class, - FaultMode.CHECKED_APPLICATION_FAULT); + exchange.getInMessage().put(FaultMode.class, + FaultMode.CHECKED_APPLICATION_FAULT); } } - + if (t instanceof Fault) { - exchange.getInMessage().put(FaultMode.class, - FaultMode.CHECKED_APPLICATION_FAULT); + exchange.getInMessage().put(FaultMode.class, + FaultMode.CHECKED_APPLICATION_FAULT); throw (Fault)t; } throw createFault(t, m, params, true); @@ -138,42 +138,42 @@ public abstract class AbstractInvoker implements Invoker { checkSuspendedInvocation(exchange, serviceObject, m, params, e); exchange.getInMessage().put(FaultMode.class, FaultMode.UNCHECKED_APPLICATION_FAULT); throw createFault(e, m, params, false); - } + } } - + protected void checkSuspendedInvocation(Exchange exchange, - Object serviceObject, - Method m, - List params, + Object serviceObject, + Method m, + List params, Throwable t) { if (t instanceof SuspendedInvocationException) { - + if (LOG.isLoggable(Level.FINE)) { - LOG.log(Level.FINE, "SUSPENDED_INVOCATION_EXCEPTION", + LOG.log(Level.FINE, "SUSPENDED_INVOCATION_EXCEPTION", new Object[]{serviceObject, m.toString(), params}); } throw (SuspendedInvocationException)t; } } - + protected Fault createFault(Throwable ex, Method m, List params, boolean checked) { - + if (checked) { return new Fault(ex); } else { - String message = (ex == null) ? "" : ex.getMessage(); - String method = (m == null) ? "" : m.toString(); - return new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG, + String message = (ex == null) ? "" : ex.getMessage(); + String method = (m == null) ? "" : m.toString(); + return new Fault(new Message("EXCEPTION_INVOKING_OBJECT", LOG, message, method, params), - ex); + ex); } } - + protected Object performInvocation(Exchange exchange, final Object serviceObject, Method m, Object[] paramArray) throws Exception { paramArray = insertExchange(m, paramArray, exchange); if (LOG.isLoggable(Level.FINER)) { - LOG.log(Level.FINER, "INVOKING_METHOD", new Object[] {serviceObject, + LOG.log(Level.FINER, "INVOKING_METHOD", new Object[] {serviceObject, m, Arrays.asList(paramArray)}); } @@ -199,7 +199,7 @@ public abstract class AbstractInvoker implements Invoker { } return newParams; } - + /** * Creates and returns a service object depending on the scope. */ @@ -219,7 +219,7 @@ public abstract class AbstractInvoker implements Invoker { * targetObject to avoid the IllegalArgumentException when invoking the * method on the target object. The methodToMatch will be returned if the * targetObject doesn't have a similar method. - * + * * @param methodToMatch The method to be used when finding a matching method * in targetObject * @param targetObject The object to search in for the method. @@ -242,7 +242,7 @@ public abstract class AbstractInvoker implements Invoker { /** * Return whether the given object is a J2SE dynamic proxy. - * + * * @param object the object to check * @see java.lang.reflect.Proxy#isProxyClass */ @@ -256,7 +256,7 @@ public abstract class AbstractInvoker implements Invoker { * one. E.g. the method may be IFoo.bar() and the target class may be * DefaultFoo. In this case, the method may be DefaultFoo.bar(). This * enables attributes on that method to be found. - * + * * @param method method to be invoked, which may come from an interface * @param targetClass target class for the current invocation. May be * null or may not even implement the method. http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/BeanInvoker.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/BeanInvoker.java b/core/src/main/java/org/apache/cxf/service/invoker/BeanInvoker.java index 34325cc..ced9a4d 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/BeanInvoker.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/BeanInvoker.java @@ -24,7 +24,7 @@ import org.apache.cxf.message.Exchange; /** * Invoker for externally created service objects. - * + * */ @NoJSR250Annotations public class BeanInvoker extends AbstractInvoker { http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/Factory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/Factory.java b/core/src/main/java/org/apache/cxf/service/invoker/Factory.java index d4c6305..9688c2a 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/Factory.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/Factory.java @@ -22,18 +22,18 @@ import org.apache.cxf.message.Exchange; /** * Represents an object factory. - * + * * Used at invoke time to find the object that the invokation will use */ public interface Factory { - + /** - * Creates the object that will be used for the invoke - * @param e + * Creates the object that will be used for the invoke + * @param e * @throws Throwable */ Object create(Exchange e) throws Throwable; - + /** * Post invoke, this is called to allow the factory to release * the object, store it, etc... http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java b/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java index dec77c8..8c819c4 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java @@ -28,7 +28,7 @@ import org.apache.cxf.message.Exchange; /** * This invoker implementation calls a Factory to create the service object. - * + * */ public class FactoryInvoker extends AbstractInvoker { static final ResourceBundle BUNDLE = BundleUtils.getBundle(FactoryInvoker.class); @@ -37,7 +37,7 @@ public class FactoryInvoker extends AbstractInvoker { /** * Create a FactoryInvoker object. - * + * * @param factory the factory used to create service object. */ public FactoryInvoker(Factory factory) { @@ -58,12 +58,12 @@ public class FactoryInvoker extends AbstractInvoker { throw new Fault(new Message("CREATE_SERVICE_OBJECT_EXC", BUNDLE), e); } } - + public void releaseServiceObject(final Exchange ex, Object obj) { factory.release(ex, obj); } - + public boolean isSingletonFactory() { - return factory instanceof SingletonFactory; + return factory instanceof SingletonFactory; } } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/MethodDispatcher.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/MethodDispatcher.java b/core/src/main/java/org/apache/cxf/service/invoker/MethodDispatcher.java index 5a6bc70..c9f3272 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/MethodDispatcher.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/MethodDispatcher.java @@ -30,9 +30,9 @@ import org.apache.cxf.service.model.OperationInfo; */ public interface MethodDispatcher { Method getMethod(BindingOperationInfo op); - + BindingOperationInfo getBindingOperation(Method m, Endpoint endpoint); - + void bind(OperationInfo o, Method... methods); } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/PooledFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/PooledFactory.java b/core/src/main/java/org/apache/cxf/service/invoker/PooledFactory.java index b72f6a2..7329a99 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/PooledFactory.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/PooledFactory.java @@ -27,7 +27,7 @@ import org.apache.cxf.message.Exchange; /** * Factory the maintains a pool of instances that are used. - * + * * Can optionally create more instances than the size of the queue */ public class PooledFactory implements Factory { @@ -58,10 +58,10 @@ public class PooledFactory implements Factory { * Pool of instances constructed from the given factory * @param factory * @param max the absolute maximum number to create and pool - * @param createMore If the pool is empty, but max objects have already - * been constructed, should more be constructed on a per-request basis (and - * then discarded when done) or should requests block until instances are - * released back into the pool. + * @param createMore If the pool is empty, but max objects have already + * been constructed, should more be constructed on a per-request basis (and + * then discarded when done) or should requests block until instances are + * released back into the pool. */ public PooledFactory(final Factory factory, int max, boolean createMore) { this.factory = factory; @@ -73,9 +73,9 @@ public class PooledFactory implements Factory { this.count = 0; this.createMore = createMore; } - + /** - * Pool constructed from the give Collection of objects. + * Pool constructed from the give Collection of objects. * @param objs The collection of objects to pre-populate the pool */ public PooledFactory(Collection objs) { @@ -85,7 +85,7 @@ public class PooledFactory implements Factory { /** {@inheritDoc}*/ public Object create(Exchange ex) throws Throwable { - if (factory == null + if (factory == null || ((count >= max) && !createMore)) { return pool.take(); } @@ -97,13 +97,13 @@ public class PooledFactory implements Factory { } protected synchronized Object createObject(Exchange e) throws Throwable { //recheck the count/max stuff now that we're in a sync block - if (factory == null + if (factory == null || ((count >= max) && !createMore)) { return pool.take(); } - + count++; - return factory.create(e); + return factory.create(e); } /** {@inheritDoc}*/ http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java b/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java index 800dec3..689c17a 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java @@ -25,15 +25,15 @@ import org.apache.cxf.service.Service; /** * Creates a new instance for each session. - * - * This may have restrictions on what the bean can look like. For example, + * + * This may have restrictions on what the bean can look like. For example, * some session implementations require the beans to be Serializable */ public class SessionFactory implements Factory { - + Factory factory; boolean createIfNotExist; - + public SessionFactory(Class svcClass) { this(new PerRequestFactory(svcClass), true); } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/SingletonFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/SingletonFactory.java b/core/src/main/java/org/apache/cxf/service/invoker/SingletonFactory.java index ec3b827..ce73c88 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/SingletonFactory.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/SingletonFactory.java @@ -23,7 +23,7 @@ import org.apache.cxf.message.Exchange; /** * Always returns a single instance of the bean. - * + * * This is generally the default. */ public class SingletonFactory implements Factory { @@ -52,7 +52,7 @@ public class SingletonFactory implements Factory { bean = factory.create(e); } } - + /** {@inheritDoc}*/ public void release(Exchange ex, Object o) { //nothing to do http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/invoker/spring/SpringBeanFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/invoker/spring/SpringBeanFactory.java b/core/src/main/java/org/apache/cxf/service/invoker/spring/SpringBeanFactory.java index d5911b3..b7840f5 100644 --- a/core/src/main/java/org/apache/cxf/service/invoker/spring/SpringBeanFactory.java +++ b/core/src/main/java/org/apache/cxf/service/invoker/spring/SpringBeanFactory.java @@ -26,25 +26,25 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; /** - * Factory that will query the Spring ApplicationContext for the + * Factory that will query the Spring ApplicationContext for the * appropriate bean for each request. - * - * This can be expensive. If the bean is "prototype" or similar such that a - * new instance is created each time, this could slow things down. In that + * + * This can be expensive. If the bean is "prototype" or similar such that a + * new instance is created each time, this could slow things down. In that * case, it's recommended to use this in conjunction with the PooledFactory * to pool the beans or the SessionFactory or similar. */ public class SpringBeanFactory implements Factory, ApplicationContextAware { volatile ApplicationContext ctx; final String beanName; - + public SpringBeanFactory(String name) { beanName = name; } public SpringBeanFactory(Class c, String[] args) { //NOPMD beanName = args[0]; } - + /** {@inheritDoc}*/ public Object create(Exchange e) throws Throwable { if (ctx == null) { http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java b/core/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java index 64c5ae5..0402a7f 100644 --- a/core/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java +++ b/core/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java @@ -22,5 +22,5 @@ package org.apache.cxf.service.model; public abstract class AbstractDescriptionElement extends AbstractPropertiesHolder { public abstract DescriptionInfo getDescription(); - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java b/core/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java index baabede..95479b7 100644 --- a/core/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java +++ b/core/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java @@ -31,16 +31,16 @@ import javax.xml.namespace.QName; public abstract class AbstractMessageContainer extends AbstractPropertiesHolder implements NamedItem { protected QName mName; private OperationInfo operation; - private Map messageParts + private Map messageParts = new LinkedHashMap(4); private List outOfBandParts; private String documentation; - - + + /** * Initializes a new instance of the MessagePartContainer. * @param operation the operation. - * @param nm + * @param nm */ AbstractMessageContainer(OperationInfo op, QName nm) { operation = op; @@ -53,11 +53,11 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder public void setMessageDocumentation(String doc) { documentation = doc; } - + public QName getName() { return mName; } - + /** * Returns the operation of this container. * @@ -82,14 +82,14 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder addMessagePart(part); return part; } - + public QName getMessagePartQName(String name) { return new QName(this.getOperation().getInterface().getName().getNamespaceURI(), name); } - + public MessagePartInfo addMessagePart(String name) { return addMessagePart(getMessagePartQName(name)); - } + } /** * Adds a message part to this container. * @@ -98,7 +98,7 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder public void addMessagePart(MessagePartInfo part) { if (messageParts.containsKey(part.getName())) { part.setIndex(messageParts.get(part.getName()).getIndex()); - } else { + } else { part.setIndex(messageParts.size()); } messageParts.put(part.getName(), part); @@ -146,7 +146,7 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder messageParts.remove(name); } } - + /** * Returns the message part with the given name, if found. * @@ -171,7 +171,7 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder } return mpi; } - + /** * Returns the n'th message part. * @@ -189,9 +189,9 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder n--; } return null; - } - - + } + + public MessagePartInfo addOutOfBandMessagePart(QName name) { if (name == null) { throw new IllegalArgumentException("Invalid name [null]"); @@ -206,8 +206,8 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder return part; } - - + + /** * Returns all message parts for this message. * @@ -242,16 +242,16 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder } return Collections.unmodifiableList(outOfBandParts); } - + public int size() { return messageParts.size() + getOutOfBandParts().size(); } - - + + public int hashCode() { return mName == null ? -1 : mName.hashCode(); } - + public boolean equals(Object o) { if (o == this) { return true; @@ -261,7 +261,7 @@ public abstract class AbstractMessageContainer extends AbstractPropertiesHolder return false; } AbstractMessageContainer oi = (AbstractMessageContainer)o; - return equals(mName, oi.mName) + return equals(mName, oi.mName) && equals(messageParts, oi.messageParts) && equals(outOfBandParts, oi.outOfBandParts); } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java b/core/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java index 8321fb3..ac12b68 100644 --- a/core/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java +++ b/core/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java @@ -31,13 +31,13 @@ import javax.xml.namespace.QName; public abstract class AbstractPropertiesHolder implements Extensible { private AbstractPropertiesHolder delegate; private boolean delegateProperties; - + private AtomicReference> propertyMap = new AtomicReference>(); private AtomicReference extensors = new AtomicReference(); private Map extensionAttributes; private String documentation; - - + + public final void setDelegate(AbstractPropertiesHolder p, boolean props) { delegate = p; delegateProperties = props; @@ -65,7 +65,7 @@ public abstract class AbstractPropertiesHolder implements Extensible { propertyMap.set(null); } } - + public String getDocumentation() { if (delegate != null) { return delegate.getDocumentation(); @@ -103,7 +103,7 @@ public abstract class AbstractPropertiesHolder implements Extensible { } return propertyMap.get().remove(name); } - + public T getProperty(String name, Class cls) { return cls.cast(getProperty(name)); } @@ -117,7 +117,7 @@ public abstract class AbstractPropertiesHolder implements Extensible { } return false; } - + public void setProperty(String name, Object v) { if (delegate != null && delegateProperties) { delegate.setProperty(name, v); @@ -132,7 +132,7 @@ public abstract class AbstractPropertiesHolder implements Extensible { propertyMap.get().put(name, v); } } - + public boolean containsExtensor(Object el) { if (delegate != null) { return delegate.containsExtensor(el); @@ -189,7 +189,7 @@ public abstract class AbstractPropertiesHolder implements Extensible { if (delegate != null) { return delegate.getExtensors(cls); } - + Object exts[] = extensors.get(); if (exts == null) { return null; @@ -209,9 +209,9 @@ public abstract class AbstractPropertiesHolder implements Extensible { } return extensors; } - - - public Object getExtensionAttribute(QName name) { + + + public Object getExtensionAttribute(QName name) { if (delegate != null) { return delegate.getExtensionAttribute(name); } @@ -224,7 +224,7 @@ public abstract class AbstractPropertiesHolder implements Extensible { } return extensionAttributes; } - + public void addExtensionAttribute(QName name, Object attr) { if (delegate != null) { delegate.addExtensionAttribute(name, attr); @@ -235,20 +235,20 @@ public abstract class AbstractPropertiesHolder implements Extensible { } extensionAttributes.put(name, attr); } - + public void setExtensionAttributes(Map attrs) { if (delegate != null) { delegate.setExtensionAttributes(attrs); return; } - extensionAttributes = attrs; + extensionAttributes = attrs; } /** * Lookup a configuration value. This may be found in the properties holder supplied * (i.e. an EndpointInfo or ServiceInfo), or it may be a property on the Bus itself. * If no value is found, the defaultValue is returned. - * + * * @param defaultValue the default value * @param type the extensor type * @return the configuration value or the default @@ -263,8 +263,8 @@ public abstract class AbstractPropertiesHolder implements Extensible { } return extensor; } - - + + protected static final boolean equals(Object o1, Object o2) { if (o1 == null && o2 != null @@ -273,5 +273,5 @@ public abstract class AbstractPropertiesHolder implements Extensible { } return o1 == null ? true : o1.equals(o2); } - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/BindingFaultInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/BindingFaultInfo.java b/core/src/main/java/org/apache/cxf/service/model/BindingFaultInfo.java index c613826..8668a48 100644 --- a/core/src/main/java/org/apache/cxf/service/model/BindingFaultInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/BindingFaultInfo.java @@ -22,16 +22,16 @@ package org.apache.cxf.service.model; public class BindingFaultInfo extends AbstractPropertiesHolder { FaultInfo fault; BindingOperationInfo opinfo; - + public BindingFaultInfo(FaultInfo f, BindingOperationInfo info) { fault = f; opinfo = info; } - + public FaultInfo getFaultInfo() { return fault; } - + public BindingOperationInfo getBindingOperation() { return opinfo; } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/BindingInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/BindingInfo.java b/core/src/main/java/org/apache/cxf/service/model/BindingInfo.java index 1d8aa5a..5d3f612 100644 --- a/core/src/main/java/org/apache/cxf/service/model/BindingInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/BindingInfo.java @@ -31,21 +31,21 @@ import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.logging.LogUtils; public class BindingInfo extends AbstractDescriptionElement implements NamedItem { - + private static final Logger LOG = LogUtils.getL7dLogger(BindingInfo.class); - + QName name; ServiceInfo service; final String bindingId; - - Map operations + + Map operations = new ConcurrentHashMap(4, 0.75f, 2); - + public BindingInfo(ServiceInfo service, String bindingId) { this.service = service; this.bindingId = bindingId; } - + public DescriptionInfo getDescription() { if (service == null) { return null; @@ -64,14 +64,14 @@ public class BindingInfo extends AbstractDescriptionElement implements NamedItem public String getBindingId() { return bindingId; } - + public void setName(QName n) { name = n; } public QName getName() { return name; } - + private boolean nameEquals(String a, String b, String def) { if (a == null) { // in case of input/output itself is empty @@ -88,7 +88,7 @@ public class BindingInfo extends AbstractDescriptionElement implements NamedItem if (opName.equals(op.getName()) && nameEquals(inName, op.getInputName(), op.getName().getLocalPart() + "Request") && nameEquals(outName, op.getOutputName(), op.getName().getLocalPart() + "Response")) { - + return new BindingOperationInfo(this, op); } } @@ -104,15 +104,15 @@ public class BindingInfo extends AbstractDescriptionElement implements NamedItem if (operation.getName() == null) { throw new NullPointerException( new Message("BINDING.OPERATION.NAME.NOT.NULL", LOG).toString()); - } + } if (operations.containsKey(operation.getName())) { throw new IllegalArgumentException( new Message("DUPLICATED.OPERATION.NAME", LOG, new Object[]{operation.getName()}).toString()); } - + operations.put(operation.getName(), operation); } - + /** * Removes an operation from this service. * @@ -122,8 +122,8 @@ public class BindingInfo extends AbstractDescriptionElement implements NamedItem if (operation.getName() == null) { throw new NullPointerException( new Message("BINDING.OPERATION.NAME.NOT.NULL", LOG).toString()); - } - + } + operations.remove(operation.getName()); } @@ -154,10 +154,10 @@ public class BindingInfo extends AbstractDescriptionElement implements NamedItem return b.getUnwrappedOperation(); } } - + return null; } - + @Override public String toString() { return "[BindingInfo " + getBindingId() + "]"; http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java b/core/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java index 348e9b0..45b3d57 100644 --- a/core/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/BindingMessageInfo.java @@ -26,7 +26,7 @@ public class BindingMessageInfo extends AbstractPropertiesHolder { MessageInfo msg; BindingOperationInfo op; private List messageParts; - + public BindingMessageInfo() { } @@ -35,11 +35,11 @@ public class BindingMessageInfo extends AbstractPropertiesHolder { msg = m; messageParts = msg.getMessageParts(); } - + public MessageInfo getMessageInfo() { return msg; } - + public BindingOperationInfo getBindingOperation() { return op; } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java b/core/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java index d7b7d4d..2e9b865 100644 --- a/core/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/BindingOperationInfo.java @@ -28,7 +28,7 @@ import javax.xml.namespace.QName; /** - * + * */ public class BindingOperationInfo extends AbstractPropertiesHolder { @@ -44,11 +44,11 @@ public class BindingOperationInfo extends AbstractPropertiesHolder { public BindingOperationInfo() { } - - public BindingOperationInfo(BindingInfo bi, OperationInfo opinfo) { + + public BindingOperationInfo(BindingInfo bi, OperationInfo opinfo) { bindingInfo = bi; opInfo = opinfo; - + if (opInfo.getInput() != null) { inputMessage = new BindingMessageInfo(opInfo.getInput(), this); } else { @@ -59,15 +59,15 @@ public class BindingOperationInfo extends AbstractPropertiesHolder { } else { outputMessage = null; } - + Collection of = opinfo.getFaults(); if (of != null && !of.isEmpty()) { faults = new ConcurrentHashMap(of.size(), 0.75f, 2); for (FaultInfo fault : of) { faults.put(fault.getFaultName(), new BindingFaultInfo(fault, this)); } - } - + } + if (opinfo.isUnwrappedCapable()) { opHolder = new BindingOperationInfo(bi, opinfo.getUnwrappedOperation(), this); } @@ -81,17 +81,17 @@ public class BindingOperationInfo extends AbstractPropertiesHolder { if (opInfo.isUnwrappedCapable() && opHolder == null) { opHolder = new BindingOperationInfo(bindingInfo, opInfo.getUnwrappedOperation(), this); - } + } } - + public BindingInfo getBinding() { return bindingInfo; } - + public QName getName() { return opInfo.getName(); } - + public OperationInfo getOperationInfo() { return opInfo; } @@ -99,11 +99,11 @@ public class BindingOperationInfo extends AbstractPropertiesHolder { public BindingMessageInfo getInput() { return inputMessage; } - + public BindingMessageInfo getOutput() { return outputMessage; } - + public BindingFaultInfo getFault(QName name) { if (faults != null) { return faults.get(name); @@ -116,7 +116,7 @@ public class BindingOperationInfo extends AbstractPropertiesHolder { } return Collections.unmodifiableCollection(faults.values()); } - + public boolean isUnwrappedCapable() { return opInfo.isUnwrappedCapable(); } @@ -139,12 +139,12 @@ public class BindingOperationInfo extends AbstractPropertiesHolder { .append(getName() == null ? "" : getName()) .append("]").toString(); } - - + + public int hashCode() { return opInfo.hashCode(); } - + public boolean equals(Object o) { if (o == this) { return true; http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/DescriptionInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/DescriptionInfo.java b/core/src/main/java/org/apache/cxf/service/model/DescriptionInfo.java index 7fdc170..03f61e3 100644 --- a/core/src/main/java/org/apache/cxf/service/model/DescriptionInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/DescriptionInfo.java @@ -32,22 +32,22 @@ public class DescriptionInfo extends AbstractPropertiesHolder implements NamedIt public DescriptionInfo() { } - + public void setName(QName n) { name = n; } public QName getName() { return name; } - + public void setBaseURI(String u) { uri = u; } - + public String getBaseURI() { return uri; } - + public List getDescribed() { return described; } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/EndpointInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/EndpointInfo.java b/core/src/main/java/org/apache/cxf/service/model/EndpointInfo.java index 64a0d77..9d5dcc2 100644 --- a/core/src/main/java/org/apache/cxf/service/model/EndpointInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/EndpointInfo.java @@ -33,15 +33,15 @@ public class EndpointInfo extends AbstractDescriptionElement implements NamedIte BindingInfo binding; QName name; EndpointReferenceType address; - + public EndpointInfo() { } - + public EndpointInfo(ServiceInfo serv, String ns) { transportId = ns; service = serv; } - + public DescriptionInfo getDescription() { if (service == null) { return null; @@ -49,33 +49,33 @@ public class EndpointInfo extends AbstractDescriptionElement implements NamedIte return service.getDescription(); } - + public String getTransportId() { return transportId; - } - + } + public void setTransportId(String tid) { transportId = tid; } - + public InterfaceInfo getInterface() { if (service == null) { return null; } return service.getInterface(); } - + public void setService(ServiceInfo s) { service = s; } public ServiceInfo getService() { return service; } - + public QName getName() { return name; } - + public void setName(QName n) { name = n; } @@ -83,15 +83,15 @@ public class EndpointInfo extends AbstractDescriptionElement implements NamedIte public BindingInfo getBinding() { return binding; } - + public void setBinding(BindingInfo b) { binding = b; - } - + } + public String getAddress() { return (null != address && null != address.getAddress()) ? address.getAddress().getValue() : null; } - + public void setAddress(String addr) { if (null == address) { address = EndpointReferenceUtils.getEndpointReference(addr); @@ -99,29 +99,29 @@ public class EndpointInfo extends AbstractDescriptionElement implements NamedIte EndpointReferenceUtils.setAddress(address, addr); } } - + public void setAddress(EndpointReferenceType endpointReference) { address = endpointReference; } - + @Override public T getTraversedExtensor(T defaultValue, Class type) { T value = getExtensor(type); - + if (value == null) { if (binding != null) { value = binding.getExtensor(type); } - + if (service != null && value == null) { value = service.getExtensor(type); } - + if (value == null) { value = defaultValue; } } - + return value; } @@ -136,8 +136,8 @@ public class EndpointInfo extends AbstractDescriptionElement implements NamedIte if (epInfo == null) { return false; } - return binding.getName().equals(epInfo.binding.getName()) - && service.getName().equals(epInfo.service.getName()) + return binding.getName().equals(epInfo.binding.getName()) + && service.getName().equals(epInfo.service.getName()) && name.equals(epInfo.name); } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/Extensible.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/Extensible.java b/core/src/main/java/org/apache/cxf/service/model/Extensible.java index 599575f..9c73c5b 100644 --- a/core/src/main/java/org/apache/cxf/service/model/Extensible.java +++ b/core/src/main/java/org/apache/cxf/service/model/Extensible.java @@ -25,22 +25,22 @@ import java.util.Map; import javax.xml.namespace.QName; /** - * + * */ public interface Extensible { T getExtensor(Class cls); - + List getExtensors(Class cls); - + void addExtensor(Object el); - + Object getExtensionAttribute(QName name); - + Map getExtensionAttributes(); - + void addExtensionAttribute(QName name, Object attr); - + void setExtensionAttributes(Map attrs); - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/FaultInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/FaultInfo.java b/core/src/main/java/org/apache/cxf/service/model/FaultInfo.java index 16e8a34..49a7daa 100644 --- a/core/src/main/java/org/apache/cxf/service/model/FaultInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/FaultInfo.java @@ -23,25 +23,25 @@ import javax.xml.namespace.QName; public class FaultInfo extends AbstractMessageContainer { private QName faultName; - + public FaultInfo(QName fname, QName mname, OperationInfo info) { super(info, mname); faultName = fname; } - + public QName getFaultName() { return faultName; } public void setFaultName(QName fname) { faultName = fname; } - - - + + + public int hashCode() { return faultName == null ? -1 : faultName.hashCode(); } - + public boolean equals(Object o) { if (o == this) { return true; @@ -51,9 +51,9 @@ public class FaultInfo extends AbstractMessageContainer { return false; } FaultInfo oi = (FaultInfo)o; - return equals(faultName, oi.faultName) + return equals(faultName, oi.faultName) && super.equals(o); } - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java b/core/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java index 0b642d6..6dc7bbf 100644 --- a/core/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java @@ -32,12 +32,12 @@ import org.apache.cxf.common.logging.LogUtils; public class InterfaceInfo extends AbstractDescriptionElement implements NamedItem { private static final Logger LOG = LogUtils.getL7dLogger(InterfaceInfo.class); - + QName name; ServiceInfo service; - + Map operations = new ConcurrentHashMap(4, 0.75f, 2); - + public InterfaceInfo(ServiceInfo info, QName q) { name = q; service = info; @@ -53,15 +53,15 @@ public class InterfaceInfo extends AbstractDescriptionElement implements NamedIt public ServiceInfo getService() { return service; } - + public void setName(QName n) { name = n; } public QName getName() { return name; } - - + + /** * Adds an operation to this service. * @@ -72,7 +72,7 @@ public class InterfaceInfo extends AbstractDescriptionElement implements NamedIt if (oname == null) { throw new NullPointerException( new Message("OPERATION.NAME.NOT.NULL", LOG).toString()); - } + } if (operations.containsKey(oname)) { throw new IllegalArgumentException( new Message("DUPLICATED.OPERATION.NAME", LOG, new Object[]{oname}).toString()); @@ -91,7 +91,7 @@ public class InterfaceInfo extends AbstractDescriptionElement implements NamedIt void addOperation(OperationInfo operation) { operations.put(operation.getName(), operation); } - + /** * Removes an operation from this service. * @@ -99,7 +99,7 @@ public class InterfaceInfo extends AbstractDescriptionElement implements NamedIt */ public void removeOperation(OperationInfo operation) { operations.remove(operation.getName()); - } + } /** * Returns the operation info with the given name, if found. @@ -118,7 +118,7 @@ public class InterfaceInfo extends AbstractDescriptionElement implements NamedIt */ public Collection getOperations() { return Collections.unmodifiableCollection(operations.values()); - } - - + } + + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/MessageInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/MessageInfo.java b/core/src/main/java/org/apache/cxf/service/model/MessageInfo.java index 27f1ed9..d8e4d97 100644 --- a/core/src/main/java/org/apache/cxf/service/model/MessageInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/MessageInfo.java @@ -33,23 +33,23 @@ import org.apache.cxf.common.util.StringUtils; * A message for an operation. */ public class MessageInfo extends AbstractMessageContainer { - + public enum Type { INPUT, OUTPUT; } - + private Type type; - + public MessageInfo(OperationInfo op, Type type, QName nm) { super(op, nm); this.type = type; } - + public void setName(QName qn) { mName = qn; } - + public Map getMessagePartsMap() { Map partsMap = new HashMap(); for (MessagePartInfo part : getMessageParts()) { @@ -58,11 +58,11 @@ public class MessageInfo extends AbstractMessageContainer { return partsMap; } - public List getOrderedParts(List order) { + public List getOrderedParts(List order) { if (StringUtils.isEmpty(order)) { return getMessageParts(); } - + List orderedParts = new ArrayList<>(); Map partsMap = getMessagePartsMap(); for (String part : order) { @@ -84,6 +84,6 @@ public class MessageInfo extends AbstractMessageContainer { public void setType(Type type) { this.type = type; } - - + + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java b/core/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java index 61f0b2e..c5baa8c 100644 --- a/core/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/MessagePartInfo.java @@ -28,7 +28,7 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N private QName pname; private AbstractMessageContainer mInfo; - + private boolean isElement; private QName typeName; private QName elementName; @@ -36,12 +36,12 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N private XmlSchemaAnnotated xmlSchema; private Class typeClass; private int index; - + public MessagePartInfo(QName n, AbstractMessageContainer info) { mInfo = info; pname = n; } - + public void setMessageContainer(AbstractMessageContainer info) { mInfo = info; } @@ -58,22 +58,22 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N public void setName(QName n) { pname = n; } - + public QName getConcreteName() { return concreteName; } - + public void setConcreteName(QName concreteName) { this.concreteName = concreteName; } - public boolean isElement() { + public boolean isElement() { return isElement; } public void setElement(boolean b) { isElement = b; } - + public QName getElementQName() { if (isElement) { return elementName; @@ -100,7 +100,7 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N elementName = qn; concreteName = qn; } - + public AbstractMessageContainer getMessageInfo() { return mInfo; } @@ -136,11 +136,11 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N .append(", ConcreteName=") .append(getConcreteName()).toString(); } - + public int hashCode() { return pname == null ? -1 : pname.hashCode(); } - + public boolean equals(Object o) { if (o == this) { return true; @@ -149,7 +149,7 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N return false; } MessagePartInfo oi = (MessagePartInfo)o; - return equals(pname, oi.pname) + return equals(pname, oi.pname) && isElement == oi.isElement && equals(typeName, oi.typeName) && equals(elementName, oi.elementName) @@ -157,5 +157,5 @@ public final class MessagePartInfo extends AbstractPropertiesHolder implements N && equals(typeClass, oi.typeClass); } - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/OperationInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/OperationInfo.java b/core/src/main/java/org/apache/cxf/service/model/OperationInfo.java index 11efb1a..b4a64ac 100644 --- a/core/src/main/java/org/apache/cxf/service/model/OperationInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/OperationInfo.java @@ -41,12 +41,12 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem MessageInfo outputMessage; Map faults; OperationInfo unwrappedOperation; - List parameterOrdering; + List parameterOrdering; public OperationInfo() { } - - OperationInfo(InterfaceInfo it, QName n) { + + OperationInfo(InterfaceInfo it, QName n) { intf = it; setName(n); } @@ -54,7 +54,7 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem intf = op.getInterface(); setName(op.getName()); } - + /** * Returns the name of the Operation. * @return the name of the Operation @@ -68,15 +68,15 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem */ public final void setName(QName name) { if (name == null) { - throw new NullPointerException("Operation Name cannot be null."); - } + throw new NullPointerException("Operation Name cannot be null."); + } opName = name; } public InterfaceInfo getInterface() { return intf; } - + public MessageInfo createMessage(QName nm, MessageInfo.Type type) { return new MessageInfo(this, type, nm); } @@ -93,7 +93,7 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem if (unwrappedOperation != null && unwrappedOperation.getOutput() != null) { unwrappedOperation.getOutput().setDelegate(out, false); } - } + } public boolean hasOutput() { return outputMessage != null; } @@ -114,15 +114,15 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem public boolean hasInput() { return inputMessage != null; } - + public boolean isOneWay() { return inputMessage != null && outputMessage == null; } - + public boolean isUnwrappedCapable() { return unwrappedOperation != null; } - + public OperationInfo getUnwrappedOperation() { return unwrappedOperation; } @@ -132,8 +132,8 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem public boolean isUnwrapped() { return false; } - - + + /** * Adds an fault to this operation. * @@ -142,7 +142,7 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem public FaultInfo addFault(QName name, QName message) { if (name == null) { throw new NullPointerException(new Message("FAULT.NAME.NOT.NULL", LOG).toString()); - } + } if (faults != null && faults.containsKey(name)) { throw new IllegalArgumentException( new Message("DUPLICATED.FAULT.NAME", LOG, new Object[] {name}).toString()); @@ -158,7 +158,7 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem * @param fault the fault. */ public synchronized void addFault(FaultInfo fault) { - if (faults == null) { + if (faults == null) { faults = new ConcurrentHashMap(4, 0.75f, 2); } faults.put(fault.getFaultName(), fault); @@ -187,7 +187,7 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem } return null; } - + public boolean hasFaults() { return faults != null && faults.size() > 0; } @@ -203,26 +203,26 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem } return Collections.unmodifiableCollection(faults.values()); } - + public void setParameterOrdering(List o) { this.parameterOrdering = o; } - + public List getParameterOrdering() { return parameterOrdering; } - + @Override public String toString() { return new StringBuilder().append("[OperationInfo: ") .append(opName) .append("]").toString(); } - + public int hashCode() { return opName == null ? -1 : opName.hashCode(); } - + public boolean equals(Object o) { if (o == this) { return true; @@ -232,11 +232,11 @@ public class OperationInfo extends AbstractPropertiesHolder implements NamedItem return false; } OperationInfo oi = (OperationInfo)o; - return equals(opName, oi.opName) + return equals(opName, oi.opName) && equals(inputMessage, oi.inputMessage) && equals(outputMessage, oi.outputMessage) && equals(faults, oi.faults) - && equals(intf.getName(), oi.intf.getName()); + && equals(intf.getName(), oi.intf.getName()); } - + } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/ServiceInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/ServiceInfo.java b/core/src/main/java/org/apache/cxf/service/model/ServiceInfo.java index 99697f7..934f05b 100644 --- a/core/src/main/java/org/apache/cxf/service/model/ServiceInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/ServiceInfo.java @@ -46,7 +46,7 @@ public class ServiceInfo extends AbstractDescriptionElement implements NamedItem public ServiceInfo() { xmlSchemaCollection = new SchemaCollection(); } - + public DescriptionInfo getDescription() { return description; } @@ -159,7 +159,7 @@ public class ServiceInfo extends AbstractDescriptionElement implements NamedItem public void addSchema(SchemaInfo schemaInfo) { schemas.add(schemaInfo); } - + public SchemaInfo addNewSchema(String namespaceURI) { SchemaInfo schemaInfo = new SchemaInfo(namespaceURI); schemaInfo.setSchema(getXmlSchemaCollection(). http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java b/core/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java index 52c4283..1b32beb 100644 --- a/core/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java +++ b/core/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java @@ -183,7 +183,7 @@ public final class ServiceModelUtil { return best; } - + public static QName getServiceQName(EndpointInfo ei) { InterfaceInfo ii = ei.getInterface(); if (ii != null) { @@ -193,6 +193,6 @@ public final class ServiceModelUtil { } else { return ei.getName(); } - + } } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/ServiceSchemaInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/ServiceSchemaInfo.java b/core/src/main/java/org/apache/cxf/service/model/ServiceSchemaInfo.java index 39891bb..b9122c5 100644 --- a/core/src/main/java/org/apache/cxf/service/model/ServiceSchemaInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/ServiceSchemaInfo.java @@ -28,14 +28,14 @@ import org.w3c.dom.Element; import org.apache.cxf.common.xmlschema.SchemaCollection; /** - * The ServiceInfo class has schema in two forms: the XmlSchema, in a SchemaCollection, and the + * The ServiceInfo class has schema in two forms: the XmlSchema, in a SchemaCollection, and the * DOM trees in the SchemaInfo objects. This class exists in order to allow the WSDL cache to store both. */ public class ServiceSchemaInfo { private SchemaCollection schemaCollection; private List schemaInfoList; private Map schemaElementList; - + public SchemaCollection getSchemaCollection() { return schemaCollection; } http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java b/core/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java index bc6534e..0f636a6 100644 --- a/core/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java +++ b/core/src/main/java/org/apache/cxf/service/model/UnwrappedOperationInfo.java @@ -31,11 +31,11 @@ public class UnwrappedOperationInfo extends OperationInfo { wrappedOp = op; setDelegate(wrappedOp, true); } - + public OperationInfo getWrappedOperation() { return wrappedOp; } - + public boolean isUnwrapped() { return true; } @@ -43,20 +43,20 @@ public class UnwrappedOperationInfo extends OperationInfo { public FaultInfo addFault(QName name, QName message) { return wrappedOp.addFault(name, message); } - + public FaultInfo getFault(QName name) { return wrappedOp.getFault(name); } - + public Collection getFaults() { return wrappedOp.getFaults(); } - - + + public void setOutput(String nm, MessageInfo out) { super.setOutput(nm, out); out.setDelegate(wrappedOp.getOutput(), false); - } + } public void setInput(String nm, MessageInfo in) { super.setInput(nm, in); http://git-wip-us.apache.org/repos/asf/cxf/blob/8cea7c87/core/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java b/core/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java index c739f96..a841eb9 100644 --- a/core/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java +++ b/core/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java @@ -38,9 +38,9 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { private ElementFrame frame; - + /** - * + * */ public static class ElementFrame { T element; @@ -48,18 +48,18 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { boolean started; boolean ended; - + List uris; List prefixes; List attributes; final ElementFrame parent; - + public ElementFrame(T element, ElementFrame parent) { this.element = element; this.parent = parent; } - + public ElementFrame(T element, ElementFrame parent, I ch) { this.element = element; this.parent = parent; @@ -75,7 +75,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { } public ElementFrame(T doc) { this(doc, true); - } + } public T getElement() { return element; } @@ -108,7 +108,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#getProperty(java.lang.String) */ public Object getProperty(String key) throws IllegalArgumentException { @@ -117,7 +117,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#next() */ public int next() throws XMLStreamException { @@ -149,7 +149,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { } else { frame.ended = true; if (frame.isDocument()) { - currentEvent = END_DOCUMENT; + currentEvent = END_DOCUMENT; } else { currentEvent = END_ELEMENT; endElement(); @@ -170,7 +170,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#require(int, java.lang.String, * java.lang.String) */ @@ -180,7 +180,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#getElementText() */ public abstract String getElementText() throws XMLStreamException; @@ -189,16 +189,16 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { frame.started = true; frame.ended = true; if (frame.isDocument()) { - currentEvent = END_DOCUMENT; + currentEvent = END_DOCUMENT; } else { currentEvent = END_ELEMENT; endElement(); } } - + /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#nextTag() */ public int nextTag() throws XMLStreamException { @@ -213,18 +213,18 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#hasNext() */ public boolean hasNext() throws XMLStreamException { - + return !(frame.ended && (frames.size() == 0 || frame.isDocumentFragment())); } /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#close() */ public void close() throws XMLStreamException { @@ -232,14 +232,14 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#getNamespaceURI(java.lang.String) */ public abstract String getNamespaceURI(String prefix); /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#isStartElement() */ public boolean isStartElement() { @@ -248,7 +248,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#isEndElement() */ public boolean isEndElement() { @@ -257,7 +257,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#isCharacters() */ public boolean isCharacters() { @@ -266,7 +266,7 @@ public abstract class AbstractDOMStreamReader implements XMLStreamReader { /* * (non-Javadoc) - * + * * @see javax.xml.stream.XMLStreamReader#isWhiteSpace() */ public boolean isWhiteSpace() {