67 lines
1.8 KiB
Java
67 lines
1.8 KiB
Java
|
package org.gcube.social_networking;
|
||
|
|
||
|
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
||
|
import org.gcube.smartgears.ApplicationManager;
|
||
|
import org.slf4j.Logger;
|
||
|
import org.slf4j.LoggerFactory;
|
||
|
|
||
|
/**
|
||
|
* @author Luca Frosini (ISTI - CNR)
|
||
|
*/
|
||
|
public class HelloWorldInitializator implements ApplicationManager {
|
||
|
|
||
|
/**
|
||
|
* Logger
|
||
|
*/
|
||
|
private static Logger logger = LoggerFactory.getLogger(HelloWorldInitializator.class);
|
||
|
|
||
|
public static boolean initialised;
|
||
|
|
||
|
/**
|
||
|
* {@inheritDoc}
|
||
|
*/
|
||
|
@Override
|
||
|
public synchronized void onInit() {
|
||
|
|
||
|
String context = SecretManagerProvider.instance.get().getContext();
|
||
|
|
||
|
logger.trace(
|
||
|
"\n-------------------------------------------------------\n"
|
||
|
+ "Hello World Service is Starting on context {}\n"
|
||
|
+ "-------------------------------------------------------",
|
||
|
context);
|
||
|
|
||
|
// ApplicationContext applicationContext = ContextProvider.get();
|
||
|
// String helloWorldEServiceID = applicationContext.id();
|
||
|
|
||
|
logger.trace(
|
||
|
"\n-------------------------------------------------------\n"
|
||
|
+ "Hello World Service Started Successfully on context {}\n"
|
||
|
+ "-------------------------------------------------------",
|
||
|
context);
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* {@inheritDoc}
|
||
|
*/
|
||
|
@Override
|
||
|
public synchronized void onShutdown(){
|
||
|
|
||
|
String context = SecretManagerProvider.instance.get().getContext();
|
||
|
|
||
|
logger.trace(
|
||
|
"\n-------------------------------------------------------\n"
|
||
|
+ "Hello World Service is Stopping on context {}\n"
|
||
|
+ "-------------------------------------------------------",
|
||
|
context);
|
||
|
|
||
|
|
||
|
logger.trace(
|
||
|
"\n-------------------------------------------------------\n"
|
||
|
+ "Hello World Service Stopped Successfully on context {}\n"
|
||
|
+ "-------------------------------------------------------",
|
||
|
context);
|
||
|
}
|
||
|
}
|