org.apache.servicemix.osworkflow
Class OSWorkflowEndpoint

java.lang.Object
  extended by org.apache.servicemix.common.endpoints.AbstractEndpoint
      extended by org.apache.servicemix.common.endpoints.SimpleEndpoint
          extended by org.apache.servicemix.common.endpoints.ProviderEndpoint
              extended by org.apache.servicemix.osworkflow.OSWorkflowEndpoint
All Implemented Interfaces:
Endpoint

public class OSWorkflowEndpoint
extends ProviderEndpoint

Author:
lhe

Field Summary
 
Fields inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
logger
 
Fields inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
definition, description, endpoint, interfaceName, service, serviceUnit
 
Constructor Summary
OSWorkflowEndpoint()
           
 
Method Summary
 void done(javax.jbi.messaging.MessageExchange ex)
          sends a done to the channel
 void fail(javax.jbi.messaging.MessageExchange ex)
          sends a error to the channel
 int getAction()
           
 java.lang.String getCaller()
           
 javax.jbi.messaging.MessageExchange getNewExchange(javax.xml.namespace.QName qname, boolean inOut)
          creates a msg object
 java.lang.String getWorkflowName()
           
protected  void onConsumerExchange(javax.jbi.messaging.MessageExchange exchange)
          handles the incoming consumer messages
protected  void onProviderExchange(javax.jbi.messaging.MessageExchange exchange)
          handles the incoming provider messages
 void postWorkflow()
          cleanup action
 void preWorkflow()
          init actions
 void process(javax.jbi.messaging.MessageExchange exchange)
           
 void send(javax.jbi.messaging.MessageExchange ex, boolean sync)
          sends a msg to the channel
 boolean sendMessage(javax.xml.namespace.QName service, javax.xml.transform.Source source)
          sends the given DOMSource as message to the given service (inOnly)
 javax.jbi.messaging.MessageExchange sendRawInOutRequest(javax.xml.namespace.QName service, javax.xml.transform.Source source)
          sends the given DOMSource as message to the given service (inOut)
 javax.xml.transform.Source sendRequest(javax.xml.namespace.QName service, javax.xml.transform.Source source)
          sends the given DOMSource as message to the given service (inOut)
 void setAction(int action)
          The initial action to trigger in the workflow.
 void setCaller(java.lang.String caller)
          The caller user name to be used when executing the workflow.
 void setWorkflowName(java.lang.String workflowName)
          The name of the workflow to be used for handling the exchange.
 void start()
           
 void stop()
           
 
Methods inherited from class org.apache.servicemix.common.endpoints.ProviderEndpoint
activate, deactivate, getRole, processInOnly, processInOut
 
Methods inherited from class org.apache.servicemix.common.endpoints.SimpleEndpoint
fail, getChannel, getContext, getExchangeFactory, send, sendSync
 
Methods inherited from class org.apache.servicemix.common.endpoints.AbstractEndpoint
getDefinition, getDescription, getEndpoint, getInterfaceName, getKey, getService, getServiceUnit, isExchangeOkay, prepareExchange, setDefinition, setDescription, setEndpoint, setInterfaceName, setService, setServiceUnit, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OSWorkflowEndpoint

public OSWorkflowEndpoint()
Method Detail

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface Endpoint
Overrides:
start in class SimpleEndpoint
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
Specified by:
stop in interface Endpoint
Overrides:
stop in class SimpleEndpoint
Throws:
java.lang.Exception

process

public void process(javax.jbi.messaging.MessageExchange exchange)
             throws java.lang.Exception
Specified by:
process in interface Endpoint
Overrides:
process in class ProviderEndpoint
Throws:
java.lang.Exception

onConsumerExchange

protected void onConsumerExchange(javax.jbi.messaging.MessageExchange exchange)
                           throws javax.jbi.messaging.MessagingException
handles the incoming consumer messages

Parameters:
exchange -
Throws:
javax.jbi.messaging.MessagingException

onProviderExchange

protected void onProviderExchange(javax.jbi.messaging.MessageExchange exchange)
                           throws javax.jbi.messaging.MessagingException
handles the incoming provider messages

Parameters:
exchange -
Throws:
javax.jbi.messaging.MessagingException

sendMessage

public boolean sendMessage(javax.xml.namespace.QName service,
                           javax.xml.transform.Source source)
                    throws javax.jbi.messaging.MessagingException
sends the given DOMSource as message to the given service (inOnly)

Parameters:
service - the service name to send the message to
source - the source to put in the in message content
Returns:
true on sucessful delivering or false on failure
Throws:
javax.jbi.messaging.MessagingException - on any messaging exception

sendRequest

public javax.xml.transform.Source sendRequest(javax.xml.namespace.QName service,
                                              javax.xml.transform.Source source)
                                       throws javax.jbi.messaging.MessagingException
sends the given DOMSource as message to the given service (inOut)

Parameters:
service - the service name to send the message to
source - the source to put in the in message content
Returns:
the DOMSource of the out message or null
Throws:
javax.jbi.messaging.MessagingException - on any messaging exception

sendRawInOutRequest

public javax.jbi.messaging.MessageExchange sendRawInOutRequest(javax.xml.namespace.QName service,
                                                               javax.xml.transform.Source source)
                                                        throws javax.jbi.messaging.MessagingException
sends the given DOMSource as message to the given service (inOut)

Parameters:
service - the service name to send the message to
source - the source to put in the in message content
Returns:
the DOMSource of the out message or null
Throws:
javax.jbi.messaging.MessagingException - on any messaging exception

getNewExchange

public javax.jbi.messaging.MessageExchange getNewExchange(javax.xml.namespace.QName qname,
                                                          boolean inOut)
                                                   throws javax.jbi.messaging.MessagingException
creates a msg object

Parameters:
qname - the service which will be the receiver
inOut - should it be inOut or InOnly
Returns:
the created exchange
Throws:
javax.jbi.messaging.MessagingException

done

public void done(javax.jbi.messaging.MessageExchange ex)
          throws javax.jbi.messaging.MessagingException
sends a done to the channel

Overrides:
done in class SimpleEndpoint
Parameters:
ex -
Throws:
javax.jbi.messaging.MessagingException

send

public void send(javax.jbi.messaging.MessageExchange ex,
                 boolean sync)
          throws javax.jbi.messaging.MessagingException
sends a msg to the channel

Parameters:
ex -
sync -
Throws:
javax.jbi.messaging.MessagingException

fail

public void fail(javax.jbi.messaging.MessageExchange ex)
          throws javax.jbi.messaging.MessagingException
sends a error to the channel

Parameters:
ex -
Throws:
javax.jbi.messaging.MessagingException

getWorkflowName

public java.lang.String getWorkflowName()
Returns:
the workflowName

setWorkflowName

public void setWorkflowName(java.lang.String workflowName)
The name of the workflow to be used for handling the exchange.

Parameters:
workflowName - the workflowName to set

getCaller

public java.lang.String getCaller()
Returns:
the caller

setCaller

public void setCaller(java.lang.String caller)
The caller user name to be used when executing the workflow.

Parameters:
caller - the caller to set

getAction

public int getAction()
Returns:
the action

setAction

public void setAction(int action)
The initial action to trigger in the workflow.

Parameters:
action - the action to set

preWorkflow

public void preWorkflow()
init actions


postWorkflow

public void postWorkflow()
cleanup action



Copyright © 2005-2012 FuseSource. All Rights Reserved.