org.apache.camel.impl
Class DefaultInflightRepository

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultInflightRepository
All Implemented Interfaces:
Service, ShutdownableService, InflightRepository, StatefulService, SuspendableService

public class DefaultInflightRepository
extends ServiceSupport
implements InflightRepository

Default implement which just uses a counter

Version:

Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
DefaultInflightRepository()
           
 
Method Summary
 void add(Exchange exchange)
          Adds the exchange to the inflight registry to the total counter
 void add(Exchange exchange, String routeId)
          Adds the exchange to the inflight registry associated to the given route
protected  void doStart()
          Implementations override this method to support customized start/stop.
protected  void doStop()
          Implementations override this method to support customized start/stop.
 void remove(Exchange exchange)
          Removes the exchange from the inflight registry to the total counter
 void remove(Exchange exchange, String routeId)
          Removes the exchange from the inflight registry removing association to the given route
 void removeRoute(String routeId)
          Removes the route from the in flight registry.
 int size()
          Current size of inflight exchanges.
 int size(Endpoint endpoint)
          Deprecated. 
 int size(String routeId)
          Current size of inflight exchanges which are from the given route.
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

DefaultInflightRepository

public DefaultInflightRepository()
Method Detail

add

public void add(Exchange exchange)
Description copied from interface: InflightRepository
Adds the exchange to the inflight registry to the total counter

Specified by:
add in interface InflightRepository
Parameters:
exchange - the exchange

remove

public void remove(Exchange exchange)
Description copied from interface: InflightRepository
Removes the exchange from the inflight registry to the total counter

Specified by:
remove in interface InflightRepository
Parameters:
exchange - the exchange

add

public void add(Exchange exchange,
                String routeId)
Description copied from interface: InflightRepository
Adds the exchange to the inflight registry associated to the given route

Specified by:
add in interface InflightRepository
Parameters:
exchange - the exchange
routeId - the id of the route

remove

public void remove(Exchange exchange,
                   String routeId)
Description copied from interface: InflightRepository
Removes the exchange from the inflight registry removing association to the given route

Specified by:
remove in interface InflightRepository
Parameters:
exchange - the exchange
routeId - the id of the route

size

public int size()
Description copied from interface: InflightRepository
Current size of inflight exchanges.

Will return 0 if there are no inflight exchanges.

Specified by:
size in interface InflightRepository
Returns:
number of exchanges currently in flight.

size

@Deprecated
public int size(Endpoint endpoint)
Deprecated. 

Description copied from interface: InflightRepository
Will always return 0 due method is deprecated.

Specified by:
size in interface InflightRepository

removeRoute

public void removeRoute(String routeId)
Description copied from interface: InflightRepository
Removes the route from the in flight registry.

Is used for cleaning up resources to avoid leaking.

Specified by:
removeRoute in interface InflightRepository
Parameters:
routeId - the id of the route

size

public int size(String routeId)
Description copied from interface: InflightRepository
Current size of inflight exchanges which are from the given route.

Will return 0 if there are no inflight exchanges.

Specified by:
size in interface InflightRepository
Parameters:
routeId - the id of the route
Returns:
number of exchanges currently in flight.

doStart

protected void doStart()
                throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: See ServiceSupport.doStop() for more details.

Specified by:
doStart in class ServiceSupport
Throws:
Exception
See Also:
ServiceSupport.doStop()

doStop

protected void doStop()
               throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: Camel will invoke this ServiceSupport.doStop() method when the service is being stopped. This method will also be invoked if the service is still in uninitialized state (eg has not been started). The method is always called to allow the service to do custom logic when the service is being stopped, such as when CamelContext is shutting down.

Specified by:
doStop in class ServiceSupport
Throws:
Exception
See Also:
ServiceSupport.doStart()


Apache CAMEL