WebObjects 5.4.2

com.webobjects.appserver
Class WOWSDDRegistrar

java.lang.Object
  extended by com.webobjects.appserver.WOWSDDRegistrar

public class WOWSDDRegistrar
extends Object

Registers WSDD types and services with WebObjects application.

Since:
5.4.1

Nested Class Summary
static interface WOWSDDRegistrar.Delegate
           
 
Constructor Summary
protected WOWSDDRegistrar()
           
 
Method Summary
protected  String createAllowedMethodsString(String[] allowedMethods)
          Create a String of all the allowed methods separated by ,
protected  String createServiceString(String webServiceName, Class webServiceClass, String[] allowedMethods, boolean isRPC, boolean isD2WS)
           
protected  List getDeclaredMethodsForClass(Class webServiceClass)
          Returns the list of declared method accessible on the the target web service class.
static WOWSDDRegistrar getInstance()
          Returns the single instance of the Registrar
protected  List getMethodsForNames(Class webServiceClass, String[] allowedMethods)
          Returns the list of method on the the target web service class.
protected  Collection getMethodsTypes(Collection methods)
          Returns a collection of class that are parameters or return values of the list of methods
 void registerD2WebServiceWithOperations(String webServiceName, String[] operations)
          Used by Direct To WebServices to register operations
 void registerFactoriesForClassWithQName(javax.xml.rpc.encoding.SerializerFactory aSerializerFactory, javax.xml.rpc.encoding.DeserializerFactory aDeserializerFactory, Class aClass, QName aQName)
          Register aSerializerFactory for serializing objects of class aClass and aDeserializerFactory for deserializing DOM elements with QName aQName.
 void registerTypeMapping(javax.xml.rpc.encoding.SerializerFactory aSerializerFactory, javax.xml.rpc.encoding.DeserializerFactory aDeserializerFactory, Class aClass, QName aQName)
          Register the WSDDTypeMapping for WSDD generation.
 void registerWebService(Class webServiceClass, boolean isRPC)
          Expose all methods declared on webServiceClass as operations on a web service whose name is the non-qualified class name of webServiceClass.
 void registerWebService(String webServiceName, Class webServiceClass, boolean isRPC)
          Expose all methods declared on webServiceClass as operations on a web service whose name is webServiceName.
 void registerWebService(String webServiceName, Class webServiceClass, String[] allowedMethods, boolean isRPC)
          Expose methods listed in allowedMethods declared on webServiceClass as operations on a web service whose name is webServiceName.
 void registerXSLTForServiceAndOperation(URL aURL, String serviceName, String operationName)
          Register an XSLT transformation for serviceName and operationName.
protected  String serviceStringCloseTag()
           
protected  String serviceStringD2WRPCProvider()
           
protected  String serviceStringDeclaration()
           
protected  String serviceStringMsgProvider()
           
protected  String serviceStringOpenTag(String name, boolean isRPC)
           
protected  String serviceStringParameterAllowedMethods(String[] allowedMethods)
           
protected  String serviceStringParameterClassName(String name)
           
protected  String serviceStringParameterNamespace()
           
protected  String serviceStringParameterScope()
           
protected  String serviceStringRPCProvider()
           
protected  String serviceStringTypeMappings(org.apache.axis.deployment.wsdd.WSDDTypeMapping typeMapping)
           
static void setDelegate(WOWSDDRegistrar.Delegate aDelegate)
          Set the class delegate.
 void setSecurityDelegate(Object aDelegate)
          Register aDelegate as the security delegate for Axis.
 String toString()
           
 void unregisterWebService(Class webServiceClass)
          Deregister the web service registered for webServiceClass.
 void unregisterWebService(String webServiceName)
          Deregister the web service registered with the name webServiceName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WOWSDDRegistrar

protected WOWSDDRegistrar()
Method Detail

getInstance

public static WOWSDDRegistrar getInstance()
Returns the single instance of the Registrar

Returns:
singleton for the Registrar

setDelegate

public static void setDelegate(WOWSDDRegistrar.Delegate aDelegate)
Set the class delegate. This enable easy subclassing of the registrar.

Parameters:
aDelegate -

registerWebService

public void registerWebService(Class webServiceClass,
                               boolean isRPC)
Expose all methods declared on webServiceClass as operations on a web service whose name is the non-qualified class name of webServiceClass.

Parameters:
webServiceClass - Class to be exposed as a web service
isRPC - boolean true if the service is RPC based false if document
Throws:
IllegalArgumentException - if webServiceClass is null, or if isRPC is false the number of declared methods on webServiceClass is not 1

registerWebService

public void registerWebService(String webServiceName,
                               Class webServiceClass,
                               boolean isRPC)
Expose all methods declared on webServiceClass as operations on a web service whose name is webServiceName.

Parameters:
webServiceName - the name under which the class should be exposed
webServiceClass - Class to be exposed as a web service
isRPC - boolean true if the service is RPC based false if document
Throws:
IllegalArgumentException - if webServiceName or webServiceClass are null, or if isRPC is false and the number of declared methods on webServiceClass is not 1

registerWebService

public void registerWebService(String webServiceName,
                               Class webServiceClass,
                               String[] allowedMethods,
                               boolean isRPC)
Expose methods listed in allowedMethods declared on webServiceClass as operations on a web service whose name is webServiceName.

Parameters:
webServiceName - the name under which the class should be exposed
webServiceClass - Class to be exposed as a web service
allowedMethods - array of Strings containing the names of methods to be exposed
isRPC - boolean true if the service is RPC based false if document
Throws:
IllegalArgumentException - if webServiceName or webServiceClass are null, or if isRPC is false and either allowedMethods is null or allowedMethods.length != 1

