public class MultiLogManager extends Object implements LogManager, FileModes, Administrable, MultiLogManagerAdmin
Modifier and Type | Class and Description |
---|---|
static interface |
MultiLogManager.LogRemovalManager
Callback interface for log files to remove themselves from
this manager
|
Modifier and Type | Field and Description |
---|---|
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
|
Constructor and Description |
---|
MultiLogManager()
Create a non-persistent
MultiLogManager . |
MultiLogManager(LogRecovery client,
String path)
Create a
MultiLogManager . |
Modifier and Type | Method and Description |
---|---|
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) |
private static final String LOG_FILE
private static final Logger persistenceLogger
private static final Logger operationsLogger
private static final Logger initLogger
private final LogRecovery client
private final Map logByID
private final Object logByIDLock
private boolean destroyed
private String directory
private static final FilenameFilter filter
final MultiLogManager.LogRemovalManager logMgrRef
public MultiLogManager()
MultiLogManager
.public MultiLogManager(LogRecovery client, String path)
MultiLogManager
.client
- who to inform during recovery.path
- where to store logging information.public ClientLog logFor(long cookie) throws LogException
LogManager
logFor
in interface LogManager
cookie
- identifier representing the information
being logged.LogException
private void release(long cookie)
public void recover() throws LogException
recover
in interface LogManager
LogException
public Object getAdmin()
MultiLogManager
getAdmin
in interface LogManager
getAdmin
in interface Administrable
Administrable
public void destroy()
LogFile
objects on behalf of caller.destroy
in interface DestroyAdmin
destroy
in interface MultiLogManagerAdmin
DestroyAdmin
,
FileSystem
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.