Package org.jivesoftware.util.cache
Interface Cacheable
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
ProxyTransfer
- All Known Implementing Classes:
CacheableOptional
,ClientRoute
,CollectionNode
,DefaultNodeConfiguration
,DefaultProxyTransfer
,EntityCapabilities
,FileTransfer
,Group
,HistoryStrategy.Messages
,LeafNode
,LockOutFlag
,MUCRole
,MUCRoom
,Node
,NodeAffiliate
,PEPService
,PrivacyItem
,PrivacyList
,RemoteServerConfiguration
,Roster
,RosterItem
,User
public interface Cacheable extends Serializable
Interface that defines the necessary behavior for objects added to a Cache. Objects only need to know how big they are (in bytes). That size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.While the accuracy of the size calculation is important, care should be taken to minimize the computation time so that cache operations are speedy.
- Author:
- Jive Software
- See Also:
Cache
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getCachedSize()
Returns the approximate size of the Object in bytes.
-
-
-
Method Detail
-
getCachedSize
int getCachedSize() throws CannotCalculateSizeException
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.- Returns:
- the size of the Object in bytes.
- Throws:
CannotCalculateSizeException
- if the size cannot be calculated
-
-