001    
002    package org.activemq.io.util;
003    
004    
005    
006    
007    public interface MemoryManageable {
008    
009        /**
010         * Get an id that can be used to identify the object.
011         * 
012         * @return an object that can be used as an Id for this object.
013         */
014        public abstract Object getMemoryId();
015        
016        /**
017         * Get a hint about how much memory this Packet is consuming
018         *
019         * @return an aproximation of the current memory used by this instance
020         */
021        public abstract int getMemoryUsage();
022    
023        /**
024         * Increment reference count for bounded memory collections
025         *
026         * @return the incremented reference value
027         * @see org.activemq.io.util.MemoryBoundedQueue
028         */
029        public abstract int incrementMemoryReferenceCount();
030    
031        /**
032         * Decrement reference count for bounded memory collections
033         *
034         * @return the decremented reference value
035         * @see org.activemq.io.util.MemoryBoundedQueue
036         */
037        public abstract int decrementMemoryReferenceCount();
038    
039        /**
040         * @return the current reference count for bounded memory collections
041         * @see org.activemq.io.util.MemoryBoundedQueue
042         */
043        public abstract int getMemoryUsageReferenceCount();
044        
045        public abstract int getPriority();
046    
047    }