net.myvietnam.mvnplugin.mvnforum.db
Class ForumCache

java.lang.Object
  |
  +--net.myvietnam.mvnplugin.mvnforum.db.ForumCache

public final class ForumCache
extends java.lang.Object


Method Summary
 ForumBean getBean(int forumID)
           
 java.util.ArrayList getBeans()
          IMPORTANT NOTE: The caller must not alter the returned collection Note: since the return value can be accessed in many threads, we must be sure that this collection is intact.
static ForumCache getInstance()
          Returns the single instance
 void reload()
          Reload to get the lastest info Normally, this class will detect all the modifications in the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ForumCache getInstance()
Returns the single instance

Returns:
ForumCache : the singleton instance. NOTE: if use normal singleton pattern, this method should be synchronized

getBeans

public java.util.ArrayList getBeans()
                             throws net.myvietnam.mvncore.exception.DatabaseException
IMPORTANT NOTE: The caller must not alter the returned collection Note: since the return value can be accessed in many threads, we must be sure that this collection is intact. Now we can only be sure that each object in the collection is intact (default set methods) , but we can not prevent the collection from being changed

net.myvietnam.mvncore.exception.DatabaseException

getBean

public ForumBean getBean(int forumID)
                  throws net.myvietnam.mvncore.exception.DatabaseException,
                         net.myvietnam.mvncore.exception.BadInputException
net.myvietnam.mvncore.exception.DatabaseException
net.myvietnam.mvncore.exception.BadInputException

reload

public void reload()
            throws net.myvietnam.mvncore.exception.DatabaseException
Reload to get the lastest info Normally, this class will detect all the modifications in the table. However, call this method to force a reload Auto call reload after some time (say 1 hour) is also a good idea

net.myvietnam.mvncore.exception.DatabaseException