org.apache.axis2.description
Class AxisService

java.lang.Object
  extended byorg.apache.axis2.description.AxisDescription
      extended byorg.apache.axis2.description.AxisService
All Implemented Interfaces:
DescriptionConstants, ParameterInclude

public class AxisService
extends AxisDescription

Class AxisService


Field Summary
 
Fields inherited from interface org.apache.axis2.description.DescriptionConstants
CLASSLOADER_KEY, CONTEXTPATH_KEY, EXECUTION_CHAIN_KEY, EXECUTION_FAULT_CHAIN_KEY, EXECUTION_OUT_CHAIN_KEY, IN_FAULTFLOW_KEY, INFLOW_KEY, MESSAGE_RECEIVER_KEY, MODULEREF_KEY, OPERATION_KEY, OUT_FAULTFLOW_KEY, OUTFLOW_KEY, PARAMETER_KEY, PHASES_KEY, SERVICE_CLASS, SERVICE_CLASS_NAME, STYLE_KEY
 
Constructor Summary
AxisService()
          Constructor AxisService.
AxisService(String name)
          Constructor AxisService.
 
Method Summary
 void addMessageReceiver(String mepURL, MessageReceiver messageReceiver)
           
 void addModuleConfig(ModuleConfiguration moduleConfiguration)
          Adds module configuration , if there is moduleConfig tag in service.
 void addModuleOperations(AxisModule module, AxisConfiguration axisConfig)
          Adds an operation to a service if a module is required to do so.
 void addModuleref(QName moduleref)
           
 void addOperation(AxisOperation axisOperation)
          Method addOperation.
 void addSchema(Collection schemas)
           
 void addSchema(org.apache.ws.commons.schema.XmlSchema schema)
           
static AxisService createClientSideAxisService(javax.wsdl.Definition wsdlDefinition, QName wsdlServiceName, String portName, Options options)
           
static AxisService createClientSideAxisService(URL wsdlURL, QName wsdlServiceName, String portName, Options options)
          To create a AxisService for a given WSDL and the created client is most suitable for clinet side invocation not for server side invocation.
static AxisService createService(String implClass, AxisConfiguration axisConfig)
           
static AxisService createService(String implClass, AxisConfiguration axisConfig, Class messageReceiverClass)
          To create an AxisService using given service impl class name fisrt generate schema corresponding to the given java class , next for each methods AxisOperation will be created.
