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 Hlasů)

RE: How to know my service context/infrastructure?
Odpověď
20.8.19 12:23 jako reakce na Andrea 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 Hlasů)