Platform SDK Java 8.5 API Reference

com.genesyslab.platform.apptemplate.application
Class GFAppCfgLogOptionsEventListener

java.lang.Object
  extended by com.genesyslab.platform.apptemplate.application.GFAppCfgEventListener
      extended by com.genesyslab.platform.apptemplate.application.GFAppCfgOptionsEventListener
          extended by com.genesyslab.platform.apptemplate.application.GFAppCfgLogOptionsEventListener
All Implemented Interfaces:
Action<GFAppCfgEvent>, Subscriber<GFAppCfgEvent>, java.util.EventListener
Direct Known Subclasses:
GFAppLog4j2Updater

public abstract class GFAppCfgLogOptionsEventListener
extends GFAppCfgOptionsEventListener

Abstract base class for appliance and update of the application logging framework configuration by incoming application configuration from the application configuration manager (GFApplicationConfigurationManager).

It allows applications to implement automatic configuration update for custom/own logging frameworks.
For example, it may be done with the following code sample:

 GFApplicationConfigurationManager appManager =
         GFApplicationConfigurationManager.createManager(confService);
 appManager.register(new MyLogFwkConfigurer());
 appManager.init();

 public class MyLogFwkConfigurer extends GFAppCfgLogOptionsEventListener {

See Also:
GFAppLog4j2Updater

Nested Class Summary
protected static class GFAppCfgLogOptionsEventListener.TheAppLogOptionsFilter
           
 
Nested classes/interfaces inherited from class com.genesyslab.platform.apptemplate.application.GFAppCfgOptionsEventListener
GFAppCfgOptionsEventListener.TheAppConfigDataFilter
 
Field Summary
protected static java.lang.String LOG_EXT_SECTION_NAME
           
protected static java.lang.String LOG_SECTION_NAME
           
static Predicate<GFAppCfgEvent> THE_APP_LOG_OPTIONS_FILTER
           
 
Fields inherited from class com.genesyslab.platform.apptemplate.application.GFAppCfgOptionsEventListener
THE_APP_CONFIGDATA_FILTER
 
Constructor Summary
GFAppCfgLogOptionsEventListener()
           
 
Method Summary
protected  boolean applyLoggingOptions(GFApplicationContext appCtx, IGApplicationConfiguration appConfig, CfgDeltaApplication deltaApp, LmsMessageConveyor lmsMessages)
          Applies new logging options to given LmsMessagesConveyor.
protected static boolean diffSection(KeyValueCollection opts1, KeyValueCollection opts2, java.lang.String section)
           
 Predicate<GFAppCfgEvent> getFilter()
          Gets filter predicate that allows checking whether publishing event should be processed or ignored.
 void handle(GFAppCfgEvent event)
          This method will be called on configuration managers' GFAppCfgEvent after applying of the application configuration options event filter GFAppCfgOptionsEventListener.getFilter() (returning GFAppCfgOptionsEventListener.THE_APP_CONFIGDATA_FILTER).
This filter passes GFAppCfgEvent.AppCfgEventType.AppConfigReceived and GFAppCfgEvent.AppCfgEventType.AppConfigUpdated events only.
protected static boolean logOptionsChanged(GFApplicationContext appCtx, IGApplicationConfiguration appConfig, CfgDeltaApplication deltaApp)
           
protected  void onAppConfigReceived(GFApplicationContext appCtx, IGApplicationConfiguration appConfig)
           
protected  void onAppConfigUpdated(GFApplicationContext appCtx, IGApplicationConfiguration appConfig, CfgDeltaApplication deltaApp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_SECTION_NAME

protected static final java.lang.String LOG_SECTION_NAME
See Also:
Constant Field Values

LOG_EXT_SECTION_NAME

protected static final java.lang.String LOG_EXT_SECTION_NAME
See Also:
Constant Field Values

THE_APP_LOG_OPTIONS_FILTER

public static final Predicate<GFAppCfgEvent> THE_APP_LOG_OPTIONS_FILTER
Constructor Detail

GFAppCfgLogOptionsEventListener

public GFAppCfgLogOptionsEventListener()
Method Detail

getFilter

public Predicate<GFAppCfgEvent> getFilter()
Description copied from interface: Subscriber
Gets filter predicate that allows checking whether publishing event should be processed or ignored.

Specified by:
getFilter in interface Subscriber<GFAppCfgEvent>
Overrides:
getFilter in class GFAppCfgOptionsEventListener
Returns:
filter predicate

handle

public void handle(GFAppCfgEvent event)
Description copied from class: GFAppCfgOptionsEventListener
This method will be called on configuration managers' GFAppCfgEvent after applying of the application configuration options event filter GFAppCfgOptionsEventListener.getFilter() (returning GFAppCfgOptionsEventListener.THE_APP_CONFIGDATA_FILTER).
This filter passes GFAppCfgEvent.AppCfgEventType.AppConfigReceived and GFAppCfgEvent.AppCfgEventType.AppConfigUpdated events only.

Specified by:
handle in interface Action<GFAppCfgEvent>
Specified by:
handle in class GFAppCfgOptionsEventListener

onAppConfigReceived

protected void onAppConfigReceived(GFApplicationContext appCtx,
                                   IGApplicationConfiguration appConfig)

onAppConfigUpdated

protected void onAppConfigUpdated(GFApplicationContext appCtx,
                                  IGApplicationConfiguration appConfig,
                                  CfgDeltaApplication deltaApp)

applyLoggingOptions

protected boolean applyLoggingOptions(GFApplicationContext appCtx,
                                      IGApplicationConfiguration appConfig,
                                      CfgDeltaApplication deltaApp,
                                      LmsMessageConveyor lmsMessages)
Applies new logging options to given LmsMessagesConveyor.

Parameters:
appCtx - the application configuration managers context.
appConfig - the new application configuration to apply.
deltaApp - the application delta object caused the configuration update, or null.
lmsMessages - the LMS messages conveyor to update correspondent options to.
Returns:
true - if lmsMessages was updated with new configuration, false - if appConfig or lmsMessages is null.

logOptionsChanged

protected static boolean logOptionsChanged(GFApplicationContext appCtx,
                                           IGApplicationConfiguration appConfig,
                                           CfgDeltaApplication deltaApp)

diffSection

protected static boolean diffSection(KeyValueCollection opts1,
                                     KeyValueCollection opts2,
                                     java.lang.String section)

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.