Package org.apache.camel.impl.cloud
Class DefaultServiceLoadBalancer
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.impl.cloud.DefaultServiceLoadBalancer
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.CamelContextAware,org.apache.camel.cloud.ServiceChooserAware,org.apache.camel.cloud.ServiceDiscoveryAware,org.apache.camel.cloud.ServiceFilterAware,org.apache.camel.cloud.ServiceLoadBalancer,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasCamelContext,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public class DefaultServiceLoadBalancer
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.CamelContextAware, org.apache.camel.cloud.ServiceDiscoveryAware, org.apache.camel.cloud.ServiceChooserAware, org.apache.camel.cloud.ServiceFilterAware, org.apache.camel.cloud.ServiceLoadBalancer
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop()org.apache.camel.CamelContextorg.apache.camel.cloud.ServiceChooserorg.apache.camel.cloud.ServiceDiscoveryorg.apache.camel.cloud.ServiceFilter<T> Tprocess(org.apache.camel.Exchange exchange, String serviceName, org.apache.camel.cloud.ServiceLoadBalancerFunction<T> function) voidsetCamelContext(org.apache.camel.CamelContext camelContext) voidsetServiceChooser(org.apache.camel.cloud.ServiceChooser serverChooser) voidsetServiceDiscovery(org.apache.camel.cloud.ServiceDiscovery serverDiscovery) voidsetServiceFilter(org.apache.camel.cloud.ServiceFilter serviceFilter) Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
DefaultServiceLoadBalancer
public DefaultServiceLoadBalancer()
-
-
Method Details
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
getServiceDiscovery
public org.apache.camel.cloud.ServiceDiscovery getServiceDiscovery()- Specified by:
getServiceDiscoveryin interfaceorg.apache.camel.cloud.ServiceDiscoveryAware
-
setServiceDiscovery
public void setServiceDiscovery(org.apache.camel.cloud.ServiceDiscovery serverDiscovery) - Specified by:
setServiceDiscoveryin interfaceorg.apache.camel.cloud.ServiceDiscoveryAware
-
getServiceChooser
public org.apache.camel.cloud.ServiceChooser getServiceChooser()- Specified by:
getServiceChooserin interfaceorg.apache.camel.cloud.ServiceChooserAware
-
setServiceChooser
public void setServiceChooser(org.apache.camel.cloud.ServiceChooser serverChooser) - Specified by:
setServiceChooserin interfaceorg.apache.camel.cloud.ServiceChooserAware
-
setServiceFilter
public void setServiceFilter(org.apache.camel.cloud.ServiceFilter serviceFilter) - Specified by:
setServiceFilterin interfaceorg.apache.camel.cloud.ServiceFilterAware
-
getServiceFilter
public org.apache.camel.cloud.ServiceFilter getServiceFilter()- Specified by:
getServiceFilterin interfaceorg.apache.camel.cloud.ServiceFilterAware
-
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
process
public <T> T process(org.apache.camel.Exchange exchange, String serviceName, org.apache.camel.cloud.ServiceLoadBalancerFunction<T> function) throws Exception - Specified by:
processin interfaceorg.apache.camel.cloud.ServiceLoadBalancer- Throws:
Exception
-