D4Science Forum D4Science Forum

Development

How to know my service context/infrastructure?

Toggle
How to know my service context/infrastructure?
Câu trả lời
12:19 20/08/2019
How to know in which context/infrastructure is my service running programmatically?
0 (0 Bình chọn)

RE: How to know my service context/infrastructure?
Câu trả lời
12:23 20/08/2019 gửi bài phản hồi tới 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 Bình chọn)