package nl.tudelft.simulation.naming.context; import java.util.Hashtable; /** * A factory for JVMContext instances, automatically invoked by JNDI when the correct jndi.properties file has been used. *
* Copyright (c) 2002-2021 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information https://simulation.tudelft.nl. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * * https://simulation.tudelft.nl/dsol/3.0/license.html. *
* @author Peter Jacobs * @author Alexander Verbraeck */ public class JVMContextFactory implements ContextFactory { /** context refers to the static JVMContext. */ private static JVMContext context = null; /** {@inheritDoc} */ @Override public synchronized ContextInterface getInitialContext(final Hashtable, ?> environment, final String atomicName) { if (context == null) { JVMContextFactory.context = new JVMContext(atomicName); } return context; } }