1 package com.atlassian.plugin.osgi.spring.external;
2
3 import org.osgi.framework.Bundle;
4 import org.springframework.context.ConfigurableApplicationContext;
5
6 /**
7 * Hook to customize the spring application context before it is populated
8 *
9 * @since 2.6
10 */
11 public interface ApplicationContextPreProcessor {
12 /**
13 * Detects if this bundle is a Spring bundle. This allows a pre-processor to have a Spring context built for a
14 * bundle even if the bundle doesn't have the Spring context header or any XML files in META-INF/spring.
15 *
16 * @param bundle The bundle to create an application context for
17 * @return True if a spring context should be created, false otherwise
18 */
19 boolean isSpringPoweredBundle(Bundle bundle);
20
21 /**
22 * Process a context before it is populated, usually via adding
23 * {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor} instances.
24 *
25 * @param bundle The target bundle
26 * @param applicationContext The target application context before population
27 */
28 void process(Bundle bundle, ConfigurableApplicationContext applicationContext);
29 }