|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<HighAvailabilityProvider>
com.sun.xml.ws.api.ha.HighAvailabilityProvider
public enum HighAvailabilityProvider
Singleton high-availability provider for Metro
Nested Class Summary | |
---|---|
static class |
HighAvailabilityProvider.StoreType
Enumeration of supported backing store factory types |
Enum Constant Summary | |
---|---|
INSTANCE
|
Method Summary | ||
---|---|---|
static void |
close(org.glassfish.ha.store.api.BackingStore<?,?> backingStore)
Helper method that avoids the need for exception handling boilerplate code when closing a BackingStore instance. |
|
|
createBackingStore(org.glassfish.ha.store.api.BackingStoreFactory factory,
String backingStoreName,
Class<K> keyClass,
Class<V> valueClass)
Helper method that avoids the need for exception handling boilerplate code when creating a new BackingStore instance. |
|
static void |
destroy(org.glassfish.ha.store.api.BackingStore<?,?> backingStore)
Helper method that avoids the need for exception handling boilerplate code when destroying a BackingStore instance. |
|
org.glassfish.ha.store.api.BackingStoreFactory |
getBackingStoreFactory(HighAvailabilityProvider.StoreType type)
Retrieves BackingStoreFactory implementation of the requested type. |
|
|
initBackingStoreConfiguration(String storeName,
Class<K> keyClass,
Class<V> valueClass)
Creates BackingStoreConfiguration instance initialized with
all mandatory fields. |
|
void |
initHaEnvironment(String clusterName,
String instanceName)
This method is not meant to be used directly by the user of the Metro HighAvailabilityProvider class. |
|
void |
initHaEnvironment(String clusterName,
String instanceName,
boolean disableJreplica)
|
|
boolean |
isDisabledJreplica()
|
|
boolean |
isHaEnvironmentConfigured()
Provides information on whether there is a HA service available in the current JVM or not. |
|
static
|
loadFrom(org.glassfish.ha.store.api.BackingStore<K,V> backingStore,
K key,
String version)
Helper method that avoids the need for exception handling boilerplate code when loading data from a BackingStore instance. |
|
static
|
removeExpired(org.glassfish.ha.store.api.BackingStore<K,?> backingStore)
Helper method that avoids the need for exception handling boilerplate code when destroying a BackingStore instance. |
|
static
|
removeFrom(org.glassfish.ha.store.api.BackingStore<K,V> backingStore,
K key)
Helper method that avoids the need for exception handling boilerplate code when removing data from a BackingStore instance. |
|
static
|
saveTo(org.glassfish.ha.store.api.BackingStore<K,V> backingStore,
K key,
V value,
boolean isNew)
Helper method that avoids the need for exception handling boilerplate code when storing data into a BackingStore instance. |
|
static HighAvailabilityProvider |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
|
static HighAvailabilityProvider[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final HighAvailabilityProvider INSTANCE
Method Detail |
---|
public static HighAvailabilityProvider[] values()
for (HighAvailabilityProvider c : HighAvailabilityProvider.values()) System.out.println(c);
public static HighAvailabilityProvider valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic void initHaEnvironment(String clusterName, String instanceName)
HighAvailabilityProvider
class.
It is primarily used by a container to inject the proper cluster name and
instance name values that are later used to initialize all BackingStoreConfiguration
instances created via initBackingStoreConfiguration(String, Class, Class)
method
clusterName
- name of the clusterinstanceName
- name of the cluster instancepublic void initHaEnvironment(String clusterName, String instanceName, boolean disableJreplica)
public boolean isDisabledJreplica()
public <K extends Serializable,V extends Serializable> org.glassfish.ha.store.api.BackingStoreConfiguration<K,V> initBackingStoreConfiguration(String storeName, Class<K> keyClass, Class<V> valueClass)
BackingStoreConfiguration
instance initialized with
all mandatory fields. This instance can be used to create BackingStore
instance.
K
- backing store key typeV
- backing store value typestoreName
- name of the backing storekeyClass
- backing store key classvalueClass
- backing store value class
BackingStoreConfiguration
instancepublic org.glassfish.ha.store.api.BackingStoreFactory getBackingStoreFactory(HighAvailabilityProvider.StoreType type) throws HighAvailabilityProviderException
BackingStoreFactory
implementation of the requested type.
In case this method is executed outside an HA environment (e.g. standalone mode),
StoreType.NOOP
implementation is returned.
type
- type of the BackingStoreFactory
implementation to be retrieved
BackingStoreFactory
implementation of the requested type.
When executed outside HA environment, StoreType.NOOP
implementation
is returned.
HighAvailabilityProviderException
- in case the method is executed inside
HA environment and the requested BackingStoreFactory
implementation is not
available.public boolean isHaEnvironmentConfigured()
true
in case there is a HA service available in the current
JVM, false
otherwisepublic <K extends Serializable,V extends Serializable> org.glassfish.ha.store.api.BackingStore<K,V> createBackingStore(org.glassfish.ha.store.api.BackingStoreFactory factory, String backingStoreName, Class<K> keyClass, Class<V> valueClass)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
K
- backing store key parameter typeV
- backing store value parameter typefactory
- BackingStoreFactory
instancebackingStoreName
- name of the backing store to be createdkeyClass
- backing store key classvalueClass
- backing store value class
BackingStore
instance.public static <K extends Serializable,V extends Serializable> V loadFrom(org.glassfish.ha.store.api.BackingStore<K,V> backingStore, K key, String version)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
K
- backing store key parameter typeV
- backing store data parameter typebackingStore
- BackingStore
instancekey
- stored data identifierversion
- stored data version
BackingStore.load(java.io.Serializable, String)
public static <K extends Serializable,V extends Serializable> String saveTo(org.glassfish.ha.store.api.BackingStore<K,V> backingStore, K key, V value, boolean isNew)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
K
- backing store key parameter typeV
- backing store value parameter typebackingStore
- BackingStore
instancekey
- stored data identifiervalue
- data to be storedisNew
- See BackingStore.save(java.io.Serializable, java.io.Serializable, boolean)
BackingStore.save(java.io.Serializable, java.io.Serializable, boolean)
public static <K extends Serializable,V extends Serializable> void removeFrom(org.glassfish.ha.store.api.BackingStore<K,V> backingStore, K key)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
K
- backing store key parameter typeV
- backing store data parameter typebackingStore
- BackingStore
instancekey
- stored data identifierpublic static void close(org.glassfish.ha.store.api.BackingStore<?,?> backingStore)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
backingStore
- BackingStore
instancepublic static void destroy(org.glassfish.ha.store.api.BackingStore<?,?> backingStore)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
backingStore
- BackingStore
instancepublic static <K extends Serializable> void removeExpired(org.glassfish.ha.store.api.BackingStore<K,?> backingStore)
BackingStore
instance.
The original checked BackingStoreException
is wrapped into a new
unchecked HighAvailabilityProviderException
.
backingStore
- BackingStore
instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |