get bean
This commit is contained in:
parent
2acc0fa402
commit
43027789d4
1 changed files with 5 additions and 1 deletions
|
|
@ -1,8 +1,10 @@
|
|||
package ru.spcex.clearing.imdg;
|
||||
|
||||
import com.hazelcast.core.HazelcastInstance;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
@SpringBootApplication
|
||||
public class IMDGApplication {
|
||||
|
|
@ -10,7 +12,9 @@ public class IMDGApplication {
|
|||
public static void main(String[] args) {
|
||||
try {
|
||||
SpringApplicationBuilder builder = new SpringApplicationBuilder(IMDGApplication.class);
|
||||
builder.run(args);
|
||||
ConfigurableApplicationContext configurableApplicationContext = builder.run(args);
|
||||
HazelcastInstance hazelcastInstance = configurableApplicationContext.getBean(HazelcastInstance.class);
|
||||
hazelcastInstance.getMap("");
|
||||
} catch (Throwable e) {
|
||||
LoggerFactory.getLogger(IMDGApplication.class).error("STORAGE start failed: {} -> {}", e.getClass().getSimpleName(), e.getMessage());
|
||||
System.exit(-1);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue