我想注入一个 bean,它将在 hazelcast 中保留地图条目。
<map name="storethiselements-map">
<backup-count>1</backup-count>
<map-store enabled="true">
<class-name>name.of.MapPersistenceObject</class-name>
<write-delay-seconds>0</write-delay-seconds>
</map-store>
</map>
这些是 hazelcast 实例的构造函数参数。在 MapPersistenceObject 中存在一个负责持久化条目的服务。我已将 MapPersistenceObject 标记为组件并使 Service-Object 自动装配,以便 Spring 将使用正确的数据源注入正确的 Service-Bean。
我已经尝试过了,但我得到了一个 NullPointer,应该在其中注入服务。在我看来,Spring 无法将 MapPersistenceObject 与服务连接或自动连接。它看起来像这样:
@Component
public class MapPersistenceObject implements
MapLoader<Long, DeviceWakeupAction>, MapStore<Long, DeviceWakeupAction> {
@Autowired
StoreMapEntries storeMapEntriesService;
[...]
也许有人知道问题的解决方案?
问候 && tia noircc