org.sape.smfw.soapengine
Class MessageService

java.lang.Object
  extended byorg.sape.smfw.soapengine.MessageService
All Implemented Interfaces:
javax.xml.rpc.server.ServiceLifecycle

public class MessageService
extends Object
implements javax.xml.rpc.server.ServiceLifecycle

A convenience Web service supplied by the SOAP engine. This implementation can be used "as is" or extended to fit application specific needs. For example, if the application hosts several Web services, this class can be extended once for each Web service. In addition the following methods would be overridden to supply configuration names:


Field Summary
private static String defaultMessageHandlerConfigurationName
          Default MessageHandlerConfiguration name
private static String defaultMessagingEngineConfigurationName
          Default MessagingEngineConfiguration name
private static org.apache.commons.logging.Log log
           
private  MessageContext messageContext
          The MessageContext for this service
private  MessageReader messageReader
          The MessageReader used to receive messages
private  MessageWriter messageWriter
          The MessageWriter used to send messages
 
Constructor Summary
MessageService()
           
 
Method Summary
 void destroy()
           
 String getMessageHandlerConfigurationName()
          Returns the MessageHandlerConfiguration name for this service.
 String getMessagingEngineConfigurationName()
          Returns the MessagingEngineConfiguration name for this service.
 void init(Object context)
           
private  void initMessageContext()
          Initializes the MessageContext.
private  void initMessagingEngine()
          Initializes the MessageReader and the MessageWriter.
 org.apache.axis.message.SOAPBodyElement[] processMessage(org.apache.axis.message.SOAPBodyElement[] requestElements)
          Processes the Message imbedded in the SOAP body.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

defaultMessagingEngineConfigurationName

private static final String defaultMessagingEngineConfigurationName
Default MessagingEngineConfiguration name

See Also:
Constant Field Values

defaultMessageHandlerConfigurationName

private static final String defaultMessageHandlerConfigurationName
Default MessageHandlerConfiguration name

See Also:
Constant Field Values

messageContext

private MessageContext messageContext
The MessageContext for this service


messageReader

private MessageReader messageReader
The MessageReader used to receive messages


messageWriter

private MessageWriter messageWriter
The MessageWriter used to send messages

Constructor Detail

MessageService

public MessageService()
Method Detail

init

public void init(Object context)
          throws javax.xml.rpc.ServiceException
Specified by:
init in interface javax.xml.rpc.server.ServiceLifecycle
Throws:
javax.xml.rpc.ServiceException
See Also:
ServiceLifecycle.init(java.lang.Object)

initMessageContext

private void initMessageContext()
Initializes the MessageContext.


initMessagingEngine

private void initMessagingEngine()
Initializes the MessageReader and the MessageWriter.


destroy

public void destroy()
Specified by:
destroy in interface javax.xml.rpc.server.ServiceLifecycle
See Also:
ServiceLifecycle.destroy()

getMessagingEngineConfigurationName

public String getMessagingEngineConfigurationName()
Returns the MessagingEngineConfiguration name for this service. This implementation returns "/smfw/MessagingEngineConfiguration". Override this method to return a different configuration name.

Returns:
The MessageContext configuration name for this service

getMessageHandlerConfigurationName

public String getMessageHandlerConfigurationName()
Returns the MessageHandlerConfiguration name for this service. This implementation returns "/smfw/MessageHandlerConfiguration". Override this method to return a different configuration name.

Returns:
The MessageContext configuration name for this service

processMessage

public org.apache.axis.message.SOAPBodyElement[] processMessage(org.apache.axis.message.SOAPBodyElement[] requestElements)
                                                         throws RemoteException
Processes the Message imbedded in the SOAP body.

Parameters:
requestElements - contains the request Message
Returns:
the response message as a SOAPBodyElement array
Throws:
RemoteException - if there is any error encountered during execution


Copyright 2003 Sapient Corporation. All Rights Reserved.