registerD2WebServiceWithOperations

public void registerD2WebServiceWithOperations(String webServiceName,
                                               String[] operations)
Used by Direct To WebServices to register operations

Parameters:
webServiceName - name of webservices
operations - String array of operations to be registered

unregisterWebService

public void unregisterWebService(Class webServiceClass)
Deregister the web service registered for webServiceClass. This method assumes that webServiceClass will be exposed under it's classname.

Parameters:
webServiceClass - the Class to be deregistered
Throws:
IllegalArgumentException - if webServiceClass is null

unregisterWebService

public void unregisterWebService(String webServiceName)
Deregister the web service registered with the name webServiceName.

Parameters:
webServiceName - the name of the service to be deregistered
Throws:
IllegalArgumentException - if webServiceName is null

getDeclaredMethodsForClass

protected List getDeclaredMethodsForClass(Class webServiceClass)
Returns the list of declared method accessible on the the target web service class.

Parameters:
webServiceClass - target web service class
Returns:
list of declared accessible methods

getMethodsForNames

protected List getMethodsForNames(Class webServiceClass,
                                  String[] allowedMethods)
Returns the list of method on the the target web service class.

Parameters:
webServiceClass - target web service class
allowedMethods - names of allowed methods
Returns:
list methods

getMethodsTypes

protected Collection getMethodsTypes(Collection methods)
Returns a collection of class that are parameters or return values of the list of methods

Parameters:
methods - target list of methods
Returns:
collection of classes

createServiceString

protected String createServiceString(String webServiceName,
                                     Class webServiceClass,
                                     String[] allowedMethods,
                                     boolean isRPC,
                                     boolean isD2WS)
Parameters:
webServiceName -
webServiceClass -
allowedMethods -
isRPC -
isD2WS -
Returns:
xml service string

serviceStringDeclaration

protected String serviceStringDeclaration()
Returns:

serviceStringOpenTag

protected String serviceStringOpenTag(String name,
                                      boolean isRPC)
Parameters:
name -
isRPC -
Returns:

serviceStringRPCProvider

protected String serviceStringRPCProvider()
Returns:

serviceStringMsgProvider

protected String serviceStringMsgProvider()
Returns:

serviceStringD2WRPCProvider

protected String serviceStringD2WRPCProvider()
Returns:

serviceStringParameterScope

protected String serviceStringParameterScope()
Returns:

serviceStringParameterClassName

protected String serviceStringParameterClassName(String name)
Parameters:
name -
Returns:

serviceStringParameterAllowedMethods

protected String serviceStringParameterAllowedMethods(String[] allowedMethods)
Parameters:
allowedMethods -
Returns:

serviceStringParameterNamespace

protected String serviceStringParameterNamespace()
Returns:

serviceStringTypeMappings

protected String serviceStringTypeMappings(org.apache.axis.deployment.wsdd.WSDDTypeMapping typeMapping)
Parameters:
typeMapping -
Returns:

serviceStringCloseTag

protected String serviceStringCloseTag()
Returns:

createAllowedMethodsString

protected String createAllowedMethodsString(String[] allowedMethods)
Create a String of all the allowed methods separated by ,

Parameters:
allowedMethods -
Returns:
String of allowed methods names

registerFactoriesForClassWithQName

public void registerFactoriesForClassWithQName(javax.xml.rpc.encoding.SerializerFactory aSerializerFactory,
                                               javax.xml.rpc.encoding.DeserializerFactory aDeserializerFactory,
                                               Class aClass,
                                               QName aQName)
Register aSerializerFactory for serializing objects of class aClass and aDeserializerFactory for deserializing DOM elements with QName aQName. Objects serialized by aSerializerFactory will have a QName of aQName. If a aSerializerFactory is null, only aDeserializerFactory will be registered, and vice versa.

Parameters:
aSerializerFactory - factory for creating serializers for Class aClass
aDeserializerFactory - factory for creating deserializers for elements with QName aQName
aClass - Class which aSerializerFactory should be used to serialize
aQName - QName defining elements that aDeserializerFactory should be used to deserialize

registerTypeMapping

public void registerTypeMapping(javax.xml.rpc.encoding.SerializerFactory aSerializerFactory,
                                javax.xml.rpc.encoding.DeserializerFactory aDeserializerFactory,
                                Class aClass,
                                QName aQName)
Register the WSDDTypeMapping for WSDD generation. This method implements the WOWSSupport.Delegate and you never have to call this method.

Parameters:
aSerializerFactory - factory for creating serializers for Class aClass
aDeserializerFactory - factory for creating deserializers for elements with QName aQName
aClass - Class which aSerializerFactory should be used to serialize
aQName - QName defining elements that aDeserializerFactory should be used to deserialize

registerXSLTForServiceAndOperation

public void registerXSLTForServiceAndOperation(URL aURL,
                                               String serviceName,
                                               String operationName)
Register an XSLT transformation for serviceName and operationName. All parameters must be non-null. The contents of the URL will be read at registration.

Parameters:
aURL - URL for a resource containing an XSLT
serviceName - the name of the service for which this transformation should be registered
operationName - the name of the operation for which this transformation should be registered

setSecurityDelegate

public void setSecurityDelegate(Object aDelegate)
Register aDelegate as the security delegate for Axis.

Parameters:
aDelegate - any object implementing some subset of the WOSecurityDelegate interface
See Also:
WOSecurityDelegate

toString

public String toString()
Overrides:
toString in class Object

Last updated June 2008

Copyright © 2000-2008 Apple Inc.