org.apache.cxf.management.web.logging.atom
Class AtomPushHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.apache.cxf.management.web.logging.atom.AtomPushHandler

public final class AtomPushHandler
extends Handler

Handler pushing log records in batches as Atom Feeds or Entries to registered client. Handler responsibility is to adapt to JUL framework while most of job is delegated to AtomPushEngine.

For simple configuration using properties file (one global root-level handler of this class) following properties prefixed with full name of this class can be used:

Conversion of log records into ATOM Elements can be tuned up using following parameters. Note that not all combinations are meaningful, see org.apache.cxf.jaxrs.ext.logging.atom.converter.StandardConverter for details: By default delivery is served by WebClientDeliverer which does not support reliability of transport. Availability of any of this parameters enables retrying of default delivery. Detailed explanation of these parameter, see org.apache.cxf.jaxrs.ext.logging.atom.deliverer.RetryingDeliverer class description. Ultimate control on conversion and delivery is obtained specifying own implementation classes: Example:
 handlers = org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler, java.util.logging.ConsoleHandler
 .level = INFO
 
 # deliver to given URL triggering after each batch of 10 log records
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.url = http://localhost:9080
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.batchSize = 10
 
 # enable retrying delivery every 10 seconds for 5 minutes
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.retry.pause = linear
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.retry.pause.time = 10
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.retry.timeout = 300
 
 # output for AtomPub: push entries not feeds, each entry with one log record as "atom:extension" 
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.output = entry
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.multiplicity = one
 org.apache.cxf.jaxrs.ext.logging.atom.AtomPushHandler.format = extension
 ...
 


Constructor Summary
AtomPushHandler()
          Creates handler with configuration taken from properties file.
AtomPushHandler(int batchSize, Converter converter, Deliverer deliverer)
          Creates handler with custom parameters.
 
Method Summary
 void close()
           
 void flush()
           
 void publish(LogRecord record)
           
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomPushHandler

public AtomPushHandler()
Creates handler with configuration taken from properties file.


AtomPushHandler

public AtomPushHandler(int batchSize,
                       Converter converter,
                       Deliverer deliverer)
Creates handler with custom parameters.

Parameters:
batchSize - batch size, see AtomPushEngine#getBatchSize()
converter - converter transforming logs into ATOM elements
deliverer - deliverer pushing ATOM elements to client
Method Detail

publish

public void publish(LogRecord record)
Specified by:
publish in class Handler

close

public void close()
           throws SecurityException
Specified by:
close in class Handler
Throws:
SecurityException

flush

public void flush()
Specified by:
flush in class Handler


Apache CXF