|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netflix.logging.messaging.BatcherFactory
public class BatcherFactory
A simple singleton factory class that finds the batchers by name. Batchers are also created by the factory if
needed. The users of the batcher have to simply override the MessageProcessor
to specify what to do with the batched messages.
It is the user's responsibility to make sure the name is unique (ie) a FQCN would be ideal for a name. The user
should also remove the batcher from the cache during shutdown or when they do not need it.
The methods are not synchronized for performance reasons and there is very little downside of not synchronizing it
as the last put wins and the already existing objects are garbage collected.
Constructor Summary | |
---|---|
BatcherFactory()
|
Method Summary | |
---|---|
static MessageBatcher |
createBatcher(java.lang.String name,
MessageProcessor processor)
Creates the batcher. |
static MessageBatcher |
getBatcher(java.lang.String name)
Get a batcher by name |
static void |
removeBatcher(java.lang.String name)
Removes the batcher from the cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BatcherFactory()
Method Detail |
---|
public static MessageBatcher getBatcher(java.lang.String name)
name
- - The name of the batcher
public static MessageBatcher createBatcher(java.lang.String name, MessageProcessor processor)
name
- - The name of the batcher to be createdprocessor
- - The user override for actions to be performed on the batched messages.
public static void removeBatcher(java.lang.String name)
name
- - The name of the batcher to be removed
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |