You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by er...@apache.org on 2008/12/17 22:42:08 UTC
svn commit: r727521 - in /cxf/trunk:
api/src/main/java/org/apache/cxf/endpoint/
rt/core/src/main/java/org/apache/cxf/endpoint/
Author: ericjohnson
Date: Wed Dec 17 13:42:08 2008
New Revision: 727521
URL: http://svn.apache.org/viewvc?rev=727521&view=rev
Log:
adding some JavaDoc comments around the contract resolving mechanism
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolver.java
cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java
cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java
Modified: cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolver.java?rev=727521&r1=727520&r2=727521&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolver.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolver.java Wed Dec 17 13:42:08 2008
@@ -23,6 +23,20 @@
import javax.xml.namespace.QName;
+/**
+ * A <code>ServiceContractResolver</code> resolves QNames into URIs for
+ * WSDL contracts. They provide a method for locating WSDL contracts at
+ * runtime.
+ */
public interface ServiceContractResolver {
+
+ /**
+ * Resolves a QName to a URI representing the location of a WSDL contract.
+ * This method is called by the <code>ServiceContractResolverRegistry</code>
+ * with which the contract resolver is registered.
+ *
+ * @param qname the QName being mapped to a URI
+ * @return URI representing the location of a WSDL contract
+ */
URI getContractLocation(QName qname);
}
Modified: cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java?rev=727521&r1=727520&r2=727521&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistry.java Wed Dec 17 13:42:08 2008
@@ -23,10 +23,43 @@
import javax.xml.namespace.QName;
+/**
+ * A registry for maintaining a collection of contract resolvers.
+ */
public interface ServiceContractResolverRegistry {
+
+ /**
+ * Resolves a QName to a URI respresenting the location of a WSDL contract.
+ * The registry method is called by the bus and should use the
+ * <code>getContractLocation</code> methods of the registered contract
+ * resolvers to do the actual resolution.
+ *
+ * @param qname the qname to resolve into a URI
+ * @return URI representing the WSDL contract's location
+ */
URI getContractLocation(QName qname);
+
+ /**
+ * Registers a contract resolver.
+ *
+ * @param resolver the contract resolver being registered
+ */
void register(ServiceContractResolver resolver);
+
+ /**
+ * Removes a contract resolver from the registry.
+ *
+ * @param resolver the contract resolver being removed
+ */
void unregister(ServiceContractResolver resolver);
+
+ /**
+ * Determines if a contract resolver is already registered with a
+ * registry.
+ *
+ * @param resolver the contract resolver for which to search
+ * @return <code>true</code> if the contract resolver is already registered
+ */
boolean isRegistered(ServiceContractResolver resolver);
}
Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java?rev=727521&r1=727520&r2=727521&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/endpoint/ServiceContractResolverRegistryImpl.java Wed Dec 17 13:42:08 2008
@@ -28,6 +28,10 @@
import org.apache.cxf.Bus;
+/**
+ * A simple contract resolver registry. It maintains a list of contract resolvers in an
+ * <code>ArrayList</code>.
+ */
public class ServiceContractResolverRegistryImpl implements ServiceContractResolverRegistry {
private Bus bus;
@@ -44,6 +48,14 @@
}
}
+ /**
+ * Calls each of the registered <code>ServiceContractResolver</code> instances
+ * to resolve the location of the service's contract. It returns the location
+ * from the first resolver that matches the QName to a location.
+ *
+ * @param qname QName to be resolved into a contract location
+ * @return URI representing the location of the contract
+ */
public URI getContractLocation(QName qname) {
for (ServiceContractResolver resolver : resolvers) {
URI contractLocation = resolver.getContractLocation(qname);
@@ -54,18 +66,39 @@
return null;
}
+ /**
+ * Tests if a resolver is alreadey registered with this registry.
+ *
+ * @param resolver the contract resolver for which to searche
+ * @return <code>true</code> if the resolver is registered
+ */
public boolean isRegistered(ServiceContractResolver resolver) {
return resolvers.contains(resolver);
}
+ /**
+ * Registers a contract resolver with this registry.
+ *
+ * @param resolver the contract resolver to register
+ */
public synchronized void register(ServiceContractResolver resolver) {
resolvers.add(resolver);
}
+ /**
+ * Removes a contract resolver from this registry.
+ *
+ * @param resolver the contract resolver to remove
+ */
public synchronized void unregister(ServiceContractResolver resolver) {
resolvers.remove(resolver);
}
+ /**
+ * Sets the bus with which the registry is associated.
+ *
+ * @param bus
+ */
public void setBus(Bus bus) {
this.bus = bus;
}