org.apache.muse.tools.inspector
Class ResourceInspector

java.lang.Object
  extended by org.apache.muse.tools.inspector.ResourceInspector

public class ResourceInspector
extends Object

This tool allows a client to dynamically discover the properties and operations of a resource by parsing its WSDL. The inspector provides all of the data structures necessary to invoke operations with the proper SOAP messages and to reason about properties and their metadata. Its chief use is as the data model to the client generator that converts WSDL to a Java interface/class.

The inspector can also be used in browser/explorer-like clients that do not know anything about the resource interfaces they will communicate with ahead of time. By providing a WSDL, a client can show (via UI) a user all of the properties and operations that are available, as well as a list of what parameters/return types to expect. The inspector can take care of converting input parameter values into the proper SOAP messages based on the WSDL, and then convert the response message back to the expected type.

Author:
Dan Jemiolo (danj), Andrew Eberbach (aeberbac)

Field Summary
static QName ANY_TYPE_QNAME
           
static QName ANY_URI_QNAME
           
static QName ATTRIBUTE_GROUP_QNAME
           
static QName ATTRIBUTE_QNAME
           
static QName BOOLEAN_QNAME
           
static QName COMPLEX_TYPE_QNAME
           
static QName DATE_QNAME
           
static QName DATE_TIME_QNAME
           
static QName DOUBLE_QNAME
           
static QName DURATION_QNAME
           
static QName ELEMENT_QNAME
           
static QName FLOAT_QNAME
           
static QName IMPORT_QNAME
           
static QName INCLUDE_QNAME
           
static QName INT_QNAME
           
static QName INTEGER_QNAME
           
static QName LANGSTRING_QNAME
           
static QName LONG_QNAME
           
static String NAMESPACE_URI
           
static QName NC_NAME_QNAME
           
static String PREFIX
           
static QName QNAME_QNAME
           
static QName SCHEMA_QNAME
           
static QName SEQUENCE_QNAME
           
static QName SHORT_QNAME
           
static QName SIMPLE_TYPE_QNAME
           
static QName STRING_QNAME
           
 
Constructor Summary
ResourceInspector()
           
 
Method Summary
 String getAction(String operation)
           
 Class getBaseProxyClass()
           
 Map getJavaMethods()
           
static String getLowerCamelName(String operationName)
           
 MetadataDescriptor getMetadata()
           
 Collection getOperations()
           
 String[] getParameterNames(String operation)
           
 QName[] getParameterQNames(String operation)
           
 QName[] getParameterSchemaTypes(String operation)
           
 Class[] getParameterTypes(String operation)
           
 QName getPortType()
           
 Collection getProperties()
           
 Class getPropertyType(QName property)
           
 QName getRequestName(String operation)
           
 QName getReturnName(String operation)
           
 QName getReturnSchemaType(String operation)
           
 Class getReturnType(String operation)
           
static QName getSchemaType(Class type)
           
