D4Science Forum D4Science Forum

Development

How to know my service context/infrastructure?

टॉगल करें
How to know my service context/infrastructure?
उत्तर
20/8/19 12:19 अपराह्न
How to know in which context/infrastructure is my service running programmatically?
0 (0 वोट्स)

RE: How to know my service context/infrastructure?
उत्तर
20/8/19 12:23 अपराह्न as a reply to 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 वोट्स)