Skip to content

Commit 48ad956

Browse files
committed
Bug 37237043 - [37193730->24.09.1] $SYS:Config:EventDispatcher throws NPE when coherence-mp-config used on storage-disabled node
[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v24.09/": change = 112258]
1 parent f8f6b77 commit 48ad956

File tree

4 files changed

+31
-8
lines changed

4 files changed

+31
-8
lines changed

prj/coherence-core/src/main/java/com/tangosol/net/events/internal/StorageDispatcher.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
@@ -90,6 +90,12 @@ public String getCacheName()
9090
return f_sCacheName;
9191
}
9292

93+
@Override
94+
public CacheService getCacheService()
95+
{
96+
return f_service;
97+
}
98+
9399
@Override
94100
public String getServiceName()
95101
{

prj/coherence-core/src/main/java/com/tangosol/net/events/partition/cache/CacheLifecycleEventDispatcher.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*
2-
* Copyright (c) 2020 Oracle and/or its affiliates.
2+
* Copyright (c) 2020, 2024 Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
5-
* http://oss.oracle.com/licenses/upl.
5+
* https://oss.oracle.com/licenses/upl.
66
*/
77
package com.tangosol.net.events.partition.cache;
88

9+
import com.tangosol.net.CacheService;
10+
911
import com.tangosol.net.events.EventDispatcher;
1012

1113
/**
@@ -34,6 +36,13 @@ public interface CacheLifecycleEventDispatcher
3436
*/
3537
public String getServiceName();
3638

39+
/**
40+
* Return the {@link CacheService} associated with this dispatcher.
41+
*
42+
* @return the {@link CacheService}
43+
*/
44+
public CacheService getCacheService();
45+
3746
/**
3847
* Return the optional scope name that this dispatcher is associated with.
3948
*

prj/coherence-grpc-client-common/src/main/java/com/oracle/coherence/grpc/client/common/GrpcCacheLifecycleEventDispatcher.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
package com.oracle.coherence.grpc.client.common;
88

99
import com.tangosol.internal.net.ConfigurableCacheFactorySession;
10+
11+
import com.tangosol.net.CacheService;
1012
import com.tangosol.net.Coherence;
1113
import com.tangosol.net.NamedCache;
1214

@@ -71,6 +73,12 @@ public String getScopeName()
7173
{
7274
return f_service == null ? Coherence.SYSTEM_SCOPE : f_service.getScopeName();
7375
}
76+
77+
@Override
78+
public CacheService getCacheService()
79+
{
80+
return getService();
81+
}
7482

7583
// ----- RemoteSessionDispatcher methods --------------------------------
7684

prj/coherence-mp/config/src/main/java/com/oracle/coherence/mp/config/CoherenceConfigSource.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
/*
2-
* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
33
*
44
* Licensed under the Universal Permissive License v 1.0 as shown at
55
* https://oss.oracle.com/licenses/upl.
66
*/
77
package com.oracle.coherence.mp.config;
88

9-
import com.oracle.coherence.common.base.Classes;
109
import com.oracle.coherence.cdi.events.Activated;
1110
import com.oracle.coherence.cdi.events.MapName;
1211
import com.oracle.coherence.cdi.events.ScopeName;
1312

13+
import com.oracle.coherence.common.base.Classes;
14+
1415
import com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache;
16+
1517
import com.tangosol.net.CacheService;
1618
import com.tangosol.net.Coherence;
1719
import com.tangosol.net.ConfigurableCacheFactory;
@@ -23,7 +25,6 @@
2325

2426
import com.tangosol.net.events.partition.cache.CacheLifecycleEvent;
2527
import com.tangosol.net.events.partition.cache.CacheLifecycleEventDispatcher;
26-
import com.tangosol.net.events.partition.cache.PartitionedCacheDispatcher;
2728
import com.tangosol.util.MapEvent;
2829

2930
import java.util.Collections;
@@ -193,8 +194,7 @@ public void onEvent(CacheLifecycleEvent event)
193194

194195
if (event.getType() == CacheLifecycleEvent.Type.CREATED)
195196
{
196-
m_configMap = ((PartitionedCacheDispatcher) event.getEventDispatcher()).getBackingMapContext()
197-
.getManagerContext().getCacheService().ensureCache(MAP_NAME, Classes.getContextClassLoader());
197+
m_configMap = event.getEventDispatcher().getCacheService().ensureCache(MAP_NAME, Classes.getContextClassLoader());
198198
}
199199
}
200200

0 commit comments

Comments
 (0)