Tabnine Logo
ApplicationContextHolder.getApplicationContext
Code IndexAdd Tabnine to your IDE (free)

How to use
getApplicationContext
method
in
org.finra.herd.core.ApplicationContextHolder

Best Java code snippets using org.finra.herd.core.ApplicationContextHolder.getApplicationContext (Showing top 20 results out of 315)

origin: org.finra.herd/herd-dao

/**
 * Gets the data source bean from the application context statically. This is needed for static @Bean creation methods that won't have access to an
 * auto-wired data source.
 *
 * @return the data source.
 */
public static DataSource getHerdDataSource()
{
  return (DataSource) ApplicationContextHolder.getApplicationContext().getBean(HERD_DATA_SOURCE_BEAN_NAME);
}
origin: org.finra.herd/herd-service

/**
 * Determines whether Quartz tables need to be created which should return true for JUnits only.
 *
 * @return whether Quartz tables need to be created.
 */
private Boolean shouldCreateQuartzTables()
{
  return (Boolean) ApplicationContextHolder.getApplicationContext().getBean(CREATE_QUARTZ_TABLES_BEAN_NAME);
}
origin: FINRAOS/herd

/**
 * Gets the data source bean from the application context statically. This is needed for static @Bean creation methods that won't have access to an
 * auto-wired data source.
 *
 * @return the data source.
 */
public static DataSource getHerdDataSource()
{
  return (DataSource) ApplicationContextHolder.getApplicationContext().getBean(HERD_DATA_SOURCE_BEAN_NAME);
}
origin: org.finra.herd/herd-service

/**
 * Gets the Activiti database schema update param from the application context statically.
 *
 * @return the Activiti database schema update param.
 */
private String getActivitiDbSchemaUpdateParamBeanName()
{
  return (String) ApplicationContextHolder.getApplicationContext().getBean(ACTIVITI_DB_SCHEMA_UPDATE_PARAM_BEAN_NAME);
}
origin: FINRAOS/herd

/**
 * Gets the Hibernate HBM2DDL bean from the application context statically.
 *
 * @return the Hibernate HBM2DDL auto param.
 */
public String getHibernateHbm2DdlAutoParam()
{
  return (String) ApplicationContextHolder.getApplicationContext().getBean(HIBERNATE_HBM2DDL_AUTO_PARAM_BEAN_NAME);
}
origin: FINRAOS/herd

/**
 * Gets the Activiti database schema update param from the application context statically.
 *
 * @return the Activiti database schema update param.
 */
private String getActivitiDbSchemaUpdateParamBeanName()
{
  return (String) ApplicationContextHolder.getApplicationContext().getBean(ACTIVITI_DB_SCHEMA_UPDATE_PARAM_BEAN_NAME);
}
origin: org.finra.herd/herd-dao

/**
 * Gets the Hibernate HBM2DDL bean from the application context statically.
 *
 * @return the Hibernate HBM2DDL auto param.
 */
public String getHibernateHbm2DdlAutoParam()
{
  return (String) ApplicationContextHolder.getApplicationContext().getBean(HIBERNATE_HBM2DDL_AUTO_PARAM_BEAN_NAME);
}
origin: FINRAOS/herd

/**
 * Determines whether Quartz tables need to be created which should return true for JUnits only.
 *
 * @return whether Quartz tables need to be created.
 */
private Boolean shouldCreateQuartzTables()
{
  return (Boolean) ApplicationContextHolder.getApplicationContext().getBean(CREATE_QUARTZ_TABLES_BEAN_NAME);
}
origin: org.finra.herd/herd-app

/**
 * Retrieves functional points that have no roles mapped to them.
 *
 * @return set of {@link GrantedAuthority} representing functional points
 */
public Set<GrantedAuthority> getUnrestrictedFunctions()
{
  // TODO Getting HerdDao from applicationContext statically because if we try to wire HerdDao here it does not get constructed with proxy class that is
  // needed for @Cacheable methods to work.
  SecurityFunctionDao securityFunctionDao = ApplicationContextHolder.getApplicationContext().getBean(SecurityFunctionDao.class);
  Set<GrantedAuthority> authorities = new HashSet<>();
  // Add all unrestricted functional points.
  for (String function : securityFunctionDao.getUnrestrictedSecurityFunctions())
  {
    authorities.add(new SimpleGrantedAuthority(function));
  }
  return authorities;
}
origin: org.finra.herd/herd-app

SecurityFunctionDao securityFunctionDao = ApplicationContextHolder.getApplicationContext().getBean(SecurityFunctionDao.class);
origin: org.finra.herd/herd-dao

/**
 * The data source for the application.
 *
 * @return the data source.
 */
@Bean
public static DataSource herdDataSource()
{
  // Access the environment using the application context holder since we're in a static method that doesn't have access to the environment in any
  // other way.
  Environment environment = ApplicationContextHolder.getApplicationContext().getEnvironment();
  // Get the configuration property for the data source JNDI name.
  String dataSourceJndiName = ConfigurationHelper.getProperty(ConfigurationValue.HERD_DATA_SOURCE_JNDI_NAME, environment);
  // Return a new JNDI data source.
  return new JndiDataSourceLookup().getDataSource(dataSourceJndiName);
}
origin: FINRAOS/herd

/**
 * The data source for the application.
 *
 * @return the data source.
 */
