Improving skelethon

This commit is contained in:
Luca Frosini 2024-05-30 12:23:30 +02:00
parent 338028da91
commit 84230fe441
3 changed files with 28 additions and 10 deletions

View File

@ -5,20 +5,14 @@
</encoder> </encoder>
</appender> </appender>
<logger name="org.gcube.service.helloword" level="DEBUG" /> <logger name="org.gcube.smartgears" level="INFO" />
<logger name="org.gcube.smartgears" level="DEBUG" />
<!-- <!--
<logger name="org.gcube" level="DEBUG" /> <logger name="org.gcube" level="DEBUG" />
<logger name="org.gcube.smartgears" level="TRACE" /> <logger name="org.gcube.smartgears" level="TRACE" />
<logger name="org.gcube.smartgears.handlers" level="TRACE" /> <logger name="org.gcube.smartgears.handlers" level="TRACE" />
<logger name="org.gcube.common.events" level="WARN" /> <logger name="org.gcube.common.events" level="WARN" />
<logger name="org.gcube.data.publishing" level="ERROR" />
<logger name="org.gcube.documentstore" level="ERROR" />
<logger name="org.gcube.common.core.publisher.is.legacy" level="TRACE" />
<logger name="org.gcube.data.access" level="TRACE" />
<logger name="org.gcube.data.access.storagehub.handlers" level="DEBUG" />
--> -->
<logger name="org.gcube.resourcemanagement" level="TRACE" />
<root level="INFO"> <root level="INFO">
<appender-ref ref="STDOUT" /> <appender-ref ref="STDOUT" />

13
pom.xml
View File

@ -106,6 +106,19 @@
<groupId>org.glassfish.jersey.containers</groupId> <groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId> <artifactId>jersey-container-servlet</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
</dependency>
<!-- One of jersey-hk2 or jersey-cdi2-se is needed to allow RMIntializer working -->
<!--
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-cdi2-se</artifactId>
</dependency>
-->
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>gxHTTP</artifactId> <artifactId>gxHTTP</artifactId>

View File

@ -3,6 +3,7 @@ package org.gcube.resourcemanagement;
import org.gcube.common.security.providers.SecretManagerProvider; import org.gcube.common.security.providers.SecretManagerProvider;
import org.gcube.smartgears.ApplicationManager; import org.gcube.smartgears.ApplicationManager;
import org.gcube.smartgears.ContextProvider; import org.gcube.smartgears.ContextProvider;
import org.gcube.smartgears.configuration.Mode;
import org.gcube.smartgears.context.application.ApplicationContext; import org.gcube.smartgears.context.application.ApplicationContext;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -29,7 +30,12 @@ public class ResourceManager implements ApplicationManager {
@Override @Override
public synchronized void onInit() { public synchronized void onInit() {
String context = SecretManagerProvider.get().getContext(); if (ContextProvider.get().container().configuration().mode() == Mode.offline) {
logger.debug("Init called in offline mode");
return;
}
String context = ""; // SecretManagerProvider.get().getContext();
logger.trace( logger.trace(
"\n-------------------------------------------------------\n" "\n-------------------------------------------------------\n"
@ -58,6 +64,11 @@ public class ResourceManager implements ApplicationManager {
*/ */
@Override @Override
public synchronized void onShutdown(){ public synchronized void onShutdown(){
if (ContextProvider.get().container().configuration().mode() == Mode.offline) {
logger.debug("Init called in offline mode");
return;
}
String context = SecretManagerProvider.get().getContext(); String context = SecretManagerProvider.get().getContext();
logger.trace( logger.trace(