Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BISERVER-14154] - race condition in BarrierBeanProcessor #4296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@

package org.pentaho.platform.engine.core.system.objfac.spring;

import org.apache.commons.collections.ListUtils;
import org.pentaho.platform.servicecoordination.api.IServiceBarrier;
import org.pentaho.platform.servicecoordination.api.IServiceBarrierManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
Expand All @@ -32,12 +38,6 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.collections.ListUtils;
import org.pentaho.platform.servicecoordination.api.IServiceBarrier;
import org.pentaho.platform.servicecoordination.api.IServiceBarrierManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author tkafalas
*/
Expand All @@ -48,13 +48,14 @@ public class BarrierBeanProcessor {
private Map<String, List<BarrierBean>> barrierBeans = new ConcurrentHashMap<String, List<BarrierBean>>();
private Map<String, Set<String>> beanBarriers = new ConcurrentHashMap<String, Set<String>>();

static {
barrierBeanProcessor = new BarrierBeanProcessor();
}

private BarrierBeanProcessor() {
}

public static BarrierBeanProcessor getInstance() {
if ( barrierBeanProcessor == null ) {
barrierBeanProcessor = new BarrierBeanProcessor();
}
return barrierBeanProcessor;
}

Expand Down Expand Up @@ -99,7 +100,7 @@ public void registerBarrierBeans( String barrierBeanFilePath ) {
* maintained so that plugins can add their own barrierBeans if necessary. Registered barrierBeans will be held just
* prior to bean initialization. See {@link BarrierBeanPostProcessor}
*
* @param barrierBeanFilePath
* @param barrierBeanProperties
* @return
*/
@SuppressWarnings( "unchecked" )
Expand Down