static AxisService createService(String implClass, AxisConfiguration axisConfig, Class messageReceiverClass, String targetNameSpace, String scheamNameSpace)
          To create a service for a given java class with user defined schema and target namespaces
 void disEngageModule(AxisModule module)
           
 void engageModule(AxisModule axisModule, AxisConfiguration axisConfig)
          Engages a module.
 AxisConfiguration getAxisConfiguration()
           
 ClassLoader getClassLoader()
          Method getClassLoader.
 ArrayList getControlOperations()
          Gets the control operation which are added by module like RM.
 String getCustomSchemaNamePrefix()
           
 String getCustomSchemaNameSuffix()
           
 String getEndpoint()
          get the endpoint
 Collection getEngagedModules()
          Method getEngagedModules.
 String[] getExposeTransports()
           
 URL getFileName()
           
 Object getKey()
           
 long getLastupdate()
           
 MessageReceiver getMessageReceiver(String mepURL)
           
 ModuleConfiguration getModuleConfig(QName moduleName)
           
 ArrayList getModules()
           
 String getName()
           
 Map getNameSpacesMap()
           
 AxisOperation getOperation(QName operationName)
          Method getOperation.
 AxisOperation getOperationByAction(String action)
          Returns the AxisOperation which has been mapped to the given action.
 AxisOperation getOperationBySOAPAction(String soapAction)
          Returns the operation given a SOAP Action.
 Iterator getOperations()
          Method getOperations.
 ArrayList getPublishedOperations()
          Gets only the published operations.
 ArrayList getSchema()
           
 org.apache.ws.commons.schema.XmlSchema getSchema(int index)
           
 org.apache.ws.commons.schema.XmlSchemaElement getSchemaElement(QName elementQName)
           
 Hashtable getSchemaMappingTable()
           
 String getSchematargetNamespace()
           
 String getSchematargetNamespacePrefix()
           
 String getScope()
           
 String getServiceDescription()
          Gets the description about the service which is specified in services.xml.
 String getSoapNsUri()
          get the SOAPVersion
 String getTargetNamespace()
           
 String getTargetNamespacePrefix()
           
 boolean isActive()
           
 boolean isEnableAllTransport()
           
 boolean isEngaged(QName moduleName)
           
 boolean isSchemaLocationsAdjusted()
           
 boolean isUseDefaultChains()
           
 boolean isWsdlfound()
           
 void mapActionToOperation(String action, AxisOperation axisOperation)
          Maps an action (aka WSA action) to the given operation.
 void populateSchemaMappings()
          runs the schema mappings if it has not been run previously it is best that this logic be in the axis service since one can call the axis service to populate the schema mappings
 void printPolicy(OutputStream out)
           
 void printPolicy(OutputStream out, String operationName)
           
 void printSchema(OutputStream out)
           
 void printWSDL(OutputStream out)
          Print the WSDL with a default URL
 void printWSDL(OutputStream out, String requestIP)
           
 void removeOperation(QName opName)
           
 void setActive(boolean active)
           
 void setClassLoader(ClassLoader classLoader)
          Method setClassLoader.
 void setCustomSchemaNamePrefix(String customSchemaNamePrefix)
           
 void setCustomSchemaNameSuffix(String customSchemaNameSuffix)
           
 void setEndpoint(String endpoint)
           
 void setExposeTransports(String[] exposeTransports)
           
 void setFileName(URL fileName)
           
 void setLastupdate()
          Sets the current time as last update time of the service.
 void setName(String name)
           
 void setNameSpacesMap(Map nameSpacesMap)
           
 void setSchemaLocationsAdjusted(boolean schemaLocationsAdjusted)
           
 void setSchemaMappingTable(Hashtable schemaMappingTable)
           
 void setSchematargetNamespace(String schematargetNamespace)
           
 void setSchematargetNamespacePrefix(String schematargetNamespacePrefix)
           
 void setScope(String scope)
           
 void setServiceDescription(String serviceDescription)
          Sets the description about the service whish is specified in services.xml
 void setSoapNsUri(String soapNsUri)
           
 void setTargetNamespace(String targetNamespace)
           
 void setTargetNamespacePrefix(String targetNamespacePrefix)
           
 void setUseDefaultChains(boolean useDefaultChains)
           
 void setWsdlfound(boolean wsdlfound)
           
 
Methods inherited from class org.apache.axis2.description.AxisDescription
addChild, addChild, addParameter, deserializeParameters, getChild, getChildren, getParameter, getParameters, getParent, getPolicyInclude, isParameterLocked, removeChild, removeParameter, setParent, setPolicyInclude
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AxisService

public AxisService()
Constructor AxisService.


AxisService

public AxisService(String name)
Constructor AxisService.

Method Detail

isSchemaLocationsAdjusted

public boolean isSchemaLocationsAdjusted()

setSchemaLocationsAdjusted

public void setSchemaLocationsAdjusted(boolean schemaLocationsAdjusted)

getSchemaMappingTable

public Hashtable getSchemaMappingTable()

setSchemaMappingTable

public void setSchemaMappingTable(Hashtable schemaMappingTable)

getCustomSchemaNamePrefix

public String getCustomSchemaNamePrefix()

setCustomSchemaNamePrefix

public void setCustomSchemaNamePrefix(String customSchemaNamePrefix)

getCustomSchemaNameSuffix

public String getCustomSchemaNameSuffix()

setCustomSchemaNameSuffix

public void setCustomSchemaNameSuffix(String customSchemaNameSuffix)

getSoapNsUri

public String getSoapNsUri()
get the SOAPVersion


setSoapNsUri

public void setSoapNsUri(String soapNsUri)

getEndpoint

public String getEndpoint()
get the endpoint


setEndpoint

public void setEndpoint(String endpoint)

addMessageReceiver

public void addMessageReceiver(String mepURL,
                               MessageReceiver messageReceiver)

getMessageReceiver

public MessageReceiver getMessageReceiver(String mepURL)

addModuleConfig

public void addModuleConfig(ModuleConfiguration moduleConfiguration)
Adds module configuration , if there is moduleConfig tag in service.

