public class RequiredRoles extends Object
Region
's
required roles. Configuration of required roles is accomplished using the
Region
's MembershipAttributes
.
A Role
may be present in the
distributed system even if it the Role
is not present in the
Region
membership. This would occur if none of the members
filling that Role
currently have a Cache
or the
specific Region
created. In this case the Role
is
considered to be absent for that Region
.Role
Constructor and Description |
---|
RequiredRoles() |
Modifier and Type | Method and Description |
---|---|
static Set<Role> |
checkForRequiredRoles(Region<?,?> region)
Returns a set of any currently missing required roles for the
specified region.
|
static boolean |
isRoleInRegionMembership(Region<?,?> region,
Role role)
|
static Set<Role> |
waitForRequiredRoles(Region<?,?> region,
long timeout)
Returns a set of any currently missing required roles for the
specified region.
|
public static Set<Role> checkForRequiredRoles(Region<?,?> region)
region
- the region to check for missing required rolesIllegalStateException
- if region is not configured with required rolespublic static Set<Role> waitForRequiredRoles(Region<?,?> region, long timeout) throws InterruptedException
region
- the region to check for missing required rolestimeout
- milliseconds to wait for any missing required rolesNullPointerException
- if region is nullInterruptedException
- if thread is interrupted while waitingIllegalStateException
- if region is not configured with required rolespublic static boolean isRoleInRegionMembership(Region<?,?> region, Role role)
Role
is currently present in the Region
membership. This returns true
only if one or more members filling this role actually have the region
currently created. The role may be present in the distributed system even
if the role is not present in the region membership.region
- the region whose membership will be searchedrole
- the role to check forCopyright © 1997-2017 Pivotal Software, Inc. All rights reserved.