com.sun.jini.mahalo.log
Class MultiLogManager

java.lang.Object
  extended by com.sun.jini.mahalo.log.MultiLogManager
All Implemented Interfaces:
DestroyAdmin, FileModes, LogManager, MultiLogManagerAdmin, Administrable

public class MultiLogManager
extends Object
implements LogManager, FileModes, Administrable, MultiLogManagerAdmin

Author:
Sun Microsystems, Inc.

Nested Class Summary
static interface MultiLogManager.LogRemovalManager
          Callback interface for log files to remove themselves from this manager
 
Field Summary
private  LogRecovery client
          Client called during log recovery to process log objects
private  boolean destroyed
          Flag that is set to true upon destruction
private  String directory
          Persistence directory
private static FilenameFilter filter
           
private static Logger initLogger
          Logger for initialization related messages
private static String LOG_FILE
           
private  Map logByID
          Map of log files keyed by their associated cookie
private  Object logByIDLock
          Lock object used for coordinating access to logByID
(package private)  MultiLogManager.LogRemovalManager logMgrRef
          Capability object passed to log files, which is called back upon log removal.
private static Logger operationsLogger
          Logger for operations related messages
private static Logger persistenceLogger
          Logger for persistence related messages
 
Fields inherited from interface com.sun.jini.mahalo.log.FileModes
RDONLY, READWRITE, WRONLY
 
Constructor Summary
MultiLogManager()
          Create a non-persistent MultiLogManager.
MultiLogManager(LogRecovery client, String path)
          Create a MultiLogManager.
 
Method Summary
 void destroy()
          Clean up all LogFile objects on behalf of caller.
 Object getAdmin()
          Retrieves the administration interface for the MultiLogManager
 ClientLog logFor(long cookie)
          Factory method which returns a Log interface which can be used to create persistent records which collectively represent a system's state.
 void recover()
          Consumes the log file and re-constructs a system's state.
private  void release(long cookie)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_FILE

private static final String LOG_FILE
See Also:
Constant Field Values

persistenceLogger

private static final Logger persistenceLogger
Logger for persistence related messages


operationsLogger

private static final Logger operationsLogger
Logger for operations related messages


initLogger

private static final Logger initLogger
Logger for initialization related messages


client

private final LogRecovery client
Client called during log recovery to process log objects


logByID

private final Map logByID
Map of log files keyed by their associated cookie


logByIDLock

private final Object logByIDLock
Lock object used for coordinating access to logByID


destroyed

private boolean destroyed
Flag that is set to true upon destruction


directory

private String directory
Persistence directory


filter

private static final FilenameFilter filter

logMgrRef

final MultiLogManager.LogRemovalManager logMgrRef
Capability object passed to log files, which is called back upon log removal.

Constructor Detail

MultiLogManager

public MultiLogManager()
Create a non-persistent MultiLogManager.


MultiLogManager

public MultiLogManager(LogRecovery client,
                       String path)
Create a MultiLogManager.

Parameters:
client - who to inform during recovery.
path - where to store logging information.
Method Detail

logFor

public ClientLog logFor(long cookie)
                 throws LogException
Description copied from interface: LogManager
Factory method which returns a Log interface which can be used to create persistent records which collectively represent a system's state.

Specified by:
logFor in interface LogManager
Parameters:
cookie - identifier representing the information being logged.
Throws:
LogException

release

private void release(long cookie)

recover

public void recover()
             throws LogException
Consumes the log file and re-constructs a system's state.

Specified by:
recover in interface LogManager
Throws:
LogException

getAdmin

public Object getAdmin()
Retrieves the administration interface for the MultiLogManager

Specified by:
getAdmin in interface LogManager
Specified by:
getAdmin in interface Administrable
Returns:
an object that implements whatever administration interfaces are appropriate for the particular service.
See Also:
Administrable

destroy

public void destroy()
Clean up all LogFile objects on behalf of caller.

Specified by:
destroy in interface DestroyAdmin
Specified by:
destroy in interface MultiLogManagerAdmin
See Also:
DestroyAdmin, FileSystem


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.