title: Hazelcast MapStore as Spring Component
body: <p>I'm new to spring-boot and hazelcast. I have a spring-boot application with a service layer which should use a hazelcast imap. The problem I have is that I don't know how I get the mapstore which stores the data to a spring component with only java configuration. Adding the component annotation is not enough and my autowired repository is null.</p>
  
  <pre><code>@Component
  public class MyMapStore extends implements MapStore&lt;Long, MyClass&gt;, MapLoaderLifecycleSupport{
  @Autowired
  private MyRepository repository;
  ...
  }
  </code></pre>
  
  <p>I wrote a static ContextAccessor to load my bean, manually but this only works in the IDEs environment and not if I start my application as jar</p>
  
  <pre><code>@Component
  public class MyMapStore extends implements MapStore&lt;Long, MyClass&gt;, MapLoaderLifecycleSupport{
  
  private MyRepository repository = StaticContextAccessor.getBean(MyRepository.class);
  ...
  }
  </code></pre>
  
  <p>The problem here is that not all beans have bean loaded already and the repository is not initialized.</p>
  
  <p>Is there any posibility to get the mapstore running as spring component or even force hazelcast to be initializes after my repositories have been loaded?
  Thanks for your help.</p>