public abstract class AbstractFilterable extends AbstractLifeCycle implements Filterable
Modifier and Type | Class and Description |
---|---|
static class |
AbstractFilterable.Builder<B extends AbstractFilterable.Builder<B>>
Subclasses can extend this abstract Builder.
|
LifeCycle.State
Modifier and Type | Field and Description |
---|---|
private Filter |
filter
May be null.
|
private Property[] |
propertyArray |
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Modifier | Constructor and Description |
---|---|
protected |
AbstractFilterable() |
protected |
AbstractFilterable(Filter filter) |
protected |
AbstractFilterable(Filter filter,
Property[] propertyArray) |
Modifier and Type | Method and Description |
---|---|
void |
addFilter(Filter filter)
Adds a filter.
|
Filter |
getFilter()
Returns the Filter.
|
Property[] |
getPropertyArray() |
boolean |
hasFilter()
Determines if a Filter is present.
|
boolean |
isFiltered(LogEvent event)
Determine if the LogEvent should be processed or ignored.
|
void |
removeFilter(Filter filter)
Removes a Filter.
|
void |
start()
Make the Filter available for use.
|
boolean |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit)
Cleanup the Filter.
|
protected boolean |
stop(long timeout,
java.util.concurrent.TimeUnit timeUnit,
boolean changeLifeCycleState)
Cleanup the Filter.
|
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
private volatile Filter filter
@PluginElement(value="Properties") private final Property[] propertyArray
protected AbstractFilterable()
protected AbstractFilterable(Filter filter)
public void addFilter(Filter filter)
addFilter
in interface Filterable
filter
- The Filter to add.public Filter getFilter()
getFilter
in interface Filterable
public boolean hasFilter()
hasFilter
in interface Filterable
public boolean isFiltered(LogEvent event)
isFiltered
in interface Filterable
event
- The LogEvent.public void removeFilter(Filter filter)
removeFilter
in interface Filterable
filter
- The Filter to remove.public void start()
start
in interface LifeCycle
start
in class AbstractLifeCycle
public boolean stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
stop
in interface LifeCycle2
stop
in class AbstractLifeCycle
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argumentprotected boolean stop(long timeout, java.util.concurrent.TimeUnit timeUnit, boolean changeLifeCycleState)
public Property[] getPropertyArray()