org.springframework.osgi.context
Interface ConfigurableOsgiBundleApplicationContext

All Superinterfaces:
ApplicationContext, ApplicationEventPublisher, BeanFactory, ConfigurableApplicationContext, HierarchicalBeanFactory, Lifecycle, ListableBeanFactory, MessageSource, ResourceLoader, ResourcePatternResolver
All Known Implementing Classes:
org.springframework.osgi.internal.context.support.AbstractDelegatedExecutionApplicationContext, AbstractOsgiBundleApplicationContext, OsgiBundleXmlApplicationContext

public interface ConfigurableOsgiBundleApplicationContext
extends ConfigurableApplicationContext

Interface to be implemented by configurable OSGi bundle application contexts.

Note: The setters of this interface need to be called before an invocation of the refresh method inherited from ConfigurableApplicationContext. They do not cause an initialization of the context on their own.

Author:
Costin Leau

Field Summary
static String APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME
          Service entry used for specifying the application context name when published as an OSGi service
static String BUNDLE_CONTEXT_BEAN_NAME
          Bean name under which the OSGi bundle context is published as a singleton.
 
Fields inherited from interface org.springframework.context.ConfigurableApplicationContext
LOAD_TIME_WEAVER_BEAN_NAME
 
Fields inherited from interface org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX
 
Fields inherited from interface org.springframework.core.io.support.ResourcePatternResolver
CLASSPATH_ALL_URL_PREFIX
 
Fields inherited from interface org.springframework.core.io.ResourceLoader
CLASSPATH_URL_PREFIX
 
Method Summary
 Bundle getBundle()
          Return the OSGi bundle for this application context.
 BundleContext getBundleContext()
          Return the bundle context for this application context.
 void setBundleContext(BundleContext bundleContext)
          Set the BundleContext for this OSGi bundle application context.
 void setConfigLocations(String[] configLocations)
          Set the config locations for this OSGi bundle application context.
 void setPublishContextAsService(boolean publishContextAsService)
          Publish the application context as an OSGi service.
 
Methods inherited from interface org.springframework.context.ConfigurableApplicationContext
addApplicationListener, addBeanFactoryPostProcessor, close, getBeanFactory, isActive, refresh, registerShutdownHook, setParent
 
Methods inherited from interface org.springframework.context.ApplicationContext
getAutowireCapableBeanFactory, getDisplayName, getParent, getStartupDate
 
Methods inherited from interface org.springframework.beans.factory.ListableBeanFactory
containsBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForType, getBeanNamesForType, getBeansOfType, getBeansOfType
 
Methods inherited from interface org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getType, isPrototype, isSingleton, isTypeMatch
 
Methods inherited from interface org.springframework.context.MessageSource
getMessage, getMessage, getMessage
 
Methods inherited from interface org.springframework.context.ApplicationEventPublisher
publishEvent
 
Methods inherited from interface org.springframework.core.io.support.ResourcePatternResolver
getResources
 
Methods inherited from interface org.springframework.core.io.ResourceLoader
getClassLoader, getResource
 
Methods inherited from interface org.springframework.context.Lifecycle
isRunning, start, stop
 

Field Detail

APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME

static final String APPLICATION_CONTEXT_SERVICE_PROPERTY_NAME
Service entry used for specifying the application context name when published as an OSGi service

See Also:
Constant Field Values

BUNDLE_CONTEXT_BEAN_NAME

static final String BUNDLE_CONTEXT_BEAN_NAME
Bean name under which the OSGi bundle context is published as a singleton.

See Also:
Constant Field Values
Method Detail

setConfigLocations

void setConfigLocations(String[] configLocations)
Set the config locations for this OSGi bundle application context. If not set, the implementation is supposed to use a default for the given namespace.


setBundleContext

void setBundleContext(BundleContext bundleContext)
Set the BundleContext for this OSGi bundle application context.

Does not cause an initialization of the context: refresh needs to be called after the setting of all configuration properties.

See Also:
ConfigurableApplicationContext.refresh()

getBundleContext

BundleContext getBundleContext()
Return the bundle context for this application context. This method is offered as a helper since as of OSGi 4.1, the bundle context can be discovered from a given bundle.

Returns:
See Also:
getBundle()

getBundle

Bundle getBundle()
Return the OSGi bundle for this application context.

Returns:
the Bundle for this OSGi bundle application context.

setPublishContextAsService

void setPublishContextAsService(boolean publishContextAsService)
Publish the application context as an OSGi service.

Parameters:
publishContextAsService - The publishContextAsService to set.


Copyright © 2006-2007 Spring Framework. All Rights Reserved.