@Bean
public static DataSource herdDataSource()
{
  // Access the environment using the application context holder since we're in a static method that doesn't have access to the environment in any
  // other way.
  Environment environment = ApplicationContextHolder.getApplicationContext().getEnvironment();
  // Get the configuration property for the data source JNDI name.
  String dataSourceJndiName = ConfigurationHelper.getProperty(ConfigurationValue.HERD_DATA_SOURCE_JNDI_NAME, environment);
  // Return a new JNDI data source.
  return new JndiDataSourceLookup().getDataSource(dataSourceJndiName);
}
origin: org.finra.herd/herd-service

JmsListenerEndpointRegistry registry = ApplicationContextHolder.getApplicationContext()
  .getBean("org.springframework.jms.config.internalJmsListenerEndpointRegistry", JmsListenerEndpointRegistry.class);
origin: FINRAOS/herd

JmsListenerEndpointRegistry registry = ApplicationContextHolder.getApplicationContext()
  .getBean("org.springframework.jms.config.internalJmsListenerEndpointRegistry", JmsListenerEndpointRegistry.class);
origin: org.finra.herd/herd-dao

/**
 * The database supplied property sources placeholder configurer that allows access to externalized properties from a database. This method also adds a new
 * property source that contains the database properties to the environment.
 *
 * @return the property sources placeholder configurer.
 */
@Bean
public static PropertySourcesPlaceholderConfigurer databasePropertySourcesPlaceholderConfigurer()
{
  // Get the configurable environment and add a new property source to it that contains the database properties.
  // That way, the properties can be accessed via the environment or via an injected @Value annotation.
  // We are adding this property source last so other property sources (e.g. system properties, environment variables) can be used
  // to override the database properties.
  Environment environment = ApplicationContextHolder.getApplicationContext().getEnvironment();
  if (environment instanceof ConfigurableEnvironment)
  {
    ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment;
    ReloadablePropertySource reloadablePropertySource =
      new ReloadablePropertySource(ReloadablePropertySource.class.getName(), ConfigurationConverter.getProperties(getPropertyDatabaseConfiguration()),
        getPropertyDatabaseConfiguration());
    configurableEnvironment.getPropertySources().addLast(reloadablePropertySource);
  }
  return new PropertySourcesPlaceholderConfigurer();
}
origin: FINRAOS/herd

/**
 * The database supplied property sources placeholder configurer that allows access to externalized properties from a database. This method also adds a new
 * property source that contains the database properties to the environment.
 *
 * @return the property sources placeholder configurer.
 */
@Bean
public static PropertySourcesPlaceholderConfigurer databasePropertySourcesPlaceholderConfigurer()
{
  // Get the configurable environment and add a new property source to it that contains the database properties.
  // That way, the properties can be accessed via the environment or via an injected @Value annotation.
  // We are adding this property source last so other property sources (e.g. system properties, environment variables) can be used
  // to override the database properties.
  Environment environment = ApplicationContextHolder.getApplicationContext().getEnvironment();
  if (environment instanceof ConfigurableEnvironment)
  {
    ConfigurableEnvironment configurableEnvironment = (ConfigurableEnvironment) environment;
    ReloadablePropertySource reloadablePropertySource =
      new ReloadablePropertySource(ReloadablePropertySource.class.getName(), ConfigurationConverter.getProperties(getPropertyDatabaseConfiguration()),
        getPropertyDatabaseConfiguration());
    configurableEnvironment.getPropertySources().addLast(reloadablePropertySource);
  }
  return new PropertySourcesPlaceholderConfigurer();
}
origin: FINRAOS/herd

JmsListenerEndpointRegistry registry = ApplicationContextHolder.getApplicationContext()
  .getBean("org.springframework.jms.config.internalJmsListenerEndpointRegistry", JmsListenerEndpointRegistry.class);
when(registry.getListenerContainer(HerdJmsDestinationResolver.SQS_DESTINATION_STORAGE_POLICY_SELECTOR_JOB_SQS_QUEUE))
origin: FINRAOS/herd

JmsListenerEndpointRegistry registry = ApplicationContextHolder.getApplicationContext()
  .getBean("org.springframework.jms.config.internalJmsListenerEndpointRegistry", JmsListenerEndpointRegistry.class);
when(registry.getListenerContainer(HerdJmsDestinationResolver.SQS_DESTINATION_SEARCH_INDEX_UPDATE_QUEUE)).thenReturn(mockMessageListenerContainer);
origin: FINRAOS/herd

JmsListenerEndpointRegistry registry = ApplicationContextHolder.getApplicationContext()
  .getBean("org.springframework.jms.config.internalJmsListenerEndpointRegistry", JmsListenerEndpointRegistry.class);
when(registry.getListenerContainer(HerdJmsDestinationResolver.SQS_DESTINATION_HERD_INCOMING)).thenReturn(mockMessageListenerContainer);
origin: FINRAOS/herd

JmsListenerEndpointRegistry registry = ApplicationContextHolder.getApplicationContext()
  .getBean("org.springframework.jms.config.internalJmsListenerEndpointRegistry", JmsListenerEndpointRegistry.class);
when(registry.getListenerContainer(HerdJmsDestinationResolver.SQS_DESTINATION_SAMPLE_DATA_QUEUE)).thenReturn(mockMessageListenerContainer);
org.finra.herd.coreApplicationContextHoldergetApplicationContext

Popular methods of ApplicationContextHolder

  • setApplicationContext

Popular in Java

  • Making http post requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • JPanel (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now