public class DefaultInflightRepository extends ServiceSupport implements InflightRepository
InflightRepository
.InflightRepository.InflightExchange
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
DefaultInflightRepository() |
Modifier and Type | Method and Description |
---|---|
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
|
void |
addRoute(String routeId)
Adds the route from the in flight registry.
|
Collection<InflightRepository.InflightExchange> |
browse()
A read-only browser of the
InflightRepository.InflightExchange s that are currently inflight. |
Collection<InflightRepository.InflightExchange> |
browse(int limit,
boolean sortByLongestDuration)
A read-only browser of the
InflightRepository.InflightExchange s that are currently inflight. |
Collection<InflightRepository.InflightExchange> |
browse(String fromRouteId)
A read-only browser of the
InflightRepository.InflightExchange s that are currently inflight that started from the given route. |
Collection<InflightRepository.InflightExchange> |
browse(String fromRouteId,
int limit,
boolean sortByLongestDuration)
A read-only browser of the
InflightRepository.InflightExchange s that are currently inflight that started from 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.
|
InflightRepository.InflightExchange |
oldest(String fromRouteId)
Gets the oldest
InflightRepository.InflightExchange that are currently inflight that started from the given route. |
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.
|
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public DefaultInflightRepository()
public void add(Exchange exchange)
InflightRepository
add
in interface InflightRepository
exchange
- the exchangepublic void remove(Exchange exchange)
InflightRepository
remove
in interface InflightRepository
exchange
- the exchangepublic void add(Exchange exchange, String routeId)
InflightRepository
add
in interface InflightRepository
exchange
- the exchangerouteId
- the id of the routepublic void remove(Exchange exchange, String routeId)
InflightRepository
remove
in interface InflightRepository
exchange
- the exchangerouteId
- the id of the routepublic int size()
InflightRepository
size
in interface InflightRepository
@Deprecated public int size(Endpoint endpoint)
InflightRepository
size
in interface InflightRepository
public void addRoute(String routeId)
InflightRepository
addRoute
in interface InflightRepository
routeId
- the id of the routepublic void removeRoute(String routeId)
InflightRepository
removeRoute
in interface InflightRepository
routeId
- the id of the routepublic int size(String routeId)
InflightRepository
size
in interface InflightRepository
routeId
- the id of the routepublic Collection<InflightRepository.InflightExchange> browse()
InflightRepository
InflightRepository.InflightExchange
s that are currently inflight.browse
in interface InflightRepository
public Collection<InflightRepository.InflightExchange> browse(String fromRouteId)
InflightRepository
InflightRepository.InflightExchange
s that are currently inflight that started from the given route.browse
in interface InflightRepository
fromRouteId
- the route id, or null for all routes.public Collection<InflightRepository.InflightExchange> browse(int limit, boolean sortByLongestDuration)
InflightRepository
InflightRepository.InflightExchange
s that are currently inflight.browse
in interface InflightRepository
limit
- maximum number of entries to returnsortByLongestDuration
- to sort by the longest duration. Set to true to include the exchanges that has been inflight the longest time,
set to false to sort by exchange idpublic Collection<InflightRepository.InflightExchange> browse(String fromRouteId, int limit, boolean sortByLongestDuration)
InflightRepository
InflightRepository.InflightExchange
s that are currently inflight that started from the given route.browse
in interface InflightRepository
fromRouteId
- the route id, or null for all routes.limit
- maximum number of entries to returnsortByLongestDuration
- to sort by the longest duration. Set to true to include the exchanges that has been inflight the longest time,
set to false to sort by exchange idpublic InflightRepository.InflightExchange oldest(String fromRouteId)
InflightRepository
InflightRepository.InflightExchange
that are currently inflight that started from the given route.oldest
in interface InflightRepository
fromRouteId
- the route id, or null for all routes.protected void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class ServiceSupport
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
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.doStop
in class ServiceSupport
Exception
ServiceSupport.doStart()
Apache Camel