Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.routing.response
Class AbstractResponseAggregator

    java.lang.Object
      org.mule.routing.AbstractRouter
          org.mule.routing.response.AbstractResponseRouter
              org.mule.routing.response.AbstractResponseAggregator

All Implemented Interfaces:
  MuleContextAware, Disposable, Initialisable, ResponseRouter, Router

Direct Known Subclasses:
  AbstractResponseCallbackAggregator, ResponseCorrelationAggregator, SingleResponseRouter

    public abstract class AbstractResponseAggregator

extends AbstractResponseRouter

`AbstractResponseAggregator` provides a base class for implementing response aggregator routers. This provides a thread-safe implemenetation and allows developers to customise how and when events are grouped and collated. Response Agrregators are used to collect responses that are usually sent to replyTo endpoints set on outbound routers. When an event is sent out via an outbound router, the response router will block the response flow on an Service until the Response Router resolves a reply or times out.

Field Summary

Fields inherited from class org.mule.routing.response.AbstractResponseRouter
`logger, messageInfoMapping`

Fields inherited from class org.mule.routing.AbstractRouter
`muleContext`

Fields inherited from interface org.mule.api.lifecycle.Initialisable
`PHASE_NAME`

Fields inherited from interface org.mule.api.lifecycle.Disposable
`PHASE_NAME`

Constructor Summary
`AbstractResponseAggregator()`

Method Summary
`protected MuleMessage` | `aggregateEvents(EventGroup events)`
`protected abstract EventCorrelatorCallback` | `getCorrelatorCallback()`
`protected EventCorrelator` | `getEventCorrelator()`
`MuleMessage` | `getResponse(MuleMessage message)` This method is called by the responding callee thread and should return the aggregated response message
`int` | `getTimeout()` Returns the timeout delay that the response router should wait for a response for a given event.
`void` | `initialise()` Method used to perform any initialisation work.
`boolean` | `isFailOnTimeout()` Should the router fail and throw an exception if a timeout occurs or should it return the events received so far.
`void` | `process(MuleEvent event)` This method is invoked when an event is received via an endpoint on this Response Router.
`void` | `setFailOnTimeout(boolean failOnTimeout)` Should the router fail and throw an exception if a timeout occurs or should it return the events received so far.
`void` | `setTimeout(int timeout)` Sets the timeout delay that the response router should wait for a response for a given event.

Methods inherited from class org.mule.routing.response.AbstractResponseRouter
`getCallResponseAggregateIdentifier, getMessageInfoMapping, getReplyAggregateIdentifier, setMessageInfoMapping`

Methods inherited from class org.mule.routing.AbstractRouter
`dispose, getMuleContext, getRouterStatistics, setMuleContext, setRouterStatistics`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.mule.api.routing.Router
`getRouterStatistics, setRouterStatistics`

Methods inherited from interface org.mule.api.lifecycle.Disposable
`dispose`

Constructor Detail

### AbstractResponseAggregator

    public AbstractResponseAggregator()

Method Detail

### initialise

    public void initialise()
                    throws InitialisationException

  Description copied from interface: `Initialisable`
  Method used to perform any initialisation work. If a fatal error occurs during initialisation an `InitialisationException` should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a `RecoverableException` should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

  Specified by:
    `initialise` in interface `Initialisable`
  Overrides:
    `initialise` in class `AbstractRouter`
  Throws:
    `InitialisationException` - if a fatal error occurs causing the Mule instance to shutdown
    `RecoverableException` - if an error occurs that can be recovered from

### getEventCorrelator

    protected EventCorrelator getEventCorrelator()

### process

    public void process(MuleEvent event)
                 throws RoutingException

  Description copied from interface: `ResponseRouter`
  This method is invoked when an event is received via an endpoint on this Response Router. It is responsible for tieing up the event it receives with responses waiting to return back to the callee. This method will be called by a different thread to the getResponse method. The getResponse() method block the response execution until the process method signals that a match is found.

  Throws:
    `RoutingException`

### getResponse

    public MuleMessage getResponse(MuleMessage message)
                            throws RoutingException

  This method is called by the responding callee thread and should return the aggregated response message

  Parameters:
    `message` -
  Returns:
    the response message sent back to the callee
  Throws:
    `RoutingException`
  See Also:
    `MuleMessage`, `Service`

### isFailOnTimeout

    public boolean isFailOnTimeout()

  Description copied from interface: `ResponseRouter`
  Should the router fail and throw an exception if a timeout occurs or should it return the events received so far. //TODO This method is not implemented yet

### setFailOnTimeout

    public void setFailOnTimeout(boolean failOnTimeout)

  Description copied from interface: `ResponseRouter`
  Should the router fail and throw an exception if a timeout occurs or should it return the events received so far. //TODO This method is not implemented yet

### getTimeout

    public int getTimeout()

  Description copied from interface: `ResponseRouter`
  Returns the timeout delay that the response router should wait for a response for a given event. If the time expires and exception will be thrown by Mule.

  Returns:
    the time in milliseconds to wait for a response event

### setTimeout

    public void setTimeout(int timeout)

  Description copied from interface: `ResponseRouter`
  Sets the timeout delay that the response router should wait for a response for a given event. If the time expires and exception will be thrown by Mule.

  Parameters:
    `timeout` - the time in milliseconds to wait for a response event

### getCorrelatorCallback

    protected abstract EventCorrelatorCallback getCorrelatorCallback()

### aggregateEvents

    protected MuleMessage aggregateEvents(EventGroup events)
                                   throws RoutingException

  Throws:
    `RoutingException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.