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 StringCLUSTER_EXECUTOR_SERVICE_NAMEstatic StringINSTANCE_ATTRIBUTEstatic StringINSTANCE_ATTRIBUTE_MAPstatic StringINSTANCE_GROUP_ATTRIBUTEstatic StringSCHEDULED_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 UnprocessedChangeEventschanged(PropertyChangeEvent[] pces)Notification that @Configured objects that were injected have changedvoidevent(EventListener.Event event)Process a Glassfish/Payara eventStringgetAttribute(UUID memberUUID, String key)Map<String,String>getAttributes(UUID memberUUID)javax.cache.spi.CachingProvidergetCachingProvider()Gets the JCache provider used by Hazelcaststatic HazelcastCoregetCore()Returns the version of the object that has been instantiated.com.hazelcast.core.HazelcastInstancegetInstance()Gets the actual Hazelcast instance.StringgetMemberGroup()Gets the name of the member group that this instance belongs toStringgetMemberName()Returns the Hazelcast name of the instanceintgetPort()Gets the port that Hazelcast in running onUUIDgetUUID()Returns the UUID of the instance.booleanisDatagridEncryptionEnabled()booleanisEnabled()booleanisLite()Returns true if this instance is a Hazelcast Lite instancevoidpostConstruct()voidsetAttribute(UUID memberUUID, String key, String value)voidsetEnabled(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
HazelcastCorehas 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:
Payaraby default- Since:
- 4.1.1.171
-
getMemberGroup
public String getMemberGroup()
Gets the name of the member group that this instance belongs to- Returns:
MicroShoalby 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:EventListenerProcess a Glassfish/Payara event- Specified by:
eventin 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:ConfigListenerNotification that @Configured objects that were injected have changed- Specified by:
changedin 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()
-
-