Class JGroupsEndpoint
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultEndpoint
-
- org.apache.camel.component.jgroups.JGroupsEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.13.0", scheme="jgroups", title="JGroups", syntax="jgroups:clusterName", category={CLUSTERING,MESSAGING}, headersClass=JGroupsConstants.class) public class JGroupsEndpoint extends org.apache.camel.support.DefaultEndpoint
Exchange messages with JGroups clusters.
-
-
Constructor Summary
Constructors Constructor Description JGroupsEndpoint(String endpointUri, org.apache.camel.Component component, org.jgroups.JChannel channel, String clusterName, String channelProperties, boolean enableViewMessages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
Connect shared channel, called by producer and consumer.org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Exchange
createExchange()
org.apache.camel.Exchange
createExchange(org.jgroups.Message message)
org.apache.camel.Exchange
createExchange(org.jgroups.View view)
org.apache.camel.Producer
createProducer()
void
disconnect()
Disconnect shared channel, called by producer and consumer.protected void
doStart()
protected void
doStop()
org.jgroups.JChannel
getChannel()
String
getChannelProperties()
String
getClusterName()
boolean
isEnableViewMessages()
void
setChannel(org.jgroups.JChannel channel)
The channel to usevoid
setChannelProperties(String channelProperties)
Specifies configuration properties of the JChannel used by the endpoint.void
setClusterName(String clusterName)
The name of the JGroups cluster the component should connect to.void
setEnableViewMessages(boolean enableViewMessages)
If set to true, the consumer endpoint will receive org.jgroups.View messages as well (not only org.jgroups.Message instances).-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configureConsumer, configureExchange, configurePollingConsumer, configureProperties, createAsyncProducer, createEndpointUri, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, 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, suspend
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
createExchange
public org.apache.camel.Exchange createExchange(org.jgroups.Message message)
-
createExchange
public org.apache.camel.Exchange createExchange(org.jgroups.View view)
-
createExchange
public org.apache.camel.Exchange createExchange()
- Specified by:
createExchange
in interfaceorg.apache.camel.Endpoint
- Overrides:
createExchange
in classorg.apache.camel.support.DefaultEndpoint
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultEndpoint
- Throws:
Exception
-
connect
public void connect() throws Exception
Connect shared channel, called by producer and consumer.- Throws:
Exception
-
disconnect
public void disconnect()
Disconnect shared channel, called by producer and consumer.
-
getChannel
public org.jgroups.JChannel getChannel()
-
setChannel
public void setChannel(org.jgroups.JChannel channel)
The channel to use
-
getClusterName
public String getClusterName()
-
setClusterName
public void setClusterName(String clusterName)
The name of the JGroups cluster the component should connect to.
-
getChannelProperties
public String getChannelProperties()
-
setChannelProperties
public void setChannelProperties(String channelProperties)
Specifies configuration properties of the JChannel used by the endpoint.
-
isEnableViewMessages
public boolean isEnableViewMessages()
-
setEnableViewMessages
public void setEnableViewMessages(boolean enableViewMessages)
If set to true, the consumer endpoint will receive org.jgroups.View messages as well (not only org.jgroups.Message instances). By default only regular messages are consumed by the endpoint.
-
-