static Class getXsdJavaType(QName typeName)
           
 Object invoke(WsResourceClient resource, String operation, Object[] parameters)
          This method will invoke form the proper SOAP request for the given operation and parameters and send it to the resource represented by the given client.
 boolean isBasicResourceOperation(QName name)
           
 boolean isBasicResourceOperation(String name)
           
 boolean isPropertyAppendable(QName property)
           
 boolean isPropertyMultiple(QName property)
           
 boolean isPropertyMutable(QName property)
           
 void run(Element wsdl)
           
 void run(Element wsdl, Environment env)
           
 void setMetadata(MetadataDescriptor descriptor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE_URI

public static final String NAMESPACE_URI
See Also:
Constant Field Values

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

ANY_TYPE_QNAME

public static final QName ANY_TYPE_QNAME

ANY_URI_QNAME

public static final QName ANY_URI_QNAME

ATTRIBUTE_GROUP_QNAME

public static final QName ATTRIBUTE_GROUP_QNAME

ATTRIBUTE_QNAME

public static final QName ATTRIBUTE_QNAME

BOOLEAN_QNAME

public static final QName BOOLEAN_QNAME

COMPLEX_TYPE_QNAME

public static final QName COMPLEX_TYPE_QNAME

DATE_QNAME

public static final QName DATE_QNAME

DATE_TIME_QNAME

public static final QName DATE_TIME_QNAME

DOUBLE_QNAME

public static final QName DOUBLE_QNAME

DURATION_QNAME

public static final QName DURATION_QNAME

ELEMENT_QNAME

public static final QName ELEMENT_QNAME

FLOAT_QNAME

public static final QName FLOAT_QNAME

IMPORT_QNAME

public static final QName IMPORT_QNAME

INCLUDE_QNAME

public static final QName INCLUDE_QNAME

INT_QNAME

public static final QName INT_QNAME

INTEGER_QNAME

public static final QName INTEGER_QNAME

LANGSTRING_QNAME

public static final QName LANGSTRING_QNAME

LONG_QNAME

public static final QName LONG_QNAME

NC_NAME_QNAME

public static final QName NC_NAME_QNAME

QNAME_QNAME

public static final QName QNAME_QNAME

SCHEMA_QNAME

public static final QName SCHEMA_QNAME

SEQUENCE_QNAME

public static final QName SEQUENCE_QNAME

SHORT_QNAME

public static final QName SHORT_QNAME

SIMPLE_TYPE_QNAME

public static final QName SIMPLE_TYPE_QNAME

STRING_QNAME

public static final QName STRING_QNAME
Constructor Detail

ResourceInspector

public ResourceInspector()
Method Detail

getLowerCamelName

public static String getLowerCamelName(String operationName)

getSchemaType

public static QName getSchemaType(Class type)
Parameters:
type - A Class representing the Java type that maps to the XSD type.
Returns:
The QName of the XSD type representing the given Java type, or ANY_TYPE_QNAME if no such mapping exists.

getXsdJavaType

public static Class getXsdJavaType(QName typeName)
Parameters:
typeName - The _name of an XSD built-in type (or WS-A EndpointReference).
Returns:
A Class representing the Java type that maps to the XSD type, or null if no mapping exists.

getAction

public String getAction(String operation)

getBaseProxyClass

public Class getBaseProxyClass()

getJavaMethods

public Map getJavaMethods()

getOperations

public Collection getOperations()

getParameterNames

public String[] getParameterNames(String operation)

getParameterQNames

public QName[] getParameterQNames(String operation)

getParameterSchemaTypes

public QName[] getParameterSchemaTypes(String operation)

getParameterTypes

public Class[] getParameterTypes(String operation)

getPortType

public QName getPortType()

getProperties

public Collection getProperties()

getPropertyType

public Class getPropertyType(QName property)

getRequestName

public QName getRequestName(String operation)

getReturnName

public QName getReturnName(String operation)

getReturnSchemaType

public QName getReturnSchemaType(String operation)

getReturnType

public Class getReturnType(String operation)

invoke

public Object invoke(WsResourceClient resource,
                     String operation,
                     Object[] parameters)
              throws SoapFault
This method will invoke form the proper SOAP request for the given operation and parameters and send it to the resource represented by the given client. The response is the content of the SOAP response's Body, deserialized into POJO form.

Throws:
SoapFault

isBasicResourceOperation

public boolean isBasicResourceOperation(QName name)

isBasicResourceOperation

public boolean isBasicResourceOperation(String name)

isPropertyAppendable

public boolean isPropertyAppendable(QName property)

isPropertyMultiple

public boolean isPropertyMultiple(QName property)

isPropertyMutable

public boolean isPropertyMutable(QName property)

run

public void run(Element wsdl)

run

public void run(Element wsdl,
                Environment env)

setMetadata

public void setMetadata(MetadataDescriptor descriptor)

getMetadata

public MetadataDescriptor getMetadata()


Copyright © 2005-2011 Apache Web Services - Muse. All Rights Reserved.