D4Science Forum D4Science Forum

Development

How to know my service context/infrastructure?

Toggle
How to know in which context/infrastructure is my service running programmatically?
0 (0 Suara)

RE: How to know my service context/infrastructure?
Jawaban
20/08/19 12:23 Sebagai MembalasAndrea Rossi.

It is very easy with SmartGears:

  

import org.gcube.smartgears.ContextProvider;

import org.gcube.smartgears.context.application.ApplicationContext;

 

...

    ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears

    String rootContext = "/"+ctx.container().configuration().infrastructure();

0 (0 Suara)