Rio Project 4.2 API Documentation



org.rioproject.jsb
Class ServiceBeanContextManager.ContextAttributeLogHandler

java.lang.Object
  extended by com.sun.jini.reliableLog.LogHandler
      extended by org.rioproject.jsb.ServiceBeanContextManager.ContextAttributeLogHandler
All Implemented Interfaces:
SnapshotHandler, SubStore
Enclosing class:
ServiceBeanContextManager

public class ServiceBeanContextManager.ContextAttributeLogHandler
extends LogHandler
implements SubStore, SnapshotHandler

Class which implements methods needed to meet the LogHandler interface


Constructor Summary
ServiceBeanContextManager.ContextAttributeLogHandler()
           
 
Method Summary
 void applyUpdate(Object update)
          This method always throws UnsupportedOperationException since ContextAttributeLogHandler should never update a log.
 ServiceBeanContext getRestoredContext()
           
 void prepareDestroy()
          Informs the SubStore that the service is being destroyed and it should perform any necessary cleanup (closing files for example).
 void recover(InputStream in)
           
 void setDirectory(File dir)
          Gives the SubStore a piece of the file system to use for its store.
 void snapshot(OutputStream out)
           
 String subDirectory()
          If this components what's its own sub-directory it should return a non-null string that will be its sub-directory's name.
 void takeSnapshot()
          Used by all the methods that change persistent state to commit the change to disk
 void updatePerformed(int updateCount)
          Called by PersistentStore after every update to give server a chance to trigger a snapshot
 
Methods inherited from class com.sun.jini.reliableLog.LogHandler
readUpdate, writeUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceBeanContextManager.ContextAttributeLogHandler

public ServiceBeanContextManager.ContextAttributeLogHandler()
Method Detail

setDirectory

public void setDirectory(File dir)
                  throws IOException
Description copied from interface: SubStore
Gives the SubStore a piece of the file system to use for its store.

Specified by:
setDirectory in interface SubStore
Parameters:
dir - the directory to use
Throws:
IOException - if there is a problem initializing it's store or recovering its state.

subDirectory

public String subDirectory()
Description copied from interface: SubStore
If this components what's its own sub-directory it should return a non-null string that will be its sub-directory's name. If it does not need its own sub-directory this method should return null

Specified by:
subDirectory in interface SubStore

snapshot

public void snapshot(OutputStream out)
              throws Exception
Specified by:
snapshot in class LogHandler
Throws:
Exception

recover

public void recover(InputStream in)
             throws Exception
Specified by:
recover in class LogHandler
Throws:
Exception

getRestoredContext

public ServiceBeanContext getRestoredContext()
Returns:
the ServiceBeanContext that has been restored. If there is no state to be restored this method will return null

applyUpdate

public void applyUpdate(Object update)
                 throws Exception
This method always throws UnsupportedOperationException since ContextAttributeLogHandler should never update a log.

Specified by:
applyUpdate in class LogHandler
Throws:
Exception

takeSnapshot

public void takeSnapshot()
                  throws IOException
Used by all the methods that change persistent state to commit the change to disk

Specified by:
takeSnapshot in interface SnapshotHandler
Throws:
IOException - if an error occurs

updatePerformed

public void updatePerformed(int updateCount)
Description copied from interface: SnapshotHandler
Called by PersistentStore after every update to give server a chance to trigger a snapshot

Specified by:
updatePerformed in interface SnapshotHandler
Parameters:
updateCount - Number of updates since last snapshot

prepareDestroy

public void prepareDestroy()
Description copied from interface: SubStore
Informs the SubStore that the service is being destroyed and it should perform any necessary cleanup (closing files for example). The store does not need to delete it's data.

Specified by:
prepareDestroy in interface SubStore

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.