public interface SerializationGroup<K extends Serializable,V extends Cacheable<K>,G extends Serializable> extends BackingCacheEntry<G,Cacheable<G>>
BackingCacheEntry
that represents a group of underlying items that must always be serialized as a group
and whose members must have coordinated calls to passivation and replication related callbacks.
The underlying items in the group are represented as instances of SerializationGroupMember
.
Modifier and Type | Method and Description |
---|---|
void |
addActive(SerializationGroupMember<K,V,G> member)
Marks the given member as being "active", i.e.
|
void |
addInUse(K key)
Tells the group the given member is "in use".
|
void |
addMember(SerializationGroupMember<K,V,G> member)
Adds a member to the group.
|
PassivatingBackingCache<G,Cacheable<G>,SerializationGroup<K,V,G>> |
getGroupCache()
Gets the cache used to manage the group.
|
int |
getInUseCount()
Gets the number of group member's currently
"in use" . |
V |
getMemberObject(K key)
|
boolean |
isGroupModified()
Returns whether the group has been modified.
|
void |
postActivate()
Callback that must be invoked some time after the group has been activated but before a reference to any member of the
group is provided to an external caller.
|
void |
postReplicate()
Callback that must be invoked some time after the group has been replicated but before a reference to any member of the
group is provided to an external caller.
|
void |
prePassivate()
Callback that must be invoked before the group is passivated.
|
void |
preReplicate()
Callback that must be invoked before the group is replicated.
|
void |
removeActive(K key)
Marks the given member as no longer being "active", i.e.
|
void |
removeInUse(K key)
Tells the group the given member is no longer "in use".
|
void |
removeMember(K key)
Removes a member from the group.
|
void |
setGroupCache(PassivatingBackingCache<G,Cacheable<G>,SerializationGroup<K,V,G>> groupCache)
Handback provided by the cache managing the group.
|
void |
setGroupModified(boolean modified)
Sets the modified state.
|
int |
size()
Gets the number of group members.
|
getLastUsed, getUnderlyingItem, invalidate, isInUse, isPrePassivated, isValid, lock, setInUse, setPrePassivated, tryLock, unlock
isModified
getId
compareTo
void addMember(SerializationGroupMember<K,V,G> member)
member
- the member. Cannot be null
.void removeMember(K key)
key
- the id of the member. Cannot be null
.int size()
V getMemberObject(K key)
key
- the id of the member. Cannot be null
.void addActive(SerializationGroupMember<K,V,G> member)
member
- the member. Cannot be null
.void removeActive(K key)
key
- the id of the member. Cannot be null
.void addInUse(K key)
key
- the id of the member. Cannot be null
.void removeInUse(K key)
key
- the id of the member. Cannot be null
.int getInUseCount()
"in use"
.PassivatingBackingCache<G,Cacheable<G>,SerializationGroup<K,V,G>> getGroupCache()
null
if the group has been serialized and not yet activated.void setGroupCache(PassivatingBackingCache<G,Cacheable<G>,SerializationGroup<K,V,G>> groupCache)
groupCache
- the cache. Cannot be null
.boolean isGroupModified()
Cacheable.isModified()
in that invoking this method
does not clear the modified state.
void setGroupModified(boolean modified)
modified
- true
if the group should be considered to have been modified, false
if notvoid preReplicate()
void postReplicate()
void prePassivate()
void postActivate()
Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.