Package org.apache.felix.scr.impl.config
Class ScrConfigurationImpl
- java.lang.Object
-
- org.apache.felix.scr.impl.config.ScrConfigurationImpl
-
- All Implemented Interfaces:
LogConfiguration,ScrConfiguration
public class ScrConfigurationImpl extends java.lang.Object implements ScrConfiguration
TheScrConfigurationclass conveys configuration for the Felix DS implementation bundle.Configuration Source
- Framework properties: These are read when the Declarative Services implementation is first started.
- Configuration Admin Service: Properties are provided by means of a
ManagedServicewith Service PIDorg.apache.felix.scr.ScrService. This class uses an OSGi Service Factory (ScrManagedServiceServiceFactory) to register the managed service without requiring the Configuration Admin Service API to be required upfront.
See the Configuration section of the Apache Felix Service Component Runtime documentation page for detailed information.
-
-
Field Summary
Fields Modifier and Type Field Description private Activatoractivatorprivate org.osgi.framework.BundleContextbundleContextprivate booleancacheMetadataprivate booleanfactoryEnabledprivate java.lang.BooleanglobalExtenderprivate booleaninfoAsServiceprivate booleanisLogEnabledprivate booleanisLogExtensionEnabledprivate booleankeepInstancesprivate longlockTimeoutprivate static java.lang.StringLOG_LEVEL_DEBUGprivate static java.lang.StringLOG_LEVEL_ERRORprivate static java.lang.StringLOG_LEVEL_INFOprivate static java.lang.StringLOG_LEVEL_WARNprivate InternalLogger.LevellogLevelprivate org.osgi.framework.ServiceRegistration<?>managedServiceRefprivate org.osgi.framework.ServiceRegistration<?>metatypeProviderRefprivate static java.lang.StringPROP_SHOWERRORSprivate static java.lang.StringPROP_SHOWTRACEprivate ComponentCommandsscrCommandprivate longserviceChangecountTimeoutprivate longstopTimeoutprivate static java.lang.StringVALUE_TRUE-
Fields inherited from interface org.apache.felix.scr.impl.logger.LogConfiguration
PROP_LOG_ENABLED, PROP_LOG_EXTENSION, PROP_LOGLEVEL
-
Fields inherited from interface org.apache.felix.scr.impl.manager.ScrConfiguration
DEFAULT_LOCK_TIMEOUT_MILLISECONDS, DEFAULT_SERVICE_CHANGECOUNT_TIMEOUT_MILLISECONDS, DEFAULT_STOP_TIMEOUT_MILLISECONDS, PID, PROP_CACHE_METADATA, PROP_DELAYED_KEEP_INSTANCES, PROP_FACTORY_ENABLED, PROP_GLOBAL_EXTENDER, PROP_INFO_SERVICE, PROP_LOCK_TIMEOUT, PROP_SERVICE_CHANGECOUNT_TIMEOUT, PROP_STOP_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description ScrConfigurationImpl(Activator activator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancacheMetadata()private booleancheckIfLogEnabled(java.util.Dictionary<java.lang.String,?> properties)(package private) voidconfigure(java.util.Dictionary<java.lang.String,?> config, boolean fromConfig)private booleangetDefaultCacheMetadata()private booleangetDefaultFactoryEnabled()private booleangetDefaultGlobalExtender()private booleangetDefaultInfoAsService()private booleangetDefaultKeepInstances()private longgetDefaultLockTimeout()private booleangetDefaultLogEnabled()private booleangetDefaultLogExtension()private InternalLogger.LevelgetDefaultLogLevel()private longgetDefaultStopTimeout()InternalLogger.LevelgetLogLevel()Returns the current log level.private InternalLogger.LevelgetLogLevel(java.lang.Object levelObject)private longgetServiceChangecountTimeout()booleanglobalExtender()booleaninfoAsService()booleanisFactoryEnabled()booleanisLogEnabled()Checks if the logging is enabled.booleanisLogExtensionEnabled()Checks if the log extension is enabled.booleankeepInstances()longlockTimeout()longserviceChangecountTimeout()voidsetScrCommand(ComponentCommands scrCommand)voidstart(org.osgi.framework.BundleContext bundleContext)voidstop()longstopTimeout()
-
-
-
Field Detail
-
VALUE_TRUE
private static final java.lang.String VALUE_TRUE
-
LOG_LEVEL_DEBUG
private static final java.lang.String LOG_LEVEL_DEBUG
- See Also:
- Constant Field Values
-
LOG_LEVEL_INFO
private static final java.lang.String LOG_LEVEL_INFO
- See Also:
- Constant Field Values
-
LOG_LEVEL_WARN
private static final java.lang.String LOG_LEVEL_WARN
- See Also:
- Constant Field Values
-
LOG_LEVEL_ERROR
private static final java.lang.String LOG_LEVEL_ERROR
- See Also:
- Constant Field Values
-
PROP_SHOWTRACE
private static final java.lang.String PROP_SHOWTRACE
- See Also:
- Constant Field Values
-
PROP_SHOWERRORS
private static final java.lang.String PROP_SHOWERRORS
- See Also:
- Constant Field Values
-
activator
private final Activator activator
-
logLevel
private InternalLogger.Level logLevel
-
factoryEnabled
private boolean factoryEnabled
-
keepInstances
private boolean keepInstances
-
infoAsService
private boolean infoAsService
-
cacheMetadata
private boolean cacheMetadata
-
isLogEnabled
private boolean isLogEnabled
-
isLogExtensionEnabled
private boolean isLogExtensionEnabled
-
lockTimeout
private long lockTimeout
-
stopTimeout
private long stopTimeout
-
serviceChangecountTimeout
private long serviceChangecountTimeout
-
globalExtender
private java.lang.Boolean globalExtender
-
bundleContext
private volatile org.osgi.framework.BundleContext bundleContext
-
managedServiceRef
private volatile org.osgi.framework.ServiceRegistration<?> managedServiceRef
-
metatypeProviderRef
private volatile org.osgi.framework.ServiceRegistration<?> metatypeProviderRef
-
scrCommand
private ComponentCommands scrCommand
-
-
Constructor Detail
-
ScrConfigurationImpl
public ScrConfigurationImpl(Activator activator)
-
-
Method Detail
-
start
public void start(org.osgi.framework.BundleContext bundleContext)
-
stop
public void stop()
-
setScrCommand
public void setScrCommand(ComponentCommands scrCommand)
-
configure
void configure(java.util.Dictionary<java.lang.String,?> config, boolean fromConfig)
-
getLogLevel
public InternalLogger.Level getLogLevel()
Returns the current log level. Note that this log level is not used with an R7 LogService implementation.- Specified by:
getLogLevelin interfaceLogConfiguration- Returns:
-
isFactoryEnabled
public boolean isFactoryEnabled()
- Specified by:
isFactoryEnabledin interfaceScrConfiguration
-
keepInstances
public boolean keepInstances()
- Specified by:
keepInstancesin interfaceScrConfiguration
-
infoAsService
public boolean infoAsService()
- Specified by:
infoAsServicein interfaceScrConfiguration
-
lockTimeout
public long lockTimeout()
- Specified by:
lockTimeoutin interfaceScrConfiguration
-
stopTimeout
public long stopTimeout()
- Specified by:
stopTimeoutin interfaceScrConfiguration
-
globalExtender
public boolean globalExtender()
- Specified by:
globalExtenderin interfaceScrConfiguration
-
cacheMetadata
public boolean cacheMetadata()
- Specified by:
cacheMetadatain interfaceScrConfiguration
-
serviceChangecountTimeout
public long serviceChangecountTimeout()
- Specified by:
serviceChangecountTimeoutin interfaceScrConfiguration
-
getDefaultFactoryEnabled
private boolean getDefaultFactoryEnabled()
-
getDefaultKeepInstances
private boolean getDefaultKeepInstances()
-
getDefaultLogLevel
private InternalLogger.Level getDefaultLogLevel()
-
getDefaultInfoAsService
private boolean getDefaultInfoAsService()
-
getDefaultLockTimeout
private long getDefaultLockTimeout()
-
getDefaultStopTimeout
private long getDefaultStopTimeout()
-
getServiceChangecountTimeout
private long getServiceChangecountTimeout()
-
getDefaultGlobalExtender
private boolean getDefaultGlobalExtender()
-
getDefaultCacheMetadata
private boolean getDefaultCacheMetadata()
-
getLogLevel
private InternalLogger.Level getLogLevel(java.lang.Object levelObject)
-
isLogEnabled
public boolean isLogEnabled()
Description copied from interface:LogConfigurationChecks if the logging is enabled. Disabling logging is incompatible with the OSGi specification.- Specified by:
isLogEnabledin interfaceLogConfiguration- Returns:
trueif enabled otherwisefalse
-
isLogExtensionEnabled
public boolean isLogExtensionEnabled()
Description copied from interface:LogConfigurationChecks if the log extension is enabled. The extension is incompatible with the OSGi specification.- Specified by:
isLogExtensionEnabledin interfaceLogConfiguration- Returns:
trueif enabled otherwisefalse
-
getDefaultLogExtension
private boolean getDefaultLogExtension()
-
getDefaultLogEnabled
private boolean getDefaultLogEnabled()
-
checkIfLogEnabled
private boolean checkIfLogEnabled(java.util.Dictionary<java.lang.String,?> properties)
-
-