Parameters:
moduleConfiguration -

addModuleOperations

public void addModuleOperations(AxisModule module,
                                AxisConfiguration axisConfig)
                         throws AxisFault
Adds an operation to a service if a module is required to do so.

Parameters:
module -
Throws:
AxisFault

addModuleref

public void addModuleref(QName moduleref)

addOperation

public void addOperation(AxisOperation axisOperation)
Method addOperation.

Parameters:
axisOperation -

engageModule

public void engageModule(AxisModule axisModule,
                         AxisConfiguration axisConfig)
                  throws AxisFault
Engages a module. It is required to use this method.

Parameters:
axisModule -
Throws:
AxisFault

mapActionToOperation

public void mapActionToOperation(String action,
                                 AxisOperation axisOperation)
Maps an action (aka WSA action) to the given operation. This is used by addressing based dispatching to figure out which operation it is that a given message is for.

Parameters:
action - the action key
axisOperation - the operation to map to

printSchema

public void printSchema(OutputStream out)
                 throws AxisFault
Throws:
AxisFault

getSchema

public org.apache.ws.commons.schema.XmlSchema getSchema(int index)

printPolicy

public void printPolicy(OutputStream out)
                 throws AxisFault
Throws:
AxisFault

printPolicy

public void printPolicy(OutputStream out,
                        String operationName)
                 throws AxisFault
Throws:
AxisFault

getAxisConfiguration

public AxisConfiguration getAxisConfiguration()

printWSDL

public void printWSDL(OutputStream out,
                      String requestIP)
               throws AxisFault
Throws:
AxisFault

printWSDL

public void printWSDL(OutputStream out)
               throws AxisFault
Print the WSDL with a default URL

Parameters:
out -
Throws:
AxisFault

getServiceDescription

public String getServiceDescription()
Gets the description about the service which is specified in services.xml.

Returns:
Returns String.

getClassLoader

public ClassLoader getClassLoader()
Method getClassLoader.

Returns:
Returns ClassLoader.

getControlOperations

public ArrayList getControlOperations()
Gets the control operation which are added by module like RM.


getEngagedModules

public Collection getEngagedModules()
Method getEngagedModules.

Returns:
Returns Collection.

getFileName

public URL getFileName()

getLastupdate

public long getLastupdate()

getModuleConfig

public ModuleConfiguration getModuleConfig(QName moduleName)

getModules

public ArrayList getModules()

getName

public String getName()

getOperation

public AxisOperation getOperation(QName operationName)
Method getOperation.

Parameters:
operationName -
Returns:
Returns AxisOperation.

getOperationByAction

public AxisOperation getOperationByAction(String action)
Returns the AxisOperation which has been mapped to the given action.

Parameters:
action - the action key
Returns:
Returns the corresponding AxisOperation or null if it isn't found.

getOperationBySOAPAction

public AxisOperation getOperationBySOAPAction(String soapAction)
Returns the operation given a SOAP Action. This method should be called if only one Endpoint is defined for this Service. If more than one Endpoint exists, one of them will be picked. If more than one Operation is found with the given SOAP Action; null will be returned. If no particular Operation is found with the given SOAP Action; null will be returned.

Parameters:
soapAction - SOAP Action defined for the particular Operation
Returns:
Returns an AxisOperation if a unique Operation can be found with the given SOAP Action otherwise will return null.

getOperations

public Iterator getOperations()
Method getOperations.

Returns:
Returns HashMap

getPublishedOperations

public ArrayList getPublishedOperations()
Gets only the published operations.


setServiceDescription

public void setServiceDescription(String serviceDescription)
Sets the description about the service whish is specified in services.xml

Parameters:
serviceDescription -

setClassLoader

public void setClassLoader(ClassLoader classLoader)
Method setClassLoader.

Parameters:
classLoader -

setFileName

public void setFileName(URL fileName)

setLastupdate

public void setLastupdate()
Sets the current time as last update time of the service.


setName

public void setName(String name)

getSchema

public ArrayList getSchema()

addSchema

public void addSchema(org.apache.ws.commons.schema.XmlSchema schema)

addSchema

public void addSchema(Collection schemas)

isWsdlfound

public boolean isWsdlfound()

setWsdlfound

