Class AbstractRouter

  extended by org.mule.routing.AbstractRouter
All Implemented Interfaces:
MuleContextAware, Disposable, Initialisable, Router
Direct Known Subclasses:
AbstractOutboundRouter, AbstractResponseRouter, DefaultInterfaceBinding, SelectiveConsumer

public abstract class AbstractRouter
extends Object
implements Router, MuleContextAware

Implements the shared methods that all routers have. The implementations of the different router types can vary depending on their usage pattern. The types of router are inbound, outbound response and nested.

Field Summary
protected  MuleContext muleContext
Fields inherited from interface org.mule.api.lifecycle.Initialisable
Fields inherited from interface org.mule.api.lifecycle.Disposable
Constructor Summary
Method Summary
 void dispose()
          A lifecycle method where implementor should free up any resources.
 MuleContext getMuleContext()
 RouterStatistics getRouterStatistics()
 void initialise()
          Method used to perform any initialisation work.
 void setMuleContext(MuleContext context)
 void setRouterStatistics(RouterStatistics stats)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected MuleContext muleContext
Constructor Detail


public AbstractRouter()
Method Detail


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
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from


public void dispose()
Description copied from interface: Disposable
A lifecycle method where implementor should free up any resources. If an exception is thrown it should just be logged and processing should continue. This method should not throw Runtime exceptions.

Specified by:
dispose in interface Disposable


public void setMuleContext(MuleContext context)
Specified by:
setMuleContext in interface MuleContextAware


public MuleContext getMuleContext()


public void setRouterStatistics(RouterStatistics stats)
Specified by:
setRouterStatistics in interface Router


public RouterStatistics getRouterStatistics()
Specified by:
getRouterStatistics in interface Router

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