org.ow2.petals.binding.soap.listener.incoming
Class RequestProcessor

java.lang.Object
  extended by org.ow2.petals.binding.soap.listener.incoming.RequestProcessor
Direct Known Subclasses:
RESTProcessor, SOAPProcessor

public abstract class RequestProcessor
extends java.lang.Object

An abstract request processor. It is used by the external listener to handle incoming requests such as SOAP, REST... Created on 14 févr. 08

Since:
Author:
Christophe HAMERLING - eBM WebSourcing

Field Summary
protected  javax.jbi.messaging.DeliveryChannel channel
           
protected  org.ow2.petals.component.framework.AbstractComponent component
           
protected  javax.jbi.messaging.MessageExchangeFactory exchangeFactory
           
protected  java.util.logging.Logger logger
           
 
Constructor Summary
RequestProcessor(org.ow2.petals.component.framework.AbstractComponent component, javax.jbi.messaging.DeliveryChannel channel, java.util.logging.Logger log)
           
 
Method Summary
protected  void closeMessageExchange(javax.jbi.messaging.MessageExchange exchange)
           
protected  javax.jbi.messaging.MessageExchange createMessageExchange(org.ow2.petals.component.framework.jbidescriptor.generated.Consumes consumes)
          Create a message exchange matching a pattern specified in CDKExtensions.
protected  javax.jbi.messaging.MessageExchange createMessageExchange(org.apache.axis2.context.MessageContext inContext, javax.xml.namespace.QName operation, PetalsAxisService axisService)
          Create the JBI message exchange
protected  javax.security.auth.Subject createSecuritySubject(org.apache.axis2.context.MessageContext messageContext)
          Create the security Subject from the MessageContext.
protected abstract  java.lang.String getProcessorName()
          Get the processor name.
protected  void handleFault(javax.jbi.messaging.MessageExchange exchange, org.apache.axis2.context.MessageContext outMessage, org.apache.axiom.soap.SOAPFactory factory)
           
protected  void handleResponseAttachments(org.apache.axiom.soap.SOAPFactory soapFactory, javax.jbi.messaging.NormalizedMessage nm, org.apache.axis2.context.MessageContext outMessage)
          Put the NormalizedMessage attachments in the output Axis2 MessageContext.
protected  boolean isSecuredService(PetalsAxisService service)
          Check is the service is secured ie rampart module has been engaged by the service unit.
protected abstract  org.apache.axis2.context.MessageContext process(org.apache.axis2.context.MessageContext inContext, org.apache.axiom.soap.SOAPFactory soapfactory)
          Process the request
protected  org.apache.axis2.context.MessageContext processJBIResponse(javax.jbi.messaging.MessageExchange exchange, org.apache.axis2.context.MessageContext inMessage, org.apache.axiom.soap.SOAPFactory factory)
          Process the JBI response.
protected  javax.xml.namespace.QName retrieveOperationFromSOAPBody(org.apache.axis2.context.MessageContext message)
          Get the operation from the message context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected java.util.logging.Logger logger

channel

protected javax.jbi.messaging.DeliveryChannel channel

component

protected org.ow2.petals.component.framework.AbstractComponent component

exchangeFactory

protected javax.jbi.messaging.MessageExchangeFactory exchangeFactory
Constructor Detail

RequestProcessor

public RequestProcessor(org.ow2.petals.component.framework.AbstractComponent component,
                        javax.jbi.messaging.DeliveryChannel channel,
                        java.util.logging.Logger log)
Parameters:
component -
channel -
log -
Method Detail

process

protected abstract org.apache.axis2.context.MessageContext process(org.apache.axis2.context.MessageContext inContext,
                                                                   org.apache.axiom.soap.SOAPFactory soapfactory)
                                                            throws org.apache.axis2.AxisFault
Process the request

Parameters:
inContext -
performanceNotification -
Returns:
the out message context
Throws:
org.apache.axis2.AxisFault

processJBIResponse

protected org.apache.axis2.context.MessageContext processJBIResponse(javax.jbi.messaging.MessageExchange exchange,
                                                                     org.apache.axis2.context.MessageContext inMessage,
                                                                     org.apache.axiom.soap.SOAPFactory factory)
                                                              throws org.apache.axis2.AxisFault
Process the JBI response.
According to the response status :

Parameters:
exchange - JBI response
factory - soap factory used to create body response
Returns:
a FAULT or OUT JBI response or null if no response
Throws:
org.apache.axis2.AxisFault - with ERROR JBI status, or problem while creating response

createMessageExchange

protected javax.jbi.messaging.MessageExchange createMessageExchange(org.ow2.petals.component.framework.jbidescriptor.generated.Consumes consumes)
                                                             throws javax.jbi.messaging.MessagingException
Create a message exchange matching a pattern specified in CDKExtensions. If the MEP is not defined, it will be IN_OPTIONAL_OUT.

Parameters:
consumes - The consumes
Returns:
a message exchange matching the pattern given in extensions
Throws:
javax.jbi.messaging.MessagingException - if the message exchange can't be created

createMessageExchange

protected javax.jbi.messaging.MessageExchange createMessageExchange(org.apache.axis2.context.MessageContext inContext,
                                                                    javax.xml.namespace.QName operation,
                                                                    PetalsAxisService axisService)
                                                             throws org.apache.axis2.AxisFault
Create the JBI message exchange

Parameters:
inContext -
operation -
axisService -
performanceNotification - The performance notification whose the UID will be forwarded to the service provider.
Returns:
Throws:
org.apache.axis2.AxisFault

isSecuredService

protected boolean isSecuredService(PetalsAxisService service)
Check is the service is secured ie rampart module has been engaged by the service unit.

Parameters:
service -
Returns:

createSecuritySubject

protected javax.security.auth.Subject createSecuritySubject(org.apache.axis2.context.MessageContext messageContext)
Create the security Subject from the MessageContext. TODO : Check if there are security features in REST too.

Parameters:
messageContext -
Returns:
the security subject created from the message context if we have found Principal in the message context else return null;

retrieveOperationFromSOAPBody

protected javax.xml.namespace.QName retrieveOperationFromSOAPBody(org.apache.axis2.context.MessageContext message)
Get the operation from the message context. Assume that the operation is always the root element of the SOAP body.

Parameters:
message -
Returns:
null if the operation has not been found

handleFault

protected void handleFault(javax.jbi.messaging.MessageExchange exchange,
                           org.apache.axis2.context.MessageContext outMessage,
                           org.apache.axiom.soap.SOAPFactory factory)
                    throws org.apache.axis2.AxisFault
Parameters:
exchange -
outMessage -
factory -
Throws:
org.apache.axis2.AxisFault

handleResponseAttachments

protected void handleResponseAttachments(org.apache.axiom.soap.SOAPFactory soapFactory,
                                         javax.jbi.messaging.NormalizedMessage nm,
                                         org.apache.axis2.context.MessageContext outMessage)
Put the NormalizedMessage attachments in the output Axis2 MessageContext.

Parameters:
messageContext -

closeMessageExchange

protected void closeMessageExchange(javax.jbi.messaging.MessageExchange exchange)
                             throws org.apache.axis2.AxisFault
Parameters:
exchange -
Throws:
org.apache.axis2.AxisFault

getProcessorName

protected abstract java.lang.String getProcessorName()
Get the processor name. This name MUST be unique ie two processors can not have the same name !

Returns:


Copyright © 2005-2010 OW2 Consortium. All Rights Reserved.