public void setWsdlfound(boolean wsdlfound)

getScope

public String getScope()

setScope

public void setScope(String scope)
Parameters:
scope - - Available scopes : Constants.SCOPE_APPLICATION Constants.SCOPE_TRANSPORT_SESSION Constants.SCOPE_SOAP_SESSION Constants.SCOPE_REQUEST.equals

isUseDefaultChains

public boolean isUseDefaultChains()

setUseDefaultChains

public void setUseDefaultChains(boolean useDefaultChains)

getKey

public Object getKey()
Specified by:
getKey in class AxisDescription

isActive

public boolean isActive()

setActive

public void setActive(boolean active)

getSchematargetNamespace

public String getSchematargetNamespace()

setSchematargetNamespace

public void setSchematargetNamespace(String schematargetNamespace)

getSchematargetNamespacePrefix

public String getSchematargetNamespacePrefix()

setSchematargetNamespacePrefix

public void setSchematargetNamespacePrefix(String schematargetNamespacePrefix)

getTargetNamespace

public String getTargetNamespace()

setTargetNamespace

public void setTargetNamespace(String targetNamespace)

getTargetNamespacePrefix

public String getTargetNamespacePrefix()

setTargetNamespacePrefix

public void setTargetNamespacePrefix(String targetNamespacePrefix)

getSchemaElement

public org.apache.ws.commons.schema.XmlSchemaElement getSchemaElement(QName elementQName)

isEnableAllTransport

public boolean isEnableAllTransport()

getExposeTransports

public String[] getExposeTransports()

setExposeTransports

public void setExposeTransports(String[] exposeTransports)

disEngageModule

public void disEngageModule(AxisModule module)

isEngaged

public boolean isEngaged(QName moduleName)

createClientSideAxisService

public static AxisService createClientSideAxisService(URL wsdlURL,
                                                      QName wsdlServiceName,
                                                      String portName,
                                                      Options options)
                                               throws AxisFault
To create a AxisService for a given WSDL and the created client is most suitable for clinet side invocation not for server side invocation. Since all the soap acction and wsa action is added to operations

Parameters:
wsdlURL - location of the WSDL
wsdlServiceName - name of the service to be invoke , if it is null then the first one will be selected if there are more than one
portName - name of the port , if there are more than one , if it is null then the first one in the iterator will be selected
options - Service client options, to set the target EPR
Returns:
AxisService , the created servie will be return
Throws:
AxisFault

createClientSideAxisService

public static AxisService createClientSideAxisService(javax.wsdl.Definition wsdlDefinition,
                                                      QName wsdlServiceName,
                                                      String portName,
                                                      Options options)
                                               throws AxisFault
Throws:
AxisFault

createService

public static AxisService createService(String implClass,
                                        AxisConfiguration axisConfig,
                                        Class messageReceiverClass)
                                 throws AxisFault
To create an AxisService using given service impl class name fisrt generate schema corresponding to the given java class , next for each methods AxisOperation will be created.

Note : Inorder to work this properly RPCMessageReceiver should be availble in the class path otherewise operation can not continue

Parameters:
implClass -
axisConfig -
Returns:
return created AxisSrevice
Throws:
AxisFault

createService

public static AxisService createService(String implClass,
                                        AxisConfiguration axisConfig,
                                        Class messageReceiverClass,
                                        String targetNameSpace,
                                        String scheamNameSpace)
                                 throws AxisFault
To create a service for a given java class with user defined schema and target namespaces

Parameters:
implClass - : full name of the class
axisConfig - : currcent AxisConfgiuration
messageReceiverClass - : Messge reciver that you want to use
targetNameSpace - : Service namespace
scheamNameSpace - : Scheam Name space
Returns:
Throws:
AxisFault

createService

public static AxisService createService(String implClass,
                                        AxisConfiguration axisConfig)
                                 throws AxisFault
Throws:
AxisFault

removeOperation

public void removeOperation(QName opName)

getNameSpacesMap

public Map getNameSpacesMap()

setNameSpacesMap

public void setNameSpacesMap(Map nameSpacesMap)

populateSchemaMappings

public void populateSchemaMappings()
runs the schema mappings if it has not been run previously it is best that this logic be in the axis service since one can call the axis service to populate the schema mappings