org.apache.wsrp4j.consumer.app.driver
Class PageRegistryImpl

java.lang.Object
  extended byorg.apache.wsrp4j.consumer.app.driver.PageRegistryImpl
All Implemented Interfaces:
PageRegistry, StateChangedListener

public class PageRegistryImpl
extends java.lang.Object
implements PageRegistry, StateChangedListener

This class implements the PageRegistry interface and can be used to administer Page objects.

Version:
$Id: PageRegistryImpl.java,v 1.3 2005/08/10 14:45:38 cziegeler Exp $
Author:
Stephan Laertz
See Also:
Page, PageRegistry

Field Summary
private  HandleGenerator handleGenerator
           
private static PageRegistry instance
           
private  Logger logger
           
private  java.util.Hashtable pages
           
private  PersistentDataObject persistentDataObject
           
private  PersistentHandler persistentHandler
           
 
Constructor Summary
private PageRegistryImpl()
           
 
Method Summary
 void addPage(Page page)
          Add a page to the registry
private  void delete(Page page)
           
 boolean existsPage(java.lang.String pageID)
          Tests if page with the given ID exists
 java.util.Iterator getAllPages()
          Get all pages in the registry
(package private) static PageRegistry getInstance()
          Get a reference to the singleton of the page registry.
 Page getPage(java.lang.String pageID)
          Get the page with the given ID
 Page removePage(java.lang.String pageID)
          Remove the page with the given ID from the registry
private  void restore()
          Restores all available portlets from persistent file store
 void stateChanged(StateChangedEvent event)
          StateChanged event occured
private  void store(Page page)
          Store a page
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static PageRegistry instance

pages

private java.util.Hashtable pages

persistentDataObject

private PersistentDataObject persistentDataObject

persistentHandler

private PersistentHandler persistentHandler

handleGenerator

private HandleGenerator handleGenerator

logger

private Logger logger
Constructor Detail

PageRegistryImpl

private PageRegistryImpl()
Method Detail

getInstance

static PageRegistry getInstance()
Get a reference to the singleton of the page registry.

Returns:
A reference to this PageRegistryImpl object.

addPage

public void addPage(Page page)
Add a page to the registry

Specified by:
addPage in interface PageRegistry
Parameters:
page - The page to add

getPage

public Page getPage(java.lang.String pageID)
Get the page with the given ID

Specified by:
getPage in interface PageRegistry
Parameters:
pageID - ID of the page
Returns:
The page with the given ID

getAllPages

public java.util.Iterator getAllPages()
Get all pages in the registry

Specified by:
getAllPages in interface PageRegistry
Returns:
Iterator with all pages

removePage

public Page removePage(java.lang.String pageID)
Remove the page with the given ID from the registry

Specified by:
removePage in interface PageRegistry
Parameters:
pageID - ID of the page to be removed
Returns:
The page which had been mapped to this id or null if no page was found with the given id

existsPage

public boolean existsPage(java.lang.String pageID)
Tests if page with the given ID exists

Specified by:
existsPage in interface PageRegistry
Parameters:
pageID - ID of the page
Returns:
True if a page exists with this ID

stateChanged

public void stateChanged(StateChangedEvent event)
StateChanged event occured

Specified by:
stateChanged in interface StateChangedListener
Parameters:
event -

restore

private void restore()
              throws WSRPException
Restores all available portlets from persistent file store

Throws:
WSRPException

store

private void store(Page page)
            throws WSRPException
Store a page

Throws:
WSRPException

delete

private void delete(Page page)


--