Package fish.payara.nucleus.hazelcast
Class HazelcastCore
- java.lang.Object
-
- fish.payara.nucleus.hazelcast.HazelcastCore
-
- All Implemented Interfaces:
EventListener
,ConfigListener
@Service(name="hazelcast-core") @RunLevel(10) public class HazelcastCore extends Object implements EventListener, ConfigListener
The core class for using Hazelcast in Payara- Since:
- 4.1.151
- Author:
- Steve Millidge (Payara Foundation)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.event.EventListener
EventListener.Event<T>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLUSTER_EXECUTOR_SERVICE_NAME
static String
INSTANCE_ATTRIBUTE
static String
INSTANCE_ATTRIBUTE_MAP
static String
INSTANCE_GROUP_ATTRIBUTE
static String
SCHEDULED_CLUSTER_EXECUTOR_SERVICE_NAME
-
Constructor Summary
Constructors Constructor Description HazelcastCore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UnprocessedChangeEvents
changed(PropertyChangeEvent[] pces)
Notification that @Configured objects that were injected have changedvoid
event(EventListener.Event event)
Process a Glassfish/Payara eventString
getAttribute(UUID memberUUID, String key)
Map<String,String>
getAttributes(UUID memberUUID)
javax.cache.spi.CachingProvider
getCachingProvider()
Gets the JCache provider used by Hazelcaststatic HazelcastCore
getCore()
Returns the version of the object that has been instantiated.com.hazelcast.core.HazelcastInstance
getInstance()
Gets the actual Hazelcast instance.String
getMemberGroup()
Gets the name of the member group that this instance belongs toString
getMemberName()
Returns the Hazelcast name of the instanceint
getPort()
Gets the port that Hazelcast in running onUUID
getUUID()
Returns the UUID of the instance.boolean
isDatagridEncryptionEnabled()
boolean
isEnabled()
boolean
isLite()
Returns true if this instance is a Hazelcast Lite instancevoid
postConstruct()
void
setAttribute(UUID memberUUID, String key, String value)
void
setEnabled(Boolean enabled)
Sets whether Hazelcast should be enabled.
-
-
-
Field Detail
-
INSTANCE_ATTRIBUTE_MAP
public static final String INSTANCE_ATTRIBUTE_MAP
- See Also:
- Constant Field Values
-
INSTANCE_ATTRIBUTE
public static final String INSTANCE_ATTRIBUTE
- See Also:
- Constant Field Values
-
INSTANCE_GROUP_ATTRIBUTE
public static final String INSTANCE_GROUP_ATTRIBUTE
- See Also:
- Constant Field Values
-
CLUSTER_EXECUTOR_SERVICE_NAME
public static final String CLUSTER_EXECUTOR_SERVICE_NAME
- See Also:
- Constant Field Values
-
SCHEDULED_CLUSTER_EXECUTOR_SERVICE_NAME
public static final String SCHEDULED_CLUSTER_EXECUTOR_SERVICE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCore
public static HazelcastCore getCore()
Returns the version of the object that has been instantiated.- Returns:
- null if an instance of
HazelcastCore
has not been created
-
postConstruct
@PostConstruct public void postConstruct()
-
getMemberName
public String getMemberName()
Returns the Hazelcast name of the instanceNote this is not the same as the name of the instance config or node
- Returns:
Payara
by default- Since:
- 4.1.1.171
-
getMemberGroup
public String getMemberGroup()
Gets the name of the member group that this instance belongs to- Returns:
MicroShoal
by default- Since:
- 4.1.1.171
-
getUUID
public UUID getUUID()
Returns the UUID of the instance. If Hazelcast is not enabled then a new random one will be returned.- Returns:
- a 128-bit immutable universally unique identifier
- Since:
- 4.1.1.171
-
isLite
public boolean isLite()
Returns true if this instance is a Hazelcast Lite instance- Returns:
- Since:
- 4.1.1.171
-
getInstance
public com.hazelcast.core.HazelcastInstance getInstance()
Gets the actual Hazelcast instance. Hazelcast will be booted by this method if it hasn't already started.- Returns:
-
getCachingProvider
public javax.cache.spi.CachingProvider getCachingProvider()
Gets the JCache provider used by Hazelcast- Returns:
- See Also:
- HazelcastCachingProvider
-
isEnabled
public boolean isEnabled()
- Returns:
- Whether Hazelcast is currently enabled
-
event
public void event(EventListener.Event event)
Description copied from interface:EventListener
Process a Glassfish/Payara event- Specified by:
event
in interfaceEventListener
-
setEnabled
public void setEnabled(Boolean enabled)
Sets whether Hazelcast should be enabled.- Parameters:
enabled
- If true will start Hazelcast or restart if currently running; if false will shut down Hazelcast.
-
getPort
public int getPort()
Gets the port that Hazelcast in running on- Returns:
- The default is {@link 54327}
-
changed
public UnprocessedChangeEvents changed(PropertyChangeEvent[] pces)
Description copied from interface:ConfigListener
Notification that @Configured objects that were injected have changed- Specified by:
changed
in interfaceConfigListener
- Parameters:
pces
- list of changes- Returns:
- the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully
-
isDatagridEncryptionEnabled
public boolean isDatagridEncryptionEnabled()
-
-