public class SerializationGroupMemberImpl<K extends Serializable,V extends Cacheable<K>,G extends Serializable> extends AbstractBackingCacheEntry<K,V> implements SerializationGroupMember<K,V,G>
SerializationGroupImpl
.Constructor and Description |
---|
SerializationGroupMemberImpl(V obj,
GroupAwareBackingCache<K,V,G,SerializationGroupMember<K,V,G>> cache) |
Modifier and Type | Method and Description |
---|---|
void |
decreaseUsageCount()
Decreases the usage reference count
|
SerializationGroup<K,V,G> |
getGroup()
Gets the
SerializationGroupImpl of which this object is a member. |
G |
getGroupId()
Gets the id for the group
|
K |
getId()
The object identifier.
|
V |
getUnderlyingItem()
Gets the underlying CacheItem.
|
void |
increaseUsageCount()
Increases the usage reference count
|
boolean |
isClustered()
Gets whether this member supports clustering functionality.
|
boolean |
isModified()
Gets whether this object's internal state has been modified since
the last request to this method.
|
boolean |
isPreReplicated()
Gets whether pre-replication callbacks have been invoked on the underlying item.
|
void |
lock()
Lock this item, blocking until the lock is acquired.
|
void |
postActivate()
Notification that the group has been activated from a passivated state.
|
void |
postReplicate()
Notification that the previously replicated group has been retrieved from a clustered cache.
|
void |
prePassivate()
Instructs this group member to ensure any prePassivate callbacks are invoked on the underlying item and any internal
references to its group and underlying item are released.
|
void |
preReplicate()
Instructs this group member to ensure any preReplicate callbacks are invoked on the underlying item and any internal
references to its group and underlying item are released.
|
void |
setGroup(SerializationGroup<K,V,G> group)
Sets the
SerializationGroupImpl of which this object is a member. |
void |
setPassivatingCache(GroupAwareBackingCache<K,V,G,SerializationGroupMember<K,V,G>> delegate)
Allows our controlling
PassivatingBackingCache to provide us a reference after deserialization. |
void |
setPreReplicated(boolean preReplicated)
Sets whether pre-replication callbacks have been invoked on the underlying item.
|
void |
setUnderlyingItem(V obj)
Sets the underlying
Cacheable associated with this group member. |
String |
toString() |
boolean |
tryLock()
Attempt to lock this item, failing promptly if the lock is already held by another thread.
|
void |
unlock()
Unlock this item.
|
compareTo, equals, getLastUsed, hashCode, invalidate, isInUse, isPrePassivated, isValid, setLastUsed, setPrePassivated
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getLastUsed, invalidate, isInUse, isPrePassivated, isValid, setPrePassivated
compareTo
public SerializationGroupMemberImpl(V obj, GroupAwareBackingCache<K,V,G,SerializationGroupMember<K,V,G>> cache)
public K getId()
Identifiable
getId
in interface Identifiable<K extends Serializable>
public boolean isModified()
Cacheable
Implementations must be aggressive about returning true
if
they are uncertain about whether they have been modified; false
should only be returned if the implementing object is certain its
internal state has not been modified.
isModified
in interface Cacheable<K extends Serializable>
true
if the state has been modified or the
implementing object does not know; false
otherwise.public boolean isClustered()
true
if clustering is supported, false
otherwisepublic V getUnderlyingItem()
BackingCacheEntry
getUnderlyingItem
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void setUnderlyingItem(V obj)
Cacheable
associated with this group member.setUnderlyingItem
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
obj
- the cache itempublic SerializationGroup<K,V,G> getGroup()
SerializationGroupImpl
of which this object is a member.getGroup
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
null
public void setGroup(SerializationGroup<K,V,G> group)
SerializationGroupImpl
of which this object is a member.setGroup
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
group
- May be null
public G getGroupId()
getGroupId
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
public void prePassivate()
SerializationGroupMember
SerializationGroup
itself.prePassivate
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
public void preReplicate()
SerializationGroupMember
SerializationGroup
itself.preReplicate
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
public void postActivate()
public boolean isPreReplicated()
SerializationGroupMember
isPreReplicated
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
public void setPreReplicated(boolean preReplicated)
SerializationGroupMember
setPreReplicated
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
public void postReplicate()
public void increaseUsageCount()
BackingCacheEntry
increaseUsageCount
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
increaseUsageCount
in class AbstractBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void decreaseUsageCount()
BackingCacheEntry
decreaseUsageCount
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
decreaseUsageCount
in class AbstractBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public void setPassivatingCache(GroupAwareBackingCache<K,V,G,SerializationGroupMember<K,V,G>> delegate)
PassivatingBackingCache
to provide us a reference after deserialization.setPassivatingCache
in interface SerializationGroupMember<K extends Serializable,V extends Cacheable<K>,G extends Serializable>
delegate
- public void lock()
BackingCacheEntry
RuntimeException
will be thrown if the thread is interrupted instead of
InterruptedException
.lock
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
public boolean tryLock()
BackingCacheEntry
tryLock
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
true
if the lock was acquired, false
otherwisepublic void unlock()
BackingCacheEntry
unlock
in interface BackingCacheEntry<K extends Serializable,V extends Cacheable<K>>
Copyright © 2013 JBoss by Red Hat. All rights reserved.