public static class ClusterAwareConfiguration.ClusterAwareCondition
extends java.lang.Object
implements org.springframework.context.annotation.Condition
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
RUNTIME_ENVIRONMENT_NAME |
Constructor and Description |
---|
ClusterAwareCondition() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
close(java.net.Socket socket) |
protected void |
configureTopology(org.springframework.core.env.Environment environment,
org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints,
int connectionCount) |
protected java.net.Socket |
connect(org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint) |
protected int |
countConnections(org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints) |
protected boolean |
doCachedMatch(org.springframework.context.annotation.ConditionContext conditionContext)
Caches the result of the computed
doMatch(ConditionContext) operation. |
protected boolean |
doMatch(org.springframework.context.annotation.ConditionContext conditionContext)
Performs the actual conditional match to determine whether this Spring Boot for Apache Geode application
can connect to an available Apache Geode cluster available in any environment (e.g.
|
protected void |
failOnStrictMatchAndNoMatches(boolean strictMatch,
boolean matches) |
protected java.util.List<org.springframework.data.gemfire.support.ConnectionEndpoint> |
getConfiguredConnectionEndpoints(org.springframework.core.env.Environment environment) |
protected org.springframework.data.gemfire.support.ConnectionEndpointList |
getConnectionEndpoints(org.springframework.core.env.Environment environment) |
protected java.util.List<org.springframework.data.gemfire.support.ConnectionEndpoint> |
getDefaultConnectionEndpoints(org.springframework.core.env.Environment environment) |
protected org.slf4j.Logger |
getLogger() |
protected java.util.List<org.springframework.data.gemfire.support.ConnectionEndpoint> |
getPooledConnectionEndpoints(org.springframework.core.env.Environment environment) |
protected java.util.Collection<org.apache.geode.cache.client.Pool> |
getPoolsFromApacheGeode() |
protected java.lang.String |
getRuntimeEnvironmentName()
Returns a
String containing a description of the runtime environment. |
static boolean |
isAvailable()
Determines whether an Apache Geode-based Cluster is available in the runtime environment.
|
protected boolean |
isConnected(int connectionCount) |
protected boolean |
isConnected(java.net.Socket socket) |
protected boolean |
isNotConnected(int connectionCount) |
protected boolean |
isStrictMatch(org.springframework.context.annotation.ConditionContext conditionContext,
org.springframework.core.type.AnnotatedTypeMetadata typeMetadata) |
protected boolean |
isStrictMatchAndNoMatches(boolean strictMatch,
boolean matches) |
protected void |
logConnectedRuntimeEnvironment(org.slf4j.Logger logger) |
protected void |
logConnectedRuntimeEnvironment(org.slf4j.Logger logger,
int connectionCount) |
protected void |
logRuntimeEnvironment(org.slf4j.Logger logger,
int connectionCount) |
protected void |
logUnconnectedRuntimeEnvironment(org.slf4j.Logger logger) |
boolean |
matches(org.springframework.context.annotation.ConditionContext conditionContext,
org.springframework.core.type.AnnotatedTypeMetadata typeMetadata) |
protected java.net.Socket |
newSocket(ClusterAwareConfiguration.PoolConnectionEndpoint poolConnectionEndpoint) |
protected java.net.Socket |
newSocket(org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint) |
protected org.springframework.context.annotation.ConditionContext |
registerApplicationListener(org.springframework.context.annotation.ConditionContext conditionContext) |
static void |
reset()
Resets the state of this
Condition to reevaluate whether an Apache Geode-based Cluster
is available in the runtime environment. |
protected static void |
set(java.lang.Boolean available)
Sets the state of the
clusterAvailable variable. |
static boolean |
wasClusterAvailabilityEvaluated()
Determines whether the
Condition that determines whether an Apache Geode-based Cluster is available
in the runtime environment has been evaluated. |
protected static final java.lang.String RUNTIME_ENVIRONMENT_NAME
public static boolean isAvailable()
wasClusterAvailabilityEvaluated()
public static void reset()
Condition
to reevaluate whether an Apache Geode-based Cluster
is available in the runtime environment.set(Boolean)
protected static void set(@Nullable java.lang.Boolean available)
clusterAvailable
variable.available
- state to set the clusterAvailable
variable to.reset()
public static boolean wasClusterAvailabilityEvaluated()
Condition
that determines whether an Apache Geode-based Cluster is available
in the runtime environment has been evaluated.Condition
that determines
whether an Apache Geode-based Cluster is available in the runtime environment has been evaluated.isAvailable()
protected java.lang.String getRuntimeEnvironmentName()
String
containing a description of the runtime environment.String
containing a description of the runtime environment.public boolean matches(@NonNull org.springframework.context.annotation.ConditionContext conditionContext, @NonNull org.springframework.core.type.AnnotatedTypeMetadata typeMetadata)
matches
in interface org.springframework.context.annotation.Condition
protected boolean isStrictMatch(@NonNull org.springframework.context.annotation.ConditionContext conditionContext, @NonNull org.springframework.core.type.AnnotatedTypeMetadata typeMetadata)
protected boolean isStrictMatchAndNoMatches(boolean strictMatch, boolean matches)
protected void failOnStrictMatchAndNoMatches(boolean strictMatch, boolean matches)
protected boolean doCachedMatch(@NonNull org.springframework.context.annotation.ConditionContext conditionContext)
doMatch(ConditionContext)
operation.
Subsequent calls returns the cached value of the computed (once) doMatch(ConditionContext)
operation.conditionContext
- Spring ConditionContext
capturing the context in which the conditions
are evaluated; must not be null.ConditionContext
,
registerApplicationListener(ConditionContext)
,
doMatch(ConditionContext)
@NonNull protected org.springframework.context.annotation.ConditionContext registerApplicationListener(@NonNull org.springframework.context.annotation.ConditionContext conditionContext)
protected boolean doMatch(@NonNull org.springframework.context.annotation.ConditionContext conditionContext)
conditionContext
- Spring ConditionContext
capturing the context in which the condition(s)
are evaluated; must not be null.ConditionContext
.ConditionContext
,
doCachedMatch(ConditionContext)
,
getConnectionEndpoints(Environment)
,
countConnections(ConnectionEndpointList)
,
configureTopology(Environment, ConnectionEndpointList, int)
,
logRuntimeEnvironment(Logger, int)
,
isMatch(ConnectionEndpointList, int)
@NonNull protected org.slf4j.Logger getLogger()
protected org.springframework.data.gemfire.support.ConnectionEndpointList getConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
protected java.util.List<org.springframework.data.gemfire.support.ConnectionEndpoint> getDefaultConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
protected java.util.List<org.springframework.data.gemfire.support.ConnectionEndpoint> getConfiguredConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
protected java.util.List<org.springframework.data.gemfire.support.ConnectionEndpoint> getPooledConnectionEndpoints(@NonNull org.springframework.core.env.Environment environment)
protected java.util.Collection<org.apache.geode.cache.client.Pool> getPoolsFromApacheGeode()
protected int countConnections(@NonNull org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints)
protected boolean isConnected(@NonNull java.net.Socket socket)
@NonNull protected java.net.Socket connect(@NonNull org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint) throws java.io.IOException
java.io.IOException
@NonNull protected java.net.Socket newSocket(@NonNull org.springframework.data.gemfire.support.ConnectionEndpoint connectionEndpoint) throws java.io.IOException
java.io.IOException
@NonNull protected java.net.Socket newSocket(@NonNull ClusterAwareConfiguration.PoolConnectionEndpoint poolConnectionEndpoint)
protected boolean close(@Nullable java.net.Socket socket)
protected boolean isConnected(int connectionCount)
protected boolean isNotConnected(int connectionCount)
protected void configureTopology(@NonNull org.springframework.core.env.Environment environment, @NonNull org.springframework.data.gemfire.support.ConnectionEndpointList connectionEndpoints, int connectionCount)
protected void logConnectedRuntimeEnvironment(@NonNull org.slf4j.Logger logger)
protected void logConnectedRuntimeEnvironment(@NonNull org.slf4j.Logger logger, int connectionCount)
protected void logRuntimeEnvironment(@NonNull org.slf4j.Logger logger, int connectionCount)
protected void logUnconnectedRuntimeEnvironment(@NonNull org.slf4j.Logger logger)