Skip to content

Commit

Permalink
Bug 37237041 - [37193730->14.1.2.0.1] $SYS:Config:EventDispatcher thr…
Browse files Browse the repository at this point in the history
…ows NPE when coherence-mp-config used on storage-disabled node (14.1.2.0 cl 112539 --> ce/14.1.2.0)

[git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v14.1.2.0/": change = 113177]
  • Loading branch information
fryp committed Jan 4, 2025
1 parent 9314d69 commit cad03d0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
Expand Down Expand Up @@ -90,6 +90,12 @@ public String getCacheName()
return f_sCacheName;
}

@Override
public CacheService getCacheService()
{
return f_service;
}

@Override
public String getServiceName()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/*
* Copyright (c) 2020 Oracle and/or its affiliates.
* Copyright (c) 2020, 2025 Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
* https://oss.oracle.com/licenses/upl.
*/
package com.tangosol.net.events.partition.cache;

import com.tangosol.net.CacheService;

import com.tangosol.net.events.EventDispatcher;

/**
Expand Down Expand Up @@ -34,6 +36,13 @@ public interface CacheLifecycleEventDispatcher
*/
public String getServiceName();

/**
* Return the {@link CacheService} associated with this dispatcher.
*
* @return the {@link CacheService}
*/
public CacheService getCacheService();

/**
* Return the optional scope name that this dispatcher is associated with.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
package com.oracle.coherence.grpc.client.common;

import com.tangosol.internal.net.ConfigurableCacheFactorySession;

import com.tangosol.net.CacheService;
import com.tangosol.net.Coherence;
import com.tangosol.net.NamedCache;

Expand Down Expand Up @@ -71,6 +73,12 @@ public String getScopeName()
{
return f_service == null ? Coherence.SYSTEM_SCOPE : f_service.getScopeName();
}

@Override
public CacheService getCacheService()
{
return getService();
}

// ----- RemoteSessionDispatcher methods --------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
/*
* Copyright (c) 2000, 2022, Oracle and/or its affiliates.
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* https://oss.oracle.com/licenses/upl.
*/
package com.oracle.coherence.mp.config;

import com.oracle.coherence.common.base.Classes;
import com.oracle.coherence.cdi.events.Activated;
import com.oracle.coherence.cdi.events.MapName;
import com.oracle.coherence.cdi.events.ScopeName;

import com.oracle.coherence.common.base.Classes;

import com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache;

import com.tangosol.net.CacheService;
import com.tangosol.net.Coherence;
import com.tangosol.net.ConfigurableCacheFactory;
Expand All @@ -23,7 +25,6 @@

import com.tangosol.net.events.partition.cache.CacheLifecycleEvent;
import com.tangosol.net.events.partition.cache.CacheLifecycleEventDispatcher;
import com.tangosol.net.events.partition.cache.PartitionedCacheDispatcher;
import com.tangosol.util.MapEvent;

import java.util.Collections;
Expand Down Expand Up @@ -184,8 +185,7 @@ public void onEvent(CacheLifecycleEvent event)

if (event.getType() == CacheLifecycleEvent.Type.CREATED)
{
m_configMap = ((PartitionedCacheDispatcher) event.getEventDispatcher()).getBackingMapContext()
.getManagerContext().getCacheService().ensureCache(MAP_NAME, Classes.getContextClassLoader());
m_configMap = event.getEventDispatcher().getCacheService().ensureCache(MAP_NAME, Classes.getContextClassLoader());
}
}

Expand Down

0 comments on commit cad03d0

Please sign in to comment.