public class HazelcastClusterCoreExtension extends Object implements ClusterCoreExtension
| Modifier and Type | Field and Description |
|---|---|
protected HazelcastClusterManager |
hazelcastManager |
| Constructor and Description |
|---|
HazelcastClusterCoreExtension() |
HazelcastClusterCoreExtension(org.mule.runtime.module.artifact.api.classloader.ClassLoaderRepository classLoaderRepository) |
| Modifier and Type | Method and Description |
|---|---|
protected HazelcastClusterManager |
createHazelcastManager() |
void |
dispose() |
ClusteringTicket |
getClusteringTicket()
Alows server plugins to query the clustering properties.
|
ClusterMemberInfo |
getClusterMemberInfo() |
ClusterMemberInfo |
getClusterMemberInfo(boolean primaryPollingInstance,
com.hazelcast.core.Member clusterLocalMember) |
String |
getCurrentClusterId() |
HazelcastClusterManager |
getHazelcastManager() |
String |
getName() |
static File |
getTicketFile() |
void |
initialise() |
boolean |
isClusterEnabled() |
static boolean |
isClusteringEnabled() |
boolean |
isClusteringLicensed() |
void |
onArtifactCreated(org.mule.runtime.core.api.config.bootstrap.ArtifactType type,
String appName,
org.mule.runtime.api.config.custom.CustomizationService customizationService) |
void |
onArtifactInitialised(org.mule.runtime.core.api.config.bootstrap.ArtifactType type,
String artifactName,
org.mule.runtime.api.artifact.Registry registry) |
void |
onUndeploymentSuccess(org.mule.runtime.core.api.config.bootstrap.ArtifactType type,
String artifactName) |
void |
putClusteringTicket(ClusteringTicket ticket)
Alows server plugins to specify the clustering properties.
|
String |
registerClusterMembershipListener(ClusterMembershipListener listener)
Adds MembershipListener to listen for membership updates.
|
void |
registerPrimaryNodeListener(PrimaryClusterNodeListener primaryClusterNodeListener)
Register a listener to be notified when the runtime becomes the primary node in the cluster.
|
void |
removeClusteringTicket()
Alows server plugins to clear the clustering properties.
|
void |
setContainerClassLoader(org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader containerClassLoader) |
void |
start() |
void |
stop() |
boolean |
unregisterClusterMembershipListener(String listenerRegistrationId)
Removes the specified MembershipListener.
|
protected HazelcastClusterManager hazelcastManager
public HazelcastClusterCoreExtension()
public HazelcastClusterCoreExtension(org.mule.runtime.module.artifact.api.classloader.ClassLoaderRepository classLoaderRepository)
public String getName()
getName in interface org.mule.runtime.api.meta.NamedObjectpublic void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableorg.mule.runtime.api.lifecycle.InitialisationExceptionprotected HazelcastClusterManager createHazelcastManager() throws org.mule.runtime.api.lifecycle.InitialisationException
org.mule.runtime.api.lifecycle.InitialisationExceptionpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposablepublic ClusteringTicket getClusteringTicket()
ClusterCoreExtensiongetClusteringTicket in interface ClusterCoreExtensionpublic boolean isClusteringLicensed()
public void putClusteringTicket(ClusteringTicket ticket)
ClusterCoreExtensionputClusteringTicket in interface ClusterCoreExtensionticket - a ticket object that specifies the properties of Mule instances clustering.public boolean isClusterEnabled()
isClusterEnabled in interface ClusterCoreExtensionpublic void removeClusteringTicket()
ClusterCoreExtensionremoveClusteringTicket in interface ClusterCoreExtensionpublic String getCurrentClusterId()
public static File getTicketFile() throws IOException
IOExceptionpublic void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionpublic void onArtifactCreated(org.mule.runtime.core.api.config.bootstrap.ArtifactType type,
String appName,
org.mule.runtime.api.config.custom.CustomizationService customizationService)
onArtifactCreated in interface org.mule.runtime.module.deployment.api.ArtifactDeploymentListenerpublic void onArtifactInitialised(org.mule.runtime.core.api.config.bootstrap.ArtifactType type,
String artifactName,
org.mule.runtime.api.artifact.Registry registry)
onArtifactInitialised in interface org.mule.runtime.module.deployment.api.ArtifactDeploymentListenerpublic void onUndeploymentSuccess(org.mule.runtime.core.api.config.bootstrap.ArtifactType type,
String artifactName)
onUndeploymentSuccess in interface org.mule.runtime.module.deployment.api.ArtifactDeploymentListenerpublic HazelcastClusterManager getHazelcastManager()
public void registerPrimaryNodeListener(PrimaryClusterNodeListener primaryClusterNodeListener)
ClusterCoreExtensionregisterPrimaryNodeListener in interface ClusterCoreExtensionprimaryClusterNodeListener - primary node listener to be registeredpublic String registerClusterMembershipListener(ClusterMembershipListener listener)
ClusterCoreExtension
The addMembershipListener method returns a register-id. This ID is needed to remove the MembershipListener using the
ClusterCoreExtension.unregisterClusterMembershipListener(String) method.
There is no check for duplicate registrations, so if you register the listener twice, it will get events twice.
If ClusterCoreExtension.isClusterEnabled() is false, then the listener will not be invoke and any call to this method will be disregard.
registerClusterMembershipListener in interface ClusterCoreExtensionlistener - membership listenerClusterCoreExtension.unregisterClusterMembershipListener(String)public boolean unregisterClusterMembershipListener(String listenerRegistrationId)
ClusterCoreExtensionIf the same MembershipListener is registered multiple times, it needs to be removed multiple times. This method can safely be called multiple times for the same registration-id; subsequent calls are ignored.
unregisterClusterMembershipListener in interface ClusterCoreExtensionClusterCoreExtension.registerClusterMembershipListener(ClusterMembershipListener)public ClusterMemberInfo getClusterMemberInfo()
getClusterMemberInfo in interface ClusterCoreExtensionpublic ClusterMemberInfo getClusterMemberInfo(boolean primaryPollingInstance, com.hazelcast.core.Member clusterLocalMember)
public void setContainerClassLoader(org.mule.runtime.module.artifact.api.classloader.ArtifactClassLoader containerClassLoader)
setContainerClassLoader in interface org.mule.runtime.container.api.MuleCoreExtensionCopyright © 2006–2022 MuleSoft, Inc.. All rights reserved.