com.sun.xml.ws.model
Class RuntimeModeler

java.lang.Object
  extended by com.sun.xml.ws.model.RuntimeModeler

public class RuntimeModeler
extends Object

Creates a runtime model of a SEI (portClass).


Field Summary
static String BEAN
           
static Class HOLDER_CLASS
           
static String JAXWS_PACKAGE_PD
           
static String PD_JAXWS_PACKAGE_PD
           
static String PORT
           
static Class<RemoteException> REMOTE_EXCEPTION_CLASS
           
static String RESPONSE
           
static String RETURN
           
static String SERVICE
           
 
Constructor Summary
RuntimeModeler(Class portClass, QName serviceName, BindingID bindingId)
          creates an instance of RunTimeModeler given a portClass and bindingId
RuntimeModeler(Class sei, QName serviceName, WSDLPortImpl wsdlPort)
          creates an instance of RunTimeModeler given a sei and binding
 
Method Summary
 AbstractSEIModelImpl buildRuntimeModel()
          builds the runtime model from the portClass using the binding ID bindingId.
static String capitalize(String name)
          utility to capitalize the first letter in a string
protected  SOAPBindingImpl createBinding(javax.jws.soap.SOAPBinding soapBinding)
          creates a runtime model SOAPBinding from a javax.jws.soap.SOAPBinding object
protected  void determineWebMethodUse(Class clazz)
           
static String getNamespace(String packageName)
          gets the namespace String for a given packageName
static QName getPortName(Class<?> implClass, String targetNamespace)
          gets the wsdl:portName for a given implementation class
static QName getPortTypeName(Class<?> implOrSeiClass)
          Gives portType QName from implementatorClass or SEI
static QName getServiceName(Class<?> implClass)
          gets the wsdl:serviceName for a given implementation class
protected  Method getWSDLExceptionFaultInfo(Class exception)
          returns the method that corresponds to "getFaultInfo".
protected  boolean isWebMethod(Method method, Class clazz)
           
(package private)  void processClass(Class clazz)
           
protected  void processDocBareMethod(JavaMethodImpl javaMethod, String methodName, javax.jws.WebMethod webMethod, String operationName, Method method, javax.jws.WebService webService)
          models a document/literal bare method
protected  void processDocWrappedMethod(JavaMethodImpl javaMethod, String methodName, javax.jws.WebMethod webMethod, String operationName, Method method, javax.jws.WebService webService)
          models a document/literal wrapped method
protected  void processExceptions(JavaMethodImpl javaMethod, Method method)
          models the exceptions thrown by method and adds them to the javaMethod runtime model object
protected  void processMethod(Method method, javax.jws.WebService webService)
          creates the runtime model for a method on the portClass
protected  void processRpcMethod(JavaMethodImpl javaMethod, String methodName, javax.jws.WebMethod webMethod, String operationName, Method method, javax.jws.WebService webService)
          models a rpc/literal method
 void setClassLoader(ClassLoader classLoader)
          sets the classloader to be used when loading classes by the RuntimeModeler.
 void setPortName(QName portName)
          sets the PortName to be used by the RuntimeModeler.
protected  void setUsesWebMethod(Class clazz, Boolean usesWebMethod)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PD_JAXWS_PACKAGE_PD

public static final String PD_JAXWS_PACKAGE_PD
See Also:
Constant Field Values

JAXWS_PACKAGE_PD

public static final String JAXWS_PACKAGE_PD
See Also:
Constant Field Values

RESPONSE

public static final String RESPONSE
See Also:
Constant Field Values

RETURN

public static final String RETURN
See Also:
Constant Field Values

BEAN

public static final String BEAN
See Also:
Constant Field Values

SERVICE

public static final String SERVICE
See Also:
Constant Field Values

PORT

public static final String PORT
See Also:
Constant Field Values

HOLDER_CLASS

public static final Class HOLDER_CLASS

REMOTE_EXCEPTION_CLASS

public static final Class<RemoteException> REMOTE_EXCEPTION_CLASS
Constructor Detail

RuntimeModeler

public RuntimeModeler(@NotNull
                      Class portClass,
                      @NotNull
                      QName serviceName,
                      @NotNull
                      BindingID bindingId)
creates an instance of RunTimeModeler given a portClass and bindingId

Parameters:
portClass - The SEI class to be modeled.
serviceName - The ServiceName to use instead of one calculated from the implementation class
bindingId - The binding identifier to be used when modeling the portClass.

RuntimeModeler

public RuntimeModeler(@NotNull
                      Class sei,
                      @NotNull
                      QName serviceName,
                      @NotNull
                      WSDLPortImpl wsdlPort)
creates an instance of RunTimeModeler given a sei and binding

Parameters:
sei - The SEI class to be modeled.
serviceName - The ServiceName to use instead of one calculated from the implementation class
wsdlPort - WSDLPort
Method Detail

setClassLoader

public void setClassLoader(ClassLoader classLoader)
sets the classloader to be used when loading classes by the RuntimeModeler.

Parameters:
classLoader - ClassLoader used to load classes

setPortName

public void setPortName(QName portName)
sets the PortName to be used by the RuntimeModeler.

Parameters:
portName - The PortName to be used instead of the PortName retrieved via annotations

buildRuntimeModel

public AbstractSEIModelImpl buildRuntimeModel()
builds the runtime model from the portClass using the binding ID bindingId.

Returns:
the runtime model for the portClass.

setUsesWebMethod

protected void setUsesWebMethod(Class clazz,
                                Boolean usesWebMethod)

determineWebMethodUse

protected void determineWebMethodUse(Class clazz)

processClass

void processClass(Class clazz)

isWebMethod

protected boolean isWebMethod(Method method,
                              Class clazz)

createBinding

protected SOAPBindingImpl createBinding(javax.jws.soap.SOAPBinding soapBinding)
creates a runtime model SOAPBinding from a javax.jws.soap.SOAPBinding object

Parameters:
soapBinding - the javax.jws.soap.SOAPBinding to model
Returns:
returns the runtime model SOAPBinding corresponding to soapBinding

getNamespace

public static String getNamespace(@NotNull
                                  String packageName)
gets the namespace String for a given packageName

Parameters:
packageName - the name of the package used to find a namespace. can be empty.
Returns:
the namespace for the specified packageName

processMethod

protected void processMethod(Method method,
                             javax.jws.WebService webService)
creates the runtime model for a method on the portClass

Parameters:
method - the method to model
webService - the instance of the WebService annotation on the portClass

processDocWrappedMethod

protected void processDocWrappedMethod(JavaMethodImpl javaMethod,
                                       String methodName,
                                       javax.jws.WebMethod webMethod,
                                       String operationName,
                                       Method method,
                                       javax.jws.WebService webService)
models a document/literal wrapped method

Parameters:
javaMethod - the runtime model JavaMethod instance being created
methodName - the runtime model JavaMethod instance being created
webMethod - the runtime model JavaMethod instance being created
operationName - the runtime model JavaMethod instance being created
method - the method to model
webService - The WebService annotation instance on the portClass

processRpcMethod

protected void processRpcMethod(JavaMethodImpl javaMethod,
                                String methodName,
                                javax.jws.WebMethod webMethod,
                                String operationName,
                                Method method,
                                javax.jws.WebService webService)
models a rpc/literal method

Parameters:
javaMethod - the runtime model JavaMethod instance being created
methodName - the name of the method being modeled.
webMethod - the WebMethod annotations instance on the method
operationName - the WSDL operation name for this method
method - the runtime model JavaMethod instance being created
webService - the runtime model JavaMethod instance being created

processExceptions

protected void processExceptions(JavaMethodImpl javaMethod,
                                 Method method)
models the exceptions thrown by method and adds them to the javaMethod runtime model object

Parameters:
javaMethod - the runtime model object to add the exception model objects to
method - the method from which to find the exceptions to model

getWSDLExceptionFaultInfo

protected Method getWSDLExceptionFaultInfo(Class exception)
returns the method that corresponds to "getFaultInfo". Returns null if this is not an exception generated from a WSDL

Parameters:
exception - the class to search for the "getFaultInfo" method
Returns:
the method named "getFaultInfo" if this is an exception generated from WSDL or an exception that contains the WebFault annotation. Otherwise it returns null

processDocBareMethod

protected void processDocBareMethod(JavaMethodImpl javaMethod,
                                    String methodName,
                                    javax.jws.WebMethod webMethod,
                                    String operationName,
                                    Method method,
                                    javax.jws.WebService webService)
models a document/literal bare method

Parameters:
javaMethod - the runtime model JavaMethod instance being created
methodName - the runtime model JavaMethod instance being created
webMethod - the runtime model JavaMethod instance being created
operationName - the runtime model JavaMethod instance being created
method - the runtime model JavaMethod instance being created
webService - the runtime model JavaMethod instance being created

capitalize

public static String capitalize(String name)
utility to capitalize the first letter in a string

Parameters:
name - the string to capitalize
Returns:
the capitalized string

getServiceName

public static QName getServiceName(Class<?> implClass)
gets the wsdl:serviceName for a given implementation class

Parameters:
implClass - the implementation class
Returns:
the wsdl:serviceName for the implClass

getPortName

public static QName getPortName(Class<?> implClass,
                                String targetNamespace)
gets the wsdl:portName for a given implementation class

Parameters:
implClass - the implementation class
targetNamespace - Namespace URI for service name
Returns:
the wsdl:portName for the implClass

getPortTypeName

public static QName getPortTypeName(Class<?> implOrSeiClass)
Gives portType QName from implementatorClass or SEI

Parameters:
implOrSeiClass - cant be null
Returns:
wsdl:portType@name, null if it could not find the annotated class.