All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.virtdata.libbasics.core.threadstate.SharedState Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
package io.virtdata.libbasics.core.threadstate;

import java.util.*;

/**
 * This provides common thread local instancing for sharing a thread local map across classes.
 */
public class SharedState {

    // A thread-local map of objects by name
    public static ThreadLocal> tl_ObjectMap = ThreadLocal.withInitial(HashMap::new);

    // A thread-local stack of objects by name
    public static ThreadLocal> tl_ObjectStack = ThreadLocal.withInitial(ArrayDeque::new);

    // A global map of objects for constant pool, etc.
    public static Map gl_ObjectMap = new HashMap<>();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy