org.apache.wsif.providers
Class ModelWSIFOperation

java.lang.Object
  extended byorg.apache.wsif.providers.ModelWSIFOperation
All Implemented Interfaces:
java.io.Serializable, WSIFOperation

public abstract class ModelWSIFOperation
extends java.lang.Object
implements WSIFOperation

ModelWSIFOperation Models are provided for all the classes required to be implemented when writing a WSIF provider: WSIFProvider, WSIFPort, and WSIFOperation. The models are intended to simplify the work in the implementing subclasses, and insure that all providers work in standard way. Things like hunting around in the WSDL for ExtensabilityElements and verifying the types of request and response objects against the WSDL should be done in the model code. Subclasses should only need to provide code directly related to accessing the particular service type they implement. For a subclass to use ModelWSIFOperation, as a minimum it would implement the doInvokeRequestResponse method. If special processing is required for input only operations then subclasses would also implement doInvokeInputOnly. If the binding being implemented uses a binding operation extensibility element then subclasses should override the getOperationExtensibilityClass, and validateOperationExtensibilityElement methods. Other methods may be overriden to customise the behaviour, see the method javadoc for details.

Author:
Ant Elder
See Also:
Serialized Form

Constructor Summary
ModelWSIFOperation(ModelWSIFPort wsifPort, javax.wsdl.BindingOperation bindingOperation)
          Construct a ModelWSIFOperation
 
Method Summary
 WSIFMessage createFaultMessage()
          Create a fault message that may be received into via this port.
 WSIFMessage createFaultMessage(java.lang.String name)
          Create a fault message that may be received into via this port.
 WSIFMessage createInputMessage()
          Create an input message that will be sent via this port.
 WSIFMessage createInputMessage(java.lang.String name)
          Create an input message that will be sent via this port.
 WSIFMessage createOutputMessage()
          Create an output message that will be received into via this port.
 WSIFMessage createOutputMessage(java.lang.String name)
          Create an output message that will be received into via this port.
 java.lang.String deep()
          String representation of this WSIFOperation for WSIF Trc.
 void executeInputOnlyOperation(WSIFMessage inMsg)
          Execute an input-only operation.
 WSIFCorrelationId executeRequestResponseAsync(WSIFMessage inMsg)
          Execute an asynchronous request
 WSIFCorrelationId executeRequestResponseAsync(WSIFMessage inMsg, WSIFResponseHandler handler)
          Execute an asynchronous request
 boolean executeRequestResponseOperation(WSIFMessage inMsg, WSIFMessage outMsg, WSIFMessage faultMsg)
          Execute a request-response operation.
 void fireAsyncResponse(java.lang.Object response)
          fireAsyncResponse is called when a response has been received for a previous executeRequestResponseAsync call.
 WSIFMessage getContext()
          Gets the context information for this binding.
 javax.wsdl.Operation getPortTypeOperation()
          Get the WSDL portType operation this WSIFOperation implements.
 boolean processAsyncResponse(java.lang.Object response, WSIFMessage outMsg, WSIFMessage faultMsg)
          Processes the response to an asynchronous request.
 void setContext(WSIFMessage context)
          Allows the application programmer or stub to pass context information to the binding.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelWSIFOperation

public ModelWSIFOperation(ModelWSIFPort wsifPort,
                          javax.wsdl.BindingOperation bindingOperation)
                   throws WSIFException
Construct a ModelWSIFOperation

Method Detail

executeInputOnlyOperation

public void executeInputOnlyOperation(WSIFMessage inMsg)
                               throws WSIFException
Description copied from interface: WSIFOperation
Execute an input-only operation.

Specified by:
executeInputOnlyOperation in interface WSIFOperation
Parameters:
inMsg - input message to send to the operation
Throws:
WSIFException - if something goes wrong.
See Also:
WSIFOperation.executeInputOnlyOperation(WSIFMessage)

executeRequestResponseOperation

public boolean executeRequestResponseOperation(WSIFMessage inMsg,
                                               WSIFMessage outMsg,
                                               WSIFMessage faultMsg)
                                        throws WSIFException
Description copied from interface: WSIFOperation
Execute a request-response operation. The signature allows for input, output and fault messages. WSDL in fact allows one to describe the set of possible faults an operation may result in, however, only one fault can occur at any one time.

Specified by:
executeRequestResponseOperation in interface WSIFOperation
Parameters:
inMsg - input message to send to the operation
outMsg - an empty message which will be filled in if the operation invocation succeeds. If it does not succeed, the contents of this message are undefined. (This is a return value of this method.)
faultMsg - an empty message which will be filled in if the operation invocation fails. If it succeeds, the contents of this message are undefined. (This is a return value of this method.)
Returns:
true or false indicating whether a fault message was generated or not. The truth value indicates whether the output or fault message has useful information.
Throws:
WSIFException - if something goes wrong.
See Also:
WSIFOperation#executeInputOnlyOperation(WSIFMessage,WSIFMessage,WSIFMessage)

executeRequestResponseAsync

public WSIFCorrelationId executeRequestResponseAsync(WSIFMessage inMsg)
                                              throws WSIFException
Description copied from interface: WSIFOperation
Execute an asynchronous request

Specified by:
executeRequestResponseAsync in interface WSIFOperation
Parameters:
inMsg - input message to send to the operation
Returns:
the correlation ID or the request. The correlation ID is used to associate the request with the WSIFOperation.
Throws:
WSIFException - if something goes wrong.
See Also:
WSIFOperation.executeRequestResponseAsync(WSIFMessage)

executeRequestResponseAsync

public WSIFCorrelationId executeRequestResponseAsync(WSIFMessage inMsg,
                                                     WSIFResponseHandler handler)
                                              throws WSIFException
Description copied from interface: WSIFOperation
Execute an asynchronous request

Specified by:
executeRequestResponseAsync in interface WSIFOperation
Parameters:
inMsg - input message to send to the operation
handler - the response handler that will be notified when the asynchronous response becomes available.
Returns:
the correlation ID or the request. The correlation ID is used to associate the request with the WSIFOperation.
Throws:
WSIFException - if something goes wrong.
See Also:
WSIFOperation.executeRequestResponseAsync(WSIFMessage, WSIFResponseHandler)

fireAsyncResponse

public void fireAsyncResponse(java.lang.Object response)
                       throws WSIFException
Description copied from interface: WSIFOperation
fireAsyncResponse is called when a response has been received for a previous executeRequestResponseAsync call.

Specified by:
fireAsyncResponse in interface WSIFOperation
Parameters:
response - an Object representing the response
Throws:
WSIFException - if something goes wrong
See Also:
WSIFOperation.fireAsyncResponse(Object)

processAsyncResponse

public boolean processAsyncResponse(java.lang.Object response,
                                    WSIFMessage outMsg,
                                    WSIFMessage faultMsg)
                             throws WSIFException
Description copied from interface: WSIFOperation
Processes the response to an asynchronous request. This is called for when the asynchronous operation was initiated without a WSIFResponseHandler, that is, by calling the executeRequestResponseAsync(WSIFMessage input) method.

Specified by:
processAsyncResponse in interface WSIFOperation
Parameters:
response - an Object representing the response.
outMsg - an empty message which will be filled in if the operation invocation succeeds. If it does not succeed, the contents of this message are undefined. (This is a return value of this method.)
faultMsg - an empty message which will be filled in if the operation invocation fails. If it succeeds, the contents of this message are undefined. (This is a return value of this method.)
Returns:
true or false indicating whether a fault message was generated or not. The truth value indicates whether the output or fault message has useful information.
Throws:
WSIFException - if something goes wrong
See Also:
WSIFOperation.processAsyncResponse(Object,WSIFMessage,WSIFMessage)

getPortTypeOperation

public javax.wsdl.Operation getPortTypeOperation()
Get the WSDL portType operation this WSIFOperation implements.

See Also:
WSIFDefaultOperation#getOperation()

createInputMessage

public WSIFMessage createInputMessage()
Description copied from interface: WSIFOperation
Create an input message that will be sent via this port. It is responsibility of caller to set message name.

Specified by:
createInputMessage in interface WSIFOperation
Returns:
a new message
See Also:
WSIFOperation.createInputMessage()

createInputMessage

public WSIFMessage createInputMessage(java.lang.String name)
Description copied from interface: WSIFOperation
Create an input message that will be sent via this port.

Specified by:
createInputMessage in interface WSIFOperation
Parameters:
name - for the new message
Returns:
a new message
See Also:
WSIFOperation.createInputMessage(String)

createOutputMessage

public WSIFMessage createOutputMessage()
Description copied from interface: WSIFOperation
Create an output message that will be received into via this port. It is responsibility of caller to set message name.

Specified by:
createOutputMessage in interface WSIFOperation
Returns:
a new message
See Also:
WSIFOperation.createOutputMessage()

createOutputMessage

public WSIFMessage createOutputMessage(java.lang.String name)
Description copied from interface: WSIFOperation
Create an output message that will be received into via this port.

Specified by:
createOutputMessage in interface WSIFOperation
Parameters:
name - for the new message
Returns:
a new message
See Also:
WSIFOperation.createOutputMessage(String)

createFaultMessage

public WSIFMessage createFaultMessage()
Description copied from interface: WSIFOperation
Create a fault message that may be received into via this port. It is responsibility of caller to set message name.

Specified by:
createFaultMessage in interface WSIFOperation
Returns:
a new message
See Also:
WSIFOperation.createFaultMessage()

createFaultMessage

public WSIFMessage createFaultMessage(java.lang.String name)
Description copied from interface: WSIFOperation
Create a fault message that may be received into via this port.

Specified by:
createFaultMessage in interface WSIFOperation
Parameters:
name - for the new message
Returns:
a new message
See Also:
WSIFOperation.createFaultMessage(String)

getContext

public WSIFMessage getContext()
                       throws WSIFException
Gets the context information for this binding.

Specified by:
getContext in interface WSIFOperation
Returns:
context
Throws:
WSIFException

setContext

public void setContext(WSIFMessage context)
Allows the application programmer or stub to pass context information to the binding. The Port implementation may use this context - for example to update a SOAP header. There is no definition of how a Port may utilize the context.

Specified by:
setContext in interface WSIFOperation
Parameters:
context - context information

deep

public java.lang.String deep()
String representation of this WSIFOperation for WSIF Trc.



Copyright ? 2002, 2006 Apache XML Project. All Rights Reserved.