| | |
| | | loggerStorage = new LoggerStorage |
| | | <AccessLogPublisher<AccessLogPublisherCfg>, AccessLogPublisherCfg>(); |
| | | |
| | | /** The singleton instance of this class for configuration purposes. */ |
| | | /** The singleton instance of this class. */ |
| | | private static final AccessLogger instance = new AccessLogger(); |
| | | |
| | | /** |
| | | * The constructor for this class. |
| | | */ |
| | | public AccessLogger() |
| | | private AccessLogger() |
| | | { |
| | | super((Class) AccessLogPublisher.class, |
| | | ERR_CONFIG_LOGGER_INVALID_ACCESS_LOGGER_CLASS); |
| | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | protected LoggerStorage<AccessLogPublisher<AccessLogPublisherCfg>, |
| | | AccessLogPublisherCfg> getStorage() |
| | | protected Collection<AccessLogPublisher<AccessLogPublisherCfg>> getLogPublishers() |
| | | { |
| | | return loggerStorage; |
| | | return loggerStorage.getLogPublishers(); |
| | | } |
| | | |
| | | /** |
| | |
| | | return instance; |
| | | } |
| | | |
| | | /** |
| | | * Add an access log publisher to the access logger. |
| | | * |
| | | * @param publisher The access log publisher to add. |
| | | */ |
| | | public synchronized static void addAccessLogPublisher( |
| | | AccessLogPublisher publisher) |
| | | { |
| | | loggerStorage.addLogPublisher(publisher); |
| | | } |
| | | |
| | | /** |
| | | * Remove an access log publisher from the access logger. |
| | | * |
| | | * @param publisher The access log publisher to remove. |
| | | * @return The publisher that was removed or null if it was not found. |
| | | */ |
| | | public synchronized static boolean removeAccessLogPublisher( |
| | | AccessLogPublisher<AccessLogPublisherCfg> publisher) |
| | | { |
| | | return loggerStorage.removeLogPublisher(publisher); |
| | | } |
| | | |
| | | /** |
| | | * Removes all existing access log publishers from the logger. |
| | |
| | | publisher.logUnbind(unbindOperation); |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final synchronized void addLogPublisher( |
| | | AccessLogPublisher<AccessLogPublisherCfg> publisher) |
| | | { |
| | | loggerStorage.addLogPublisher(publisher); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final synchronized boolean removeLogPublisher( |
| | | AccessLogPublisher<AccessLogPublisherCfg> publisher) |
| | | { |
| | | return loggerStorage.removeLogPublisher(publisher); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public final synchronized void removeAllLogPublishers() |
| | | { |
| | | loggerStorage.removeAllLogPublishers(); |
| | | } |
| | | } |
| | | |