org.apache.synapse.startup.tasks
Class MessageInjector

java.lang.Object
  extended by org.apache.synapse.startup.tasks.MessageInjector
All Implemented Interfaces:
ManagedLifecycle, Task

public class MessageInjector
extends Object
implements Task, ManagedLifecycle

Injects a Message in to the Synapse environment


Field Summary
static String GET_FORMAT
           
static String POX_FORMAT
           
static String SOAP11_FORMAT
           
static String SOAP12_FORMAT
           
 
Constructor Summary
MessageInjector()
           
 
Method Summary
 void destroy()
          Destroys the Injector
 void execute()
          This will be invoked by the schedular to inject the message in to the SynapseEnvironment
 void init(SynapseEnvironment se)
          Initializes the Injector
 void setFormat(String format)
          Sets the format of the message
 void setMessage(OMElement elem)
          Set the message to be injected
 void setSoapAction(String soapAction)
          Sets the SOAPAction and valid only when the format is given as soap11
 void setTo(String url)
          Set the to address of the message to be injected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOAP11_FORMAT

public static final String SOAP11_FORMAT
See Also:
Constant Field Values

SOAP12_FORMAT

public static final String SOAP12_FORMAT
See Also:
Constant Field Values

POX_FORMAT

public static final String POX_FORMAT
See Also:
Constant Field Values

GET_FORMAT

public static final String GET_FORMAT
See Also:
Constant Field Values
Constructor Detail

MessageInjector

public MessageInjector()
Method Detail

init

public void init(SynapseEnvironment se)
Initializes the Injector

Specified by:
init in interface ManagedLifecycle
Parameters:
se - SynapseEnvironment of synapse

setMessage

public void setMessage(OMElement elem)
Set the message to be injected

Parameters:
elem - OMElement describing the message

setTo

public void setTo(String url)
Set the to address of the message to be injected

Parameters:
url - String containing the to address

setFormat

public void setFormat(String format)
Sets the format of the message

Parameters:
format - could be one of either "soap11" | "soap12" | "pox" | "get"

setSoapAction

public void setSoapAction(String soapAction)
Sets the SOAPAction and valid only when the format is given as soap11

Parameters:
soapAction - SOAPAction header value to be set

execute

public void execute()
This will be invoked by the schedular to inject the message in to the SynapseEnvironment

Specified by:
execute in interface Task

destroy

public void destroy()
Destroys the Injector

Specified by:
destroy in interface ManagedLifecycle


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.