D4Science Forum D4Science Forum

Development

How to know my service context/infrastructure?

触发器
How to know in which context/infrastructure is my service running programmatically?
0 (0 票)

RE: How to know my service context/infrastructure?
答复
19-8-20 下午12:23 回复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 票)