fixed ckanutils creation
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129464 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
ee5218ad24
commit
d04b8adc20
|
@ -64,6 +64,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
|
||||
// ckan utils methods
|
||||
private CKanUtilsImpl instance;
|
||||
private Object LOCK = new Object();
|
||||
|
||||
/**
|
||||
* Since it needs the scope, we need to check if it is null or not
|
||||
|
@ -71,6 +72,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
*/
|
||||
private CKanUtilsImpl getCkanUtilsObj(){
|
||||
|
||||
if(instance == null){
|
||||
synchronized(LOCK){
|
||||
if(instance == null){
|
||||
// retrieve ckan information
|
||||
try{
|
||||
|
@ -81,6 +84,8 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
logger.error("Unable to retrieve ckan information", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue