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

org.molgenis.util.ApplicationContextProvider Maven / Gradle / Ivy

There is a newer version: 8.4.5
Show newest version
package org.molgenis.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Can be used by legacy classes to get a reference to the application context
 *
 * @author erwin
 */
// Intended static write from instance
@SuppressWarnings("java:S2696")
public class ApplicationContextProvider implements ApplicationContextAware {
  private static ApplicationContext ctx = null;

  public static ApplicationContext getApplicationContext() {
    return ctx;
  }

  @Override
  public void setApplicationContext(ApplicationContext ctx) {
    ApplicationContextProvider.ctx = ctx;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy