com.genesyslab.platform.apptemplate.application
Class GFApplicationConfigurationManager.ManagerBuilder
java.lang.Object
com.genesyslab.platform.apptemplate.application.AbstractManagerBuilder<GFApplicationConfigurationManager,GFApplicationConfigurationManager.ManagerBuilder>
com.genesyslab.platform.apptemplate.application.GFApplicationConfigurationManager.ManagerBuilder
- Enclosing class:
- GFApplicationConfigurationManager
public static class GFApplicationConfigurationManager.ManagerBuilder
- extends AbstractManagerBuilder<GFApplicationConfigurationManager,GFApplicationConfigurationManager.ManagerBuilder>
Dedicated builder for basic implementation of application configuration manager.
It provides two main ways of the manager building - with or without pre-configured ConfService instance.
If application provides ConfService, it should also take care on the protocol connection state management
(i.e. WarmStandby configuration, etc), ConfService cache configuration, and CS updates subscriptions.
Creation of the manager without pre-configured ConfService
It means that application does not need special customizations on ConfService, so, the builder will create
internal ConfService instance with default configuration which is required for the manager main operations.
// Create the manager:
GFApplicationConfigurationManager appManager =
GFApplicationConfigurationManager.newBuilder()
.withLmsConveyor(lmsConveyor) // - Optional, may be omitted if application does not need custom LMS conveyor.
.withCSEndpoint(cfgServerPrimary) // - It's possible to provide several CS Endpoints -
.withCSEndpoint(cfgServerBackup) // WarmStandby will use this list for connection restoration.
.withWarmStandby(true) // - Enables/disables WarmStandby initialization on building;
// by default it is enabled if more than one CS Endpoint provided.
.withClientId(clientType, clientName)
.withUserId(csUsername, csPassword) // - It's not needed if application is server type.
.build();
// Register own application configuration appliance handler:
appManager.register(new GFAppCfgOptionsEventListener() {
public void handle(final GFAppCfgEvent event) {
Log.getLogger(getClass()).info(
"The application configuration options received: " + event.getAppConfig());
}});
// Activate the manager:
appManager.init();
// Do the application work...
// On application shutdown:
appManager.done();
Creation of the manager with pre-configured ConfService
By this way applications may create custom configuration of ConfService instance.
Customization may include own ConfService extended implementation, custom service/cache policy,
ConfService ConfConfCache implementation, etc.
// Create Configuration Server protocol:
ConfServerProtocol protocol = new ConfServerProtocol(cfgServerPrimary);
protocol.setClientName(clientName);
protocol.setClientApplicationType(clientType.ordinal());
protocol.setUserName(csUsername);
protocol.setUserPassword(csPassword);
// Initialize WarmStandby service:
WarmStandby csWarmStandby = new WarmStandby(protocol, cfgServerPrimary, cfgServerBackup);
// Create ConfService:
IConfService confService = ConfServiceFactory.createConfService(protocol, servicePolicy, cachePolicy);
// Start WarmStandby service:
csWarmStandby.autoRestore();
// Create the manager:
GFApplicationConfigurationManager appManager =
GFApplicationConfigurationManager.newBuilder()
.withConfService(confService)
.withDoCSSubscription(true) // Do subscriptions for updates on application and host CS object types
.build();
// Register own application configuration appliance handler:
appManager.register(new GFAppCfgOptionsEventListener() {
public void handle(final GFAppCfgEvent event) {
Log.getLogger(getClass()).info(
"The application configuration options received: " + event.getAppConfig());
}});
// Activate the manager:
appManager.init();
// Do the application work...
// On application shutdown:
appManager.done();
- See Also:
GFApplicationConfigurationManager.newBuilder()
Fields inherited from class com.genesyslab.platform.apptemplate.application.AbstractManagerBuilder |
clientName, clientType, confService, csEndpoints, disableSessionUsage, doCSSubscription, doLoggingAutoconfig, lmsConveyor, password, username, useWarmStandby, wsConfig |
Methods inherited from class com.genesyslab.platform.apptemplate.application.AbstractManagerBuilder |
checkRequiredParameters, createProtocol, createWarmStandby, withClientId, withConfService, withCSEndpoint, withDoCSSubscription, withLmsConveyor, withLoggingAutoconfig, withSessionDisabled, withUserId, withWarmStandby, withWarmStandbyEnabled |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GFApplicationConfigurationManager.ManagerBuilder
public GFApplicationConfigurationManager.ManagerBuilder()
setupContext
protected GFApplicationConfigurationManager setupContext(GFApplicationConfigurationManager manager)
- Overrides:
setupContext
in class AbstractManagerBuilder<GFApplicationConfigurationManager,GFApplicationConfigurationManager.ManagerBuilder>
build
public GFApplicationConfigurationManager build()
- Specified by:
build
in class AbstractManagerBuilder<GFApplicationConfigurationManager,GFApplicationConfigurationManager.ManagerBuilder>
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.