|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.Handler
com.sun.sgs.impl.kernel.logging.TransactionalHandler
public class TransactionalHandler
A Handler implementation that given a backing Handler, provides transactional semantics for the #publish(LogRecord) method. This class is used by the TransactionAwareLogManager to wrap existing handlers as specificed
by the application.
TransactionAwareLogManager| Constructor Summary | |
|---|---|
TransactionalHandler(TransactionProxy proxy,
Handler backingHandler)
Constructs a new TransactionalHandler with the provided
proxy for joining transactions a the backing handler
for performing the actual logging. |
|
| Method Summary | |
|---|---|
void |
abort(Transaction txn)
Removes any buffered records for this transaction and performs no logging. |
void |
close()
|
void |
commit(Transaction txn)
Removes any buffered records for this transaction and logs all buffered records using the backing Handler. |
void |
flush()
|
Handler |
getBackingHandler()
Returns the Handler used to publish all buffered LogRecords when a transaction commmits. |
String |
getEncoding()
|
ErrorManager |
getErrorManager()
|
Filter |
getFilter()
|
Formatter |
getFormatter()
|
Level |
getLevel()
|
String |
getTypeName()
Returns the class name of the Handler that this
instance wraps. |
boolean |
isLoggable(LogRecord record)
|
boolean |
prepare(Transaction txn)
Tells the participant to prepare for commiting its state associated with the given transaction. |
void |
prepareAndCommit(Transaction txn)
Removes any buffered records for this transaction and logs all buffered records using the backing Handler. |
void |
publish(LogRecord record)
Joins the current transaction and buffers the provided record for later publication until transaction commit time. |
void |
reportError(String msg,
Exception ex,
int code)
|
void |
setEncoding(String encoding)
|
void |
setErrorManager(ErrorManager em)
|
void |
setFilter(Filter newFilter)
|
void |
setFormatter(Formatter newFormatter)
|
void |
setLevel(Level newLevel)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
TransactionalHandler(TransactionProxy proxy,
Handler backingHandler)
TransactionalHandler with the provided
proxy for joining transactions a the backing handler
for performing the actual logging.
proxy - the proxy used to join transactionsbackingHandler - the handler used to perform the actual
logging at commit time
NullPointerException - if the backingHandler or
proxy is null.| Method Detail |
|---|
public void abort(Transaction txn)
abort in interface TransactionParticipanttxn - the failed transaction that in the past performed
some logging operationpublic void close()
close in class Handlerpublic void commit(Transaction txn)
Handler.
commit in interface TransactionParticipanttxn - the successful transaction that in the past
performed some logging operationpublic void flush()
flush in class Handlerpublic Handler getBackingHandler()
Handler used to publish all buffered LogRecords when a transaction commmits.
public String getEncoding()
getEncoding in class Handlerpublic ErrorManager getErrorManager()
getErrorManager in class Handlerpublic Filter getFilter()
getFilter in class Handlerpublic Formatter getFormatter()
getFormatter in class Handlerpublic Level getLevel()
getLevel in class Handlerpublic String getTypeName()
Handler that this
instance wraps.
getTypeName in interface TransactionParticipantHandlerpublic boolean isLoggable(LogRecord record)
isLoggable in class Handlerpublic boolean prepare(Transaction txn)
boolean
flag stating whether the prepared state is read-only, meaning that no
external state is modified by this participant. If this method
returns true, then neither commit nor abort
will be called.
If this method throws an exception, then the preparation failed, and
the transaction will be aborted. If this method completes successfully,
then the participant is required to be able to commit the transaction
without failure.
This participant always returns false.
prepare in interface TransactionParticipanttxn - the Transaction object
falsepublic void prepareAndCommit(Transaction txn)
Handler.
prepareAndCommit in interface TransactionParticipanttxn - the successful transaction that in the past
performed some logging operationpublic void publish(LogRecord record)
publish in class Handlerrecord - the record to be buffer and later publication
upon transaction success.
public void reportError(String msg,
Exception ex,
int code)
reportError in class Handler
public void setEncoding(String encoding)
throws UnsupportedEncodingException
setEncoding in class HandlerUnsupportedEncodingExceptionpublic void setErrorManager(ErrorManager em)
setErrorManager in class Handlerpublic void setFilter(Filter newFilter)
setFilter in class Handlerpublic void setFormatter(Formatter newFormatter)
setFormatter in class Handlerpublic void setLevel(Level newLevel)
setLevel in class Handler
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||