|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.servicemix.jbi.management.BaseLifeCycle
org.apache.servicemix.components.util.PojoSupport
public abstract class PojoSupport
A useful base class for a POJO based JBI component which contains most of the basic plumbing
| Field Summary | |
|---|---|
protected Log |
logger
|
| Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle |
|---|
currentState, INITIALIZED, listener |
| Fields inherited from interface javax.jbi.management.LifeCycleMBean |
|---|
SHUTDOWN, STARTED, STOPPED, UNKNOWN |
| Constructor Summary | |
|---|---|
protected |
PojoSupport()
|
protected |
PojoSupport(QName service,
String endpoint)
|
| Method Summary | |
|---|---|
void |
answer(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage answer)
A helper method to indicate that the message exchange should be continued with the given response and send the message on the delivery channel. |
void |
done(javax.jbi.messaging.MessageExchange exchange)
A helper method to indicate that the message exchange is complete which will set the status to ExchangeStatus.DONE and send the message
on the delivery channel. |
void |
fail(javax.jbi.messaging.MessageExchange exchange,
Exception error)
A helper method which fails and completes the given exchange with the specified error |
void |
fail(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.Fault fault)
A helper method which fails and completes the given exchange with the specified fault |
Object |
getBody(javax.jbi.messaging.NormalizedMessage message)
A helper method to return the body of the message as a POJO which could be a bean or some DOMish model of the body. |
javax.jbi.component.ComponentContext |
getContext()
|
javax.jbi.messaging.DeliveryChannel |
getDeliveryChannel()
|
String |
getDescription()
Get the description |
String |
getEndpoint()
|
javax.jbi.messaging.MessageExchangeFactory |
getExchangeFactory()
Provide access to the default message exchange exchangeFactory, lazily creating one. |
ObjectName |
getExtensionMBeanName()
|
QName |
getService()
|
protected void |
init()
A helper method to allow a component to initialise prior to the endpoint being activated but after the component context has been configured. |
void |
init(javax.jbi.component.ComponentContext cc)
Called when the Component is initialized |
protected boolean |
isInAndOut(javax.jbi.messaging.MessageExchange exchange)
A helper method which will return true if the exchange is capable of both In and Out such as InOut, InOptionalOut etc. |
void |
send(javax.jbi.messaging.MessageExchange exchange)
|
boolean |
sendSync(javax.jbi.messaging.MessageExchange exchange)
|
boolean |
sendSync(javax.jbi.messaging.MessageExchange exchange,
long timeMillis)
|
void |
setBody(javax.jbi.messaging.NormalizedMessage message,
Object body)
Sets the body of the message as a POJO |
void |
setEndpoint(String endpoint)
|
void |
setExtensionMBeanName(ObjectName extensionMBeanName)
|
void |
setService(QName service)
|
void |
shutDown()
Shut down the item. |
| Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle |
|---|
firePropertyChanged, getAttributeInfos, getCurrentState, getName, getObjectToManage, getOperationInfos, getSubType, getType, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener, start, stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.jbi.component.ComponentLifeCycle |
|---|
start, stop |
| Field Detail |
|---|
protected Log logger
| Constructor Detail |
|---|
protected PojoSupport()
protected PojoSupport(QName service,
String endpoint)
| Method Detail |
|---|
public String getDescription()
getDescription in interface MBeanInfoProvider
public void init(javax.jbi.component.ComponentContext cc)
throws javax.jbi.JBIException
init in interface javax.jbi.component.ComponentLifeCyclecc -
javax.jbi.JBIException
public void shutDown()
throws javax.jbi.JBIException
shutDown in interface javax.jbi.component.ComponentLifeCycleshutDown in interface javax.jbi.management.LifeCycleMBeanshutDown in class BaseLifeCyclejavax.jbi.JBIException - if the item fails to shut down.
public Object getBody(javax.jbi.messaging.NormalizedMessage message)
throws javax.jbi.messaging.MessagingException
message - the message on which to extract the body
javax.jbi.messaging.MessagingException
public void setBody(javax.jbi.messaging.NormalizedMessage message,
Object body)
throws javax.jbi.messaging.MessagingException
message - the message on which to set the bodybody - the POJO or DOMish model to set
javax.jbi.messaging.MessagingExceptionpublic ObjectName getExtensionMBeanName()
getExtensionMBeanName in interface javax.jbi.component.ComponentLifeCyclepublic void setExtensionMBeanName(ObjectName extensionMBeanName)
public javax.jbi.component.ComponentContext getContext()
public QName getService()
public void setService(QName service)
public String getEndpoint()
public void setEndpoint(String endpoint)
public javax.jbi.messaging.MessageExchangeFactory getExchangeFactory()
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
public javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
protected void init()
throws javax.jbi.JBIException
init in class BaseLifeCyclejavax.jbi.JBIException
public void done(javax.jbi.messaging.MessageExchange exchange)
throws javax.jbi.messaging.MessagingException
ExchangeStatus.DONE and send the message
on the delivery channel.
exchange -
javax.jbi.messaging.MessagingException
public void send(javax.jbi.messaging.MessageExchange exchange)
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
public boolean sendSync(javax.jbi.messaging.MessageExchange exchange)
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
public boolean sendSync(javax.jbi.messaging.MessageExchange exchange,
long timeMillis)
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
public void answer(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.NormalizedMessage answer)
throws javax.jbi.messaging.MessagingException
exchange -
javax.jbi.messaging.MessagingException
public void fail(javax.jbi.messaging.MessageExchange exchange,
javax.jbi.messaging.Fault fault)
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingException
public void fail(javax.jbi.messaging.MessageExchange exchange,
Exception error)
throws javax.jbi.messaging.MessagingException
javax.jbi.messaging.MessagingExceptionprotected boolean isInAndOut(javax.jbi.messaging.MessageExchange exchange)
exchange -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||