|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.jgroups.AlfrescoJGroupsChannelFactory
public class AlfrescoJGroupsChannelFactory
A cache peer provider that does heartbeat sending and receiving using JGroups.
The cluster name needs to be set before any communication is possible. This can be done using the
property AlfrescoJGroupsChannelFactory.setClusterName(String)
.
The channels provided to the callers will be proxies to underlying channels that will be hot-swappable. This means that the client code can continue to use the channel references while the actual implementation can be switched in and out as required.
Nested Class Summary | |
---|---|
static class |
AlfrescoJGroupsChannelFactory.ChannelProxy
A proxy channel that can be used to hot-swap underlying channels. |
static class |
AlfrescoJGroupsChannelFactory.DummyProtocol
|
Field Summary | |
---|---|
static java.lang.String |
APP_REGION_DEFAULT
A catch-all for unknown application regions. |
static java.lang.String |
APP_REGION_EHCACHE_HEARTBEAT
The application region used by the EHCache heartbeat implementation over JGroups. |
static java.lang.String |
DEFAULT_CONFIG_TCP
The TCP protocol config |
static java.lang.String |
DEFAULT_CONFIG_UDP
The UDP protocol config (default) |
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean |
---|
log |
Constructor Summary | |
---|---|
AlfrescoJGroupsChannelFactory()
Bean-enabling constructor |
Method Summary | |
---|---|
static void |
changeClusterNamePrefix(java.lang.String clusterNamePrefix)
Set the prefix used to identify the different clusters. |
static org.jgroups.Channel |
getChannel(java.lang.String appRegion)
/** Creates a channel for the cluster. |
static boolean |
isClusterActive()
Check if a cluster name was provided. |
protected void |
onBootstrap(org.springframework.context.ApplicationEvent event)
|
protected void |
onShutdown(org.springframework.context.ApplicationEvent event)
|
static void |
rebuildChannels()
Rebuild all the channels using the current cluster name and configuration mappings. |
void |
setClusterName(java.lang.String clusterName)
|
void |
setConfigUrlsByAppRegion(java.util.Map configUrlsByAppRegion)
|
void |
setJgroupsConfigurationUrl(java.lang.String configUrl)
Deprecated. Use AlfrescoJGroupsChannelFactory.setConfigUrlsByAppRegion(Map) |
void |
setProtocolStackMapping(java.util.Map unused)
Deprecated. Use AlfrescoJGroupsChannelFactory.setConfigUrlsByAppRegion(Map) |
Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean |
---|
getApplicationContext, onApplicationEvent, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String APP_REGION_DEFAULT
public static final java.lang.String APP_REGION_EHCACHE_HEARTBEAT
public static final java.lang.String DEFAULT_CONFIG_UDP
public static final java.lang.String DEFAULT_CONFIG_TCP
Constructor Detail |
---|
public AlfrescoJGroupsChannelFactory()
Method Detail |
---|
public static boolean isClusterActive()
public static org.jgroups.Channel getChannel(java.lang.String appRegion)
The application region is used to determine the protocol configuration to apply.
This method returns a dummy channel if no cluster name has been provided.
appRegion
- the application region identifier.
public static void rebuildChannels()
public static void changeClusterNamePrefix(java.lang.String clusterNamePrefix)
clusterNamePrefix:appRegionIf no cluster name prefix is declared, the cluster is effectively disabled.
NOTE: The channels must be rebuilt
.
clusterNamePrefix
- a prefix to append to the cluster names usedpublic void setClusterName(java.lang.String clusterName)
AlfrescoJGroupsChannelFactory.changeClusterNamePrefix(String)
public void setConfigUrlsByAppRegion(java.util.Map configUrlsByAppRegion)
AlfrescoJGroupsChannelFactory.changeConfigUrlsMapping(Map)
public void setProtocolStackMapping(java.util.Map unused)
AlfrescoJGroupsChannelFactory.setConfigUrlsByAppRegion(Map)
public void setJgroupsConfigurationUrl(java.lang.String configUrl)
AlfrescoJGroupsChannelFactory.setConfigUrlsByAppRegion(Map)
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
onBootstrap
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
protected void onShutdown(org.springframework.context.ApplicationEvent event)
onShutdown
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |