28 lines
864 B
Java
28 lines
864 B
Java
package org.gcube.vremanagement.vremodeler.impl;
|
|
|
|
import org.gcube.common.core.contexts.GCUBEServiceContext;
|
|
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
|
import org.gcube.vremanagement.vremodeler.db.IStoDBUtil;
|
|
|
|
public class ServiceContext extends GCUBEServiceContext{
|
|
|
|
/** Single context instance, created eagerly */
|
|
private static ServiceContext cache = new ServiceContext();
|
|
|
|
/** Returns cached instance */
|
|
public static ServiceContext getContext() {return cache;}
|
|
|
|
/** Prevents accidental creation of more instances */
|
|
private ServiceContext(){};
|
|
|
|
/** {@inheritDoc} */
|
|
protected String getJNDIName() {return "gcube/vdlmanagement/vdlmodeler";}
|
|
|
|
protected void onReady() throws Exception{
|
|
logger.info("ready event invoked on " + this.getName());
|
|
IStoDBUtil.initDB(ServiceContext.getContext().getStartScopes()[0]);
|
|
|
|
}
|
|
|
|
}
|