You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ba...@apache.org on 2007/02/22 22:39:55 UTC
svn commit: r510658 - in /webservices/axis2/trunk/java/modules:
jaxws/src/org/apache/axis2/jaxws/spi/
metadata/src/org/apache/axis2/jaxws/description/
metadata/src/org/apache/axis2/jaxws/description/impl/
Author: barrettj
Date: Thu Feb 22 13:39:54 2007
New Revision: 510658
URL: http://svn.apache.org/viewvc?view=rev&rev=510658
Log:
Update javadoc in DescriptionFactory
Modified:
webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java?view=diff&rev=510658&r1=510657&r2=510658
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/spi/ServiceDelegate.java Thu Feb 22 13:39:54 2007
@@ -100,7 +100,7 @@
throws WebServiceException {
EndpointDescription endpointDesc =
- DescriptionFactory.updateEndpoint(serviceDescription, null, portName, ServiceDescription.UpdateType.ADD_PORT);
+ DescriptionFactory.updateEndpoint(serviceDescription, null, portName, DescriptionFactory.UpdateType.ADD_PORT);
// TODO: Need to set endpointAddress and set or check bindingId on the EndpointDesc
endpointDesc.setEndpointAddress(endpointAddress);
endpointDesc.setClientBindingID(bindingId);
@@ -118,7 +118,7 @@
}
EndpointDescription endpointDesc =
- DescriptionFactory.updateEndpoint(serviceDescription, null, qname, ServiceDescription.UpdateType.CREATE_DISPATCH);
+ DescriptionFactory.updateEndpoint(serviceDescription, null, qname, DescriptionFactory.UpdateType.CREATE_DISPATCH);
if (endpointDesc == null) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("createDispatchFail2", qname.toString()));
}
@@ -152,7 +152,7 @@
}
EndpointDescription endpointDesc =
- DescriptionFactory.updateEndpoint(serviceDescription, null, qname, ServiceDescription.UpdateType.CREATE_DISPATCH);
+ DescriptionFactory.updateEndpoint(serviceDescription, null, qname, DescriptionFactory.UpdateType.CREATE_DISPATCH);
if (endpointDesc == null) {
throw ExceptionFactory.makeWebServiceException(Messages.getMessage("createDispatchFail2", qname.toString()));
}
@@ -206,7 +206,7 @@
}
EndpointDescription endpointDesc =
- DescriptionFactory.updateEndpoint(serviceDescription, sei, portName, ServiceDescription.UpdateType.GET_PORT);
+ DescriptionFactory.updateEndpoint(serviceDescription, sei, portName, DescriptionFactory.UpdateType.GET_PORT);
if (endpointDesc == null) {
// TODO: NLS
throw ExceptionFactory.makeWebServiceException("Unable to getPort for port QName " + portName.toString());
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java?view=diff&rev=510658&r1=510657&r2=510658
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/DescriptionFactory.java Thu Feb 22 13:39:54 2007
@@ -30,39 +30,112 @@
/**
* Creates the JAX-WS metadata descritpion hierachy from some combinations of
- * WSDL, Java classes with annotations, and (in the future) deployment descriptors.
+ * WSDL, Java class information including annotations, and (in the future) deployment descriptors.
*/
public class DescriptionFactory {
/**
+ * The type of update being done for a particular Port. This is used by the JAX-WS
+ * service delegate on the CLIENT side. This is used as a parameter to the
+ * updateEndpoint factory method. An EndpointDescription will be returned corresponding
+ * to the port.
+ * GET_PORT: Return an SEI-based pre-existing port
+ * ADD_PORT: Return a Dispatch-only non-pre-existing port
+ * CREATE_DISPATCH: Return a Dispatch port; this is valid on either a
+ * pre-existing port (e.g. GET_PORT) or dynamic port (ADD_PORT)
+ *
+ */
+ public static enum UpdateType {GET_PORT, ADD_PORT, CREATE_DISPATCH}
+ /**
* A DescrptionFactory can not be instantiated; all methods are static.
*/
private DescriptionFactory() {
}
+ /**
+ * Create the initial ServiceDescription hierachy on the CLIENT side. This is intended to be
+ * called when the client creates a ServiceDelegate. Note that it will only create
+ * the ServiceDescription at this point. The EndpointDescription hierachy under this
+ * ServiceDescription will be created by the updateEndpoint factory method, which will be called
+ * by the ServiceDelegate once the port is known (i.e. addPort, getPort, or createDispatch).
+ *
+ * @see #updateEndpoint(ServiceDescription, Class, QName, org.apache.axis2.jaxws.description.ServiceDescription.UpdateType)
+ *
+ * @param wsdlURL URL to the WSDL file to use; this may be null
+ * @param serviceQName The ServiceQName for this service; may not be null
+ * @param serviceClass The Service class; may not be null and
+ * must be assignable from javax.xml.ws.Service
+ * @return A ServiceDescription instance for a CLIENT access to the service.
+ */
public static ServiceDescription createServiceDescription(URL wsdlURL, QName serviceQName, Class serviceClass) {
return DescriptionFactoryImpl.createServiceDescription(wsdlURL, serviceQName, serviceClass);
}
-
- // TODO: Taking an AxisService is only temporary; the AxisService should be created when creating the ServiceDesc
- public static ServiceDescription createServiceDescriptionFromServiceImpl(Class serviceImplClass, AxisService axisService) {
- return DescriptionFactoryImpl.createServiceDescriptionFromServiceImpl(serviceImplClass, axisService);
+
+ /**
+ * Retrieve or create the EndpointDescription hierachy associated with an existing CLIENT side
+ * ServiceDescription for a particular port. If an EndpointDescritption already exists, it will
+ * be returned; if one does not already exist, it will be created. Note that if the SEI is null
+ * then the EndpointDescription returned will be for a Dispatch client only and it will not have
+ * an EndpointInterfaceDescription hierachy associated with it. If, at a later point, the same
+ * port is requested and an SEI is provided, the existing EndpointDescription will be updated
+ * with a newly-created EndpointInterfaceDescription hieracy.
+ *
+ * @see #createServiceDescription(URL, QName, Class)
+ * @see DescriptionFactory.UpdateType
+ *
+ * @param serviceDescription An existing client-side ServiceDescription. This must not be null.
+ * @param sei The ServiceInterface class. This can be null for adding a port or creating a
+ * Dispatch; it can not be null when getting a port.
+ * @param portQName The QName of the port. If this is null, the runtime will attempt to
+ * to select an appropriate port to use.
+ * @param updateType The type of the update: adding a port, creating a dispatch, or
+ * getting an SEI-based port.
+ * @return An EndpointDescription corresponding to the port.
+ */
+ public static EndpointDescription updateEndpoint(ServiceDescription serviceDescription, Class sei, QName portQName, DescriptionFactory.UpdateType updateType ) {
+ return DescriptionFactoryImpl.updateEndpoint(serviceDescription, sei, portQName, updateType);
}
-
- //TODO: Determine whether this method is necessary...we may want to always build a
- //ServiceDescription based on a particular impl class
+
+ /**
+ * Create a full ServiceDescription hierachy on the SERVER side for EACH
+ * service implementation entry in the DescriptionBuilderComposite (DBC) map. Note that the
+ * associated SERVER side Axis description objects are also created.
+ *
+ * A service implementation DBC entry is one that:
+ * (1) Is a class and not an interface
+ * (2) Carries an @WebService or @WebServiceProvider annotation.
+ *
+ * A DBC represents the information found in the service implementation class. There
+ * will be other DBC entries in the map for classes and interfaces associated with the
+ * service implementation, such as super classes, super interfaces, fault classes, and
+ * such.
+ *
+ * Note that map may contain > 1 service implementation DBC. A full ServiceDescriptionHierachy
+ * will be created for each service implementation DBC entry.
+ *
+ * @param dbcMap A HashMap keyed on class name with a value for the DBC for that classname
+ * @return A List of ServiceDescriptions with the associated SERVER side hierachy created.
+ */
public static List<ServiceDescription> createServiceDescriptionFromDBCMap (
HashMap<String, DescriptionBuilderComposite> dbcMap) {
return DescriptionFactoryImpl.createServiceDescriptionFromDBCMap(dbcMap);
}
-
/**
- * Update an existing ServiceDescription with an annotated SEI
- * @param serviceDescription
- * @param seiClass
- * @param portName Can be null
- * @return
+ * DO NOT USE THIS METHOD FOR PRODUCTION CODE. It has been deprecated and is only used
+ * to drive some testing. Note that the AxisService and associated Axis description objects
+ * ARE NOT created or updated by this factory method.
+ *
+ * @deprecated Use {@link #createServiceDescriptionFromDBCMap(HashMap)}
+ *
+ * @param serviceImplClass A service implementation class with annotations
+ * @param axisService A FULLY POPULATED AxisService including all of the underlying
+ * description objects such as AxisOperations.
+ * @return A ServiceDescription hierachy constructed (via Java reflection) from the service
+ * implementation class and tied via properties to the existing AxisService object.
*/
- public static EndpointDescription updateEndpoint(ServiceDescription serviceDescription, Class sei, QName portQName, ServiceDescription.UpdateType updateType ) {
- return DescriptionFactoryImpl.updateEndpoint(serviceDescription, sei, portQName, updateType);
+ // TODO: Taking an AxisService is only temporary; the AxisService should be created when creating the ServiceDesc
+ public static ServiceDescription createServiceDescriptionFromServiceImpl(Class serviceImplClass, AxisService axisService) {
+ return DescriptionFactoryImpl.createServiceDescriptionFromServiceImpl(serviceImplClass, axisService);
}
+
+
}
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java?view=diff&rev=510658&r1=510657&r2=510658
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/ServiceDescription.java Thu Feb 22 13:39:54 2007
@@ -21,7 +21,7 @@
* EndpointInterfaceDescription
* OperationDescription[]
* ParameterDescription[]
- * FaultDescription[] (Note: Not implemented yet)
+ * FaultDescription[]
*
* <b>ServiceDescription details</b>
*
@@ -46,8 +46,6 @@
*/
public interface ServiceDescription {
- public enum UpdateType {GET_PORT, ADD_PORT, CREATE_DISPATCH}
-
public abstract EndpointDescription[] getEndpointDescriptions();
public abstract EndpointDescription getEndpointDescription(QName portQName);
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java?view=diff&rev=510658&r1=510657&r2=510658
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java Thu Feb 22 13:39:54 2007
@@ -32,6 +32,7 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.DescriptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
@@ -136,7 +137,7 @@
*/
public static EndpointDescription updateEndpoint(
ServiceDescription serviceDescription, Class sei, QName portQName,
- ServiceDescription.UpdateType updateType) {
+ DescriptionFactory.UpdateType updateType) {
EndpointDescription endpointDesc =
((ServiceDescriptionImpl) serviceDescription).updateEndpointDescription(sei, portQName, updateType);
if (log.isDebugEnabled()) {
Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=510658&r1=510657&r2=510658
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Thu Feb 22 13:39:54 2007
@@ -43,6 +43,7 @@
import org.apache.axis2.description.AxisService;
import org.apache.axis2.jaxws.ClientConfigurationFactory;
import org.apache.axis2.jaxws.ExceptionFactory;
+import org.apache.axis2.jaxws.description.DescriptionFactory;
import org.apache.axis2.jaxws.description.EndpointDescription;
import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
import org.apache.axis2.jaxws.description.ServiceDescription;
@@ -208,7 +209,7 @@
* port or a pre-existing dynamic port.
*/
- EndpointDescription updateEndpointDescription(Class sei, QName portQName, UpdateType updateType) {
+ EndpointDescription updateEndpointDescription(Class sei, QName portQName, DescriptionFactory.UpdateType updateType) {
EndpointDescriptionImpl endpointDescription = getEndpointDescriptionImpl(portQName);
boolean isPortDeclared = isPortDeclared(portQName);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org