setMuxChannelFactory

Sets the factory the cache should use to create a multiplexed channel.
Ignored if a Channel is directly configured via
{@link #setChannel(Channel)}. If the channel factory is set,
{@link Configuration#setMultiplexerStack(String)} must also be set, or
a CacheException will be thrown during cache startup.

Parameters:

multiplexerChannelFactory -

getChannel

public org.jgroups.Channel getChannel()

Gets the channel the cache is using.

External callers should use extreme care if they access the channel.
The cache expects it has exclusive access to the channel; external code
trying to send or receive messages via the channel will almost certainly
disrupt the operation of the cache.

Returns:

the channel. May return null if the channel was
not externally set via setChannel(Channel) and the
cache has not yet been started.

setChannel

public void setChannel(org.jgroups.Channel channel)

Sets the channel the cache will use. The channel should not be
connected or closed.

External callers should use extreme care if they access the channel.
The cache expects it has exclusive access to the channel; external code
trying to send or receive messages via the channel will almost certainly
disrupt the operation of the cache.

If an application wishes to send and receive messages using the same
underlying channel as the Cache, a multiplexed channel should
be used. Two separate mux channels should be created from the same
ChannelFactory using the same stack name but different
ids.
See ChannelFactory.createMultiplexerChannel(String,String,boolean,String).
These two mux channels will share the same underlying channel. One of the
two mux channels can be injected into the cache; the other can be used by
the application. The cache will not see the application messages and vice versa.

Configuring the cache to use a mux channel can also be done by configuring
the channel factory and the
stack name, in which case
the cache will create and use a mux channel.