public HAModClusterService(HAModClusterConfig config, LoadBalanceFactorProvider loadBalanceFactorProvider, HAPartition partition, HASingletonElectionPolicy electionPolicy) { super(new HAServiceEventFactory()); this.setHAPartition(partition); this.setElectionPolicy(electionPolicy); this.rpcHandler = new RpcHandler(); this.requestFactory = new DefaultMCMPRequestFactory(); this.responseParser = new DefaultMCMPResponseParser(); this.resetRequestSource = new ClusteredResetRequestSource(config, config, this.requestFactory, this, this); this.localHandler = new DefaultMCMPHandler(config, this.resetRequestSource, this.requestFactory, this.responseParser); this.clusteredHandler = new ClusteredMCMPHandlerImpl(this.localHandler, this, this); this.drmEntry = new ModClusterServiceDRMEntry(partition.getClusterNode(), null); this.service = new ClusteredModClusterService(config, config, config, new SimpleLoadBalanceFactorProviderFactory(loadBalanceFactorProvider), this.requestFactory, this.responseParser, this.resetRequestSource, this.clusteredHandler, new AdvertiseListenerFactoryImpl()); this.loadBalancingGroup = config.getLoadBalancingGroup(); this.masterPerLoadBalancingGroup = config.isMasterPerLoadBalancingGroup(); }