com.tangosol.coherence.config.builder.MapBuilder Maven / Gradle / Ivy
Show all versions of coherence Show documentation
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.coherence.config.builder;
import com.tangosol.config.expression.ParameterResolver;
import com.tangosol.net.BackingMapManagerContext;
import com.tangosol.net.CacheService;
import com.tangosol.net.ConfigurableCacheFactory;
import com.tangosol.util.Base;
import com.tangosol.util.MapListener;
import java.util.Map;
/**
* The {@link MapBuilder} interface is used by a builder to create an instance
* of a {@link Map} that is a local to a Java process.
*
* @author pfm 2011.11.30
* @since Coherence 12.1.2
*/
public interface MapBuilder
{
/**
* Realize a {@link Map} based on the state of the {@link MapBuilder},
* resolvable parameters and provided {@link Dependencies}.
*
* @param resolver the {@link ParameterResolver}
* @param dependencies the {@link Dependencies} for realizing the {@link Map}
*
* @return a {@link Map}
*/
public Map realizeMap(ParameterResolver resolver, Dependencies dependencies);
/**
* The commonly required {@link Dependencies} for realizing a {@link Map}
* with a {@link MapBuilder}.
*/
public static class Dependencies
{
// ----- constructors ----------------------------------------------
/**
* Constructs a {@link Dependencies}.
*
* Note: In some circumstances the properties encapsulated by a {@link Dependencies}
* may not be available or not required. In these cases the properties
* will be a default value or null
.
*
* @param ccf the {@link ConfigurableCacheFactory}
* @param ctxBackingMapManager the BackingMapManagerContext
* @param loader the {@link ClassLoader}
* @param sCacheName the cache name
* @param sServiceType the service type
*/
public Dependencies(ConfigurableCacheFactory ccf, BackingMapManagerContext ctxBackingMapManager,
ClassLoader loader, String sCacheName, String sServiceType)
{
this(ccf, ctxBackingMapManager, loader, sCacheName, sServiceType, null);
}
/**
* Constructs a {@link Dependencies}.
*
* Note: In some circumstances the properties encapsulated by a {@link Dependencies}
* may not be available or not required. In these cases the properties
* will be a default value or null
.
*
* @param ccf the {@link ConfigurableCacheFactory}
* @param ctxBackingMapManager the BackingMapManagerContext
* @param loader the {@link ClassLoader}
* @param sCacheName the cache name
* @param sServiceType the service type
*/
public Dependencies(ConfigurableCacheFactory ccf, BackingMapManagerContext ctxBackingMapManager,
ClassLoader loader, String sCacheName, String sServiceType,
Map