|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IBundleActivationManager
The IBundleActivationManager
interface defines the core API
for SAT's bundle activation strategy.
Method Summary | |
---|---|
Object |
acquireImportedService(String name)
Configuration Method: Acquire the named imported service. |
void |
acquireImportedServices()
Configuration Method: Acquire the imported services. |
Object |
acquireOptionalImportedService(String name)
Configuration Method: Acquire the named optional imported service. |
void |
acquireOptionalImportedServices()
Configuration Method: Acquire the optional imported services. |
void |
addExportedProxyService(Class interfaceType,
IProxyServiceHandler handler,
Dictionary properties)
Configuration Method: Add an exported proxy service. |
void |
addExportedProxyServices(Class[] interfaceTypes,
IProxyServiceHandler handler,
Dictionary properties)
Configuration Method: Add an exported proxy service. |
void |
addExportedService(String name,
Object service,
Dictionary properties)
Configuration Method: Add an exported service with properties. |
void |
addExportedServices(String[] names,
Object service,
Dictionary properties)
Configuration Method: Add multiple exported service with properties. |
void |
addExportServiceRecord(IExportServiceRecord record)
Configuration Method: Add the specified export service record. |
void |
addExportServiceRecords(IExportServiceRecord[] records)
Configuration Method: Add the specified export service records. |
void |
addImportedServiceFilter(String name,
String filterString)
Configuration Method: Add an LDAP filter to an imported service. |
void |
addImportServiceRecord(IImportServiceRecord record)
Configuration Method: Add the specified import service record. |
void |
addOptionalImportedServiceFilter(String name,
String filterString)
Configuration Method: Add an LDAP filter to an optional imported service. |
Bundle |
getBundle()
OSGi Query Method: Get the bundle. |
BundleContext |
getBundleContext()
OSGi Query Method: Get the BundleContext . |
String |
getBundleSymbolicName()
OSGi Query Method: Query the bundle's manifest for its Bundle-SymbolicName header. |
File |
getDataDirectory()
Persistent Bundle Storage Method: Get the bundle's private data directory. |
File |
getDataFile(String filename)
Persistent Bundle Storage Method: Open a data file contained in the bundle's private data directory. |
Object |
getExportedService(String name)
Query Method: Get a named exported service object. |
String[] |
getExportedServiceNamesFromManifest()
Deprecated. OSGi R4 has deprecated the Export-Service header. |
Dictionary |
getExportedServiceProperties(String name)
Query Method: Answers the properties of an exported service. |
Dictionary |
getExportedServiceProperties(String name,
Object service)
Query Method: Answers the properties of a specific exported service. |
Map |
getExportedServices()
Query Method: Get the exported service objects. |
Object[] |
getExportedServices(String name)
Query Method: Query the exported services. |
InputStream |
getFilePropertiesInputStream()
Query Method: Create an input stream on the default properties file. |
InputStream |
getFilePropertiesInputStream(String filename)
Query Method: Create an input stream on the specified properties file. |
Object |
getImportedService(String name)
Query Method: Get the named imported service. |
Filter |
getImportedServiceFilter(String name)
Query Method: Search for an imported service filter. |
String[] |
getImportedServiceNames()
Query Method: Answers the names of all the required services that are imported by the bundle. |
String[] |
getImportedServiceNamesFromManifest()
Deprecated. OSGi R4 has deprecated the Import-Service header. |
Object |
getImportedServiceProperty(String name,
String key)
Query Method: Get the value of an imported service's property. |
String[] |
getImportedServicePropertyKeys(String name)
Query Method: Get the keys of an imported service's properties. |
Map |
getImportedServices()
Query Method: Get the imported service objects. |
Object |
getOptionalImportedService(String name)
Query Method: Get the named optional imported service. |
Filter |
getOptionalImportedServiceFilter(String name)
Query Method: Search for an optional imported service filter. |
String[] |
getOptionalImportedServiceNames()
Query Method: Answers the names of all the optional services that are imported by the bundle. |
Object |
getOptionalImportedServiceProperty(String name,
String key)
Query Method: Get the value of an optional imported service's property. |
String[] |
getOptionalImportedServicePropertyKeys(String name)
Query Method: Get the keys of an optional imported service's properties. |
Map |
getOptionalImportedServices()
Query Method: Get the option imported service objects. |
Properties |
getProperties()
Query API: Create a Properties object out of the
bundle's properties. |
String |
getProperty(String key,
String defaultValue)
Query API: Get the value of a property. |
String[] |
getUnacquiredImportedServiceNames()
Query API: Get the names of the imported services that have not been acquired. |
String[] |
getUnacquiredOptionalImportedServiceNames()
Query API: Get the names of the optional imported services that have not been acquired. |
void |
releaseImportedService(String name)
Configuration Method: Release the named imported service. |
void |
releaseImportedServices()
Configuration Method: Release the imported services. |
void |
releaseOptionalImportedService(String name)
Configuration Method: Release the named optional imported service. |
void |
releaseOptionalImportedServices()
Configuration Method: Release the optional imported services. |
void |
removeExportedService(String name)
Configuration Method: Remove the exported service record of the specified type. |
void |
removeExportedService(String name,
Object service)
Configuration Method: Removes the specified exported service. |
void |
removeExportedServices(String name)
Configuration Method: Remove the named exported service domain object. |
void |
removeExportServiceRecord(IExportServiceRecord record)
Configuration Method: Remove the specified export service record. |
void |
removeImportedServiceFilter(String name)
Configuration Method: Removes the LDAP filter for an imported service. |
void |
removeOptionalImportedServiceFilter(String name)
Configuration Method: Removes the LDAP filter for an optional imported service. |
void |
restartFramework()
OSGi Framework Method: Stop and restart the OSGi framework. |
void |
setExportedServiceProperties(String name,
Dictionary properties)
Configuration Method: Sets the properties of an exported service. |
void |
setExportedServiceProperties(String name,
Object service,
Dictionary properties)
Configuration Method: Sets the properties of an exported service. |
void |
shutdownFramework()
OSGi Framework Method: Shutdown the OSGi framework. |
void |
start(BundleContext bundleContext,
IBundleActivationManagerOwner owner)
Start the bundle activation manager. |
void |
stop()
Stop the bundle activation manager. |
Method Detail |
---|
Object acquireImportedService(String name)
name
- The name of an imported service.
void acquireImportedServices()
Object acquireOptionalImportedService(String name)
name
- The name of an optional imported service.
void acquireOptionalImportedServices()
void addExportedProxyService(Class interfaceType, IProxyServiceHandler handler, Dictionary properties)
interfaceType
- The interface used to create the proxy service and
register it with the OSGi framework.handler
- The proxy service's handler.properties
- The properties to be registered with the service.void addExportedProxyServices(Class[] interfaceTypes, IProxyServiceHandler handler, Dictionary properties)
interfaceTypes
- The interfaces used to create the proxy service
and register it with the OSGi framework.handler
- The proxy service's handler.properties
- The properties to be registered with the service.void addExportedService(String name, Object service, Dictionary properties)
name
- The name of an exported service.service
- The service.properties
- The properties to be registered with the service.void addExportedServices(String[] names, Object service, Dictionary properties)
names
- An array of exported service names.service
- The service.properties
- The properties to be registered with the services.void addExportServiceRecord(IExportServiceRecord record)
record
- The export service record to add.void addExportServiceRecords(IExportServiceRecord[] records)
records
- The export service records to add.void addImportedServiceFilter(String name, String filterString)
name
- The name of the imported service.filterString
- The LDAP filter to be used for acquiring the
imported service.void addImportServiceRecord(IImportServiceRecord record)
record
- The import service record to add.void addOptionalImportedServiceFilter(String name, String filterString)
name
- The name of the optional imported service.filterString
- The LDAP filter to be used for acquiring the
optional imported service.Bundle getBundle()
Bundle
object, or null
.BundleContext getBundleContext()
BundleContext
.
BundleContext
, or null
.String getBundleSymbolicName()
Bundle-SymbolicName
header.
File getDataDirectory()
getDataFile(String)
File getDataFile(String filename)
filename
- The name of the persistent data file.
getDataDirectory()
Object getExportedService(String name)
name
- The name of the exported service.
null
.String[] getExportedServiceNamesFromManifest()
Dictionary getExportedServiceProperties(String name)
name
- The name of the exported service.
Dictionary
containing the exported service's
properties.Dictionary getExportedServiceProperties(String name, Object service)
name
- The name of the exported service.service
- The exported service.
Dictionary
containing the exported service's
properties.Map getExportedServices()
Map
is keyed by service names, and each value is a
List
of service objects. The value is always a
List
, even if there is only one exported service for a
particular service name.
Map
where each key is a service names and each
value is a List
of service objects.Object[] getExportedServices(String name)
name
- The name of the exported service.
InputStream getFilePropertiesInputStream() throws IOException
IOException
InputStream getFilePropertiesInputStream(String filename) throws IOException
filename
- The name of the properties file.
IOException
Object getImportedService(String name)
activate()
or deactivate()
method.
requiresAllImportedServices()
has not
been implemented to return false
.
name
parameter is the name of a service that is
imported by the bundle and documented as such using the bundle
manifest's Import-Service
header.
null
.
name
- The name of the imported service.
null
if no match is found.IBundleActivationManagerOwner.activate()
,
IBundleActivationManagerOwner.deactivate()
Filter getImportedServiceFilter(String name)
name
- The name of the imported service.
null
if no filter exists.String[] getImportedServiceNames()
String[] getImportedServiceNamesFromManifest()
Object getImportedServiceProperty(String name, String key)
name
- The name of the imported service.key
- The key of the imported service property.
null
if the
property cannot be found.String[] getImportedServicePropertyKeys(String name)
name
- The name of the imported service.
null
if no
properties exist.Map getImportedServices()
Map
is keyed by service names, and each value is a
the service object.
Map
where each key is a service names and each
value is a service object.Object getOptionalImportedService(String name)
name
- The name of the optional imported service.
null
if no match is found.Filter getOptionalImportedServiceFilter(String name)
name
- The name of the optional imported service.
null
if no filter exists.String[] getOptionalImportedServiceNames()
Object getOptionalImportedServiceProperty(String name, String key)
name
- The name of the optional imported service.key
- The key of the optional imported service property.
null
if
the property cannot be found.String[] getOptionalImportedServicePropertyKeys(String name)
name
- The name of the optional imported service.
null
if no properties exist.Map getOptionalImportedServices()
Map
is keyed by service names, and each value is a
the service object.
Map
where each key is a service names and each
value is a service object.Properties getProperties()
Properties
object out of the
bundle's properties. This method does not cache the Properties
object. The properties are obtained using the query method
getPropertiesInputStream()
, which is typically overridden by
subclasses that define properties.
String getProperty(String key, String defaultValue)
key
- The property key.defaultValue
- The default value for the property.
String[] getUnacquiredImportedServiceNames()
String[] getUnacquiredOptionalImportedServiceNames()
void releaseImportedService(String name)
name
- The name of an imported service.void releaseImportedServices()
void releaseOptionalImportedService(String name)
name
- The name of an optional imported service.void releaseOptionalImportedServices()
void removeExportedService(String name)
IExportServiceRecord
can represent
multiple distinct service names, this method will remove all
IExportServiceRecord
occurrences, regardless of the
specified service name. The specified service name is simply used to
identify the IExportServiceRecord
. While this method is
visible to subclasses, it is not typically used.
Note: All exported services are automatically removed by SAT when the bundle stops.
name
- The service name.void removeExportedService(String name, Object service)
IExportServiceRecord
can represent multiple
distinct service names, this method will remove all
IExportServiceRecord
occurrences, regardless of the
specified service name. The specified service name is simply used to
identify the IExportServiceRecord
. While this method
is visible to subclasses, it is not typically used.
Note: All exported services are automatically removed by SAT when the bundle stops.
name
- The service name.service
- The service.void removeExportedServices(String name)
Note: All exported services are automatically removed by SAT when the bundle stops.
name
- The name of the exported service.void removeExportServiceRecord(IExportServiceRecord record)
record
- The export service record to remove.void removeImportedServiceFilter(String name)
name
- The name of the imported service.void removeOptionalImportedServiceFilter(String name)
name
- The name of the optional imported service.void restartFramework() throws BundleException
BundleException
void setExportedServiceProperties(String name, Dictionary properties)
name
- The name of the exported service.properties
- The LDAP properties to be registered with the
exported service.void setExportedServiceProperties(String name, Object service, Dictionary properties)
name
- The name of the exported service.service
- The service.properties
- The LDAP properties to be registered with the exported
service.void shutdownFramework() throws BundleException
BundleException
void start(BundleContext bundleContext, IBundleActivationManagerOwner owner) throws Exception
bundleContext
- The BundleContext
for the bundle.owner
- The owner of the bundle activation manager.
Exception
- when the bundle activation manager fails to start.void stop() throws Exception
Exception
- when the bundle activation manager fails to stop.
|
Service Activator Toolkit
Version 1.1.0 (20081206) |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001, 2008 IBM Corporation and others. All Rights Reserved.