Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.framework
Class BundleActivationManagerOwnerAdapter

java.lang.Object
  extended by org.eclipse.soda.sat.core.framework.BundleActivationManagerOwnerAdapter
All Implemented Interfaces:
IBundleActivationManagerOwner

public class BundleActivationManagerOwnerAdapter
extends Object
implements IBundleActivationManagerOwner

BundleActivationManagerOwnerAdapter is a no-op implementation of the IBundleActivationManagerOwner interface. This class is useful for creating an owner of an IBundleActivationManager that only requires to handle a subset of the possible call-backs, which is common.


Field Summary
 
Fields inherited from interface org.eclipse.soda.sat.core.framework.interfaces.IBundleActivationManagerOwner
NO_SERVICES
 
Constructor Summary
BundleActivationManagerOwnerAdapter()
           
 
Method Summary
 void activate()
          Hook Method: You have been activated.
 void deactivate()
          Hook Method: You have been deactivated.
 int getAsyncStartPriority()
          Configuration Parameter Method: Get the async start thread priority.
 String[] getImportedServiceNames()
          Query Method: Answers the names of all the services that are imported by the bundle.
 String[] getOptionalImportedServiceNames()
          Query Method: Answers the names of all the services that are optionally imported by the bundle.
 InputStream getPropertiesInputStream()
          Hook Method: Get an input stream to the bundle's properties.
 void handleAcquiredOptionalImportedService(String serviceName, Object service)
          Hook Handler Method: When an optional imported service is acquired, this method is called.
 boolean handleException(Exception exception)
          Hook Handler Method: Handles a thrown exception.
 void handleFailedToFindProperties(String filename)
          Hook Handler Method: Handle the fact that the specified properties file could not be found.
 void handleReleasedOptionalImportedService(String serviceName, Object service)
          Hook Handler Method: When an optional imported service is released this method is called.
 boolean isStartAsync()
          Configuration Parameter Method: Specifies whether the bundle should start asynchronously.
 boolean isTransient()
          Configuration Parameter Method: Specify whether the bundle should be treated as transient.
 boolean isUninstallable()
          Configuration Parameter Method: Specify whether the bundle should be treated as uninstalled.
 void start()
          Hook Method: This method is called when the IBundleActivatorManager executes its start(BundleContext) method.
 void stop()
          Hook Method: This method is called when the IBundleActivatorManager executes its stop(BundleContext) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleActivationManagerOwnerAdapter

public BundleActivationManagerOwnerAdapter()
Method Detail

activate

public void activate()
Description copied from interface: IBundleActivationManagerOwner
Hook Method: You have been activated. This method is implemented by bundles that wish to execute domain specific activation.

Specified by:
activate in interface IBundleActivationManagerOwner
See Also:
IBundleActivationManagerOwner.activate()

deactivate

public void deactivate()
Description copied from interface: IBundleActivationManagerOwner
Hook Method: You have been deactivated. This method is implemented to execute domain specific deactivation.

Specified by:
deactivate in interface IBundleActivationManagerOwner
See Also:
IBundleActivationManagerOwner.deactivate()

getAsyncStartPriority

public int getAsyncStartPriority()
Description copied from interface: IBundleActivationManagerOwner
Configuration Parameter Method: Get the async start thread priority. This method is implemented by bundles that have implemented the method isStartAsync() to return true and wish to specify a thread priority other than Thread.NORM_PRIORITY .

Specified by:
getAsyncStartPriority in interface IBundleActivationManagerOwner
Returns:
The async start thread priority.
See Also:
IBundleActivationManagerOwner.getAsyncStartPriority()

getImportedServiceNames

public String[] getImportedServiceNames()
Description copied from interface: IBundleActivationManagerOwner
Query Method: Answers the names of all the services that are imported by the bundle.

Specified by:
getImportedServiceNames in interface IBundleActivationManagerOwner
Returns:
A String array containing the imported service names, or an empty String array if there are no imported service names.
See Also:
IBundleActivationManagerOwner.getImportedServiceNames()

getOptionalImportedServiceNames

public String[] getOptionalImportedServiceNames()
Description copied from interface: IBundleActivationManagerOwner
Query Method: Answers the names of all the services that are optionally imported by the bundle.

Specified by:
getOptionalImportedServiceNames in interface IBundleActivationManagerOwner
Returns:
A String array containing the optionally imported service names, or an empty String array if there are no optionally imported service names.
See Also:
IBundleActivationManagerOwner.getOptionalImportedServiceNames()

getPropertiesInputStream

public InputStream getPropertiesInputStream()
                                     throws IOException
Description copied from interface: IBundleActivationManagerOwner
Hook Method: Get an input stream to the bundle's properties. This method is implemented by bundles that possess properties.

Specified by:
getPropertiesInputStream in interface IBundleActivationManagerOwner
Returns:
An input stream to the properties or null if the bundle does not have any properties.
Throws:
IOException
See Also:
IBundleActivationManagerOwner.getPropertiesInputStream()

handleAcquiredOptionalImportedService

public void handleAcquiredOptionalImportedService(String serviceName,
                                                  Object service)
Description copied from interface: IBundleActivationManagerOwner
Hook Handler Method: When an optional imported service is acquired, this method is called. This method should be implemented to handle the domain specific case where an optional imported service is acquired. Since all acquired optional imported services will arrive via this method, it is important to handle each service separately.

Specified by:
handleAcquiredOptionalImportedService in interface IBundleActivationManagerOwner
Parameters:
serviceName - The fully-qualified name of the optional imported service.
service - The acquired optional imported service.
See Also:
IBundleActivationManagerOwner.handleAcquiredOptionalImportedService(java.lang.String, java.lang.Object)

handleException

public boolean handleException(Exception exception)
Description copied from interface: IBundleActivationManagerOwner
Hook Handler Method: Handles a thrown exception. This method can be implemented by bundles that wish to handle thrown exceptions themselves.

Specified by:
handleException in interface IBundleActivationManagerOwner
Parameters:
exception - The unhandled exception.
Returns:
True if the exception was fully handled, otherwise false.
See Also:
IBundleActivationManagerOwner.handleException(java.lang.Exception)

handleFailedToFindProperties

public void handleFailedToFindProperties(String filename)
Description copied from interface: IBundleActivationManagerOwner
Hook Handler Method: Handle the fact that the specified properties file could not be found.

Specified by:
handleFailedToFindProperties in interface IBundleActivationManagerOwner
Parameters:
filename - The name of the properties file.
See Also:
IBundleActivationManagerOwner.handleFailedToFindProperties(java.lang.String)

handleReleasedOptionalImportedService

public void handleReleasedOptionalImportedService(String serviceName,
                                                  Object service)
Description copied from interface: IBundleActivationManagerOwner
Hook Handler Method: When an optional imported service is released this method is called. This method should be implemented to handle the domain specific case where an optional imported service is released. Since all released optional imported services will arrive via this method, it is important to handle each service separately.

Specified by:
handleReleasedOptionalImportedService in interface IBundleActivationManagerOwner
Parameters:
serviceName - The fully-qualified name of the optional imported service.
service - The released optional imported service.
See Also:
IBundleActivationManagerOwner.handleReleasedOptionalImportedService(java.lang.String, java.lang.Object)

isStartAsync

public boolean isStartAsync()
Description copied from interface: IBundleActivationManagerOwner
Configuration Parameter Method: Specifies whether the bundle should start asynchronously. This method should be implemented by bundles that wish to start asynchronously.

Specified by:
isStartAsync in interface IBundleActivationManagerOwner
Returns:
True if the bundle should start asynchronously, otherwise false.
See Also:
IBundleActivationManagerOwner.isStartAsync()

isTransient

public boolean isTransient()
Description copied from interface: IBundleActivationManagerOwner
Configuration Parameter Method: Specify whether the bundle should be treated as transient. Transient bundles are automatically uninstalled once they have started and entered the Bundle.ACTIVE state. This method should be implemented by bundles that are to be considered transient. Note:

Specified by:
isTransient in interface IBundleActivationManagerOwner
Returns:
True if the bundle should be treated as transient, otherwise false.
See Also:
IBundleActivationManagerOwner.isTransient()

isUninstallable

public boolean isUninstallable()
Description copied from interface: IBundleActivationManagerOwner
Configuration Parameter Method: Specify whether the bundle should be treated as uninstalled. Uninstalled bundles are automatically uninstalled when their last dependent bundle is uninstalled. This method should be implemented to return true by bundles that are uninstallable prerequisites.

Note:

Specified by:
isUninstallable in interface IBundleActivationManagerOwner
Returns:
True if the bundle should be treated as uninstallable, otherwise false.
See Also:
IBundleActivationManagerOwner.isUninstallable()

start

public void start()
           throws Exception
Description copied from interface: IBundleActivationManagerOwner
Hook Method: This method is called when the IBundleActivatorManager executes its start(BundleContext) method. This method is implemented by bundles that wish to perform behavior exactly once when the bundle starts.

Specified by:
start in interface IBundleActivationManagerOwner
Throws:
Exception
See Also:
IBundleActivationManagerOwner.start()

stop

public void stop()
          throws Exception
Description copied from interface: IBundleActivationManagerOwner
Hook Method: This method is called when the IBundleActivatorManager executes its stop(BundleContext) method. This method is implemented by bundles that wish to perform behavior exactly once when the bundle stops.

Specified by:
stop in interface IBundleActivationManagerOwner
Throws:
Exception
See Also:
IBundleActivationManagerOwner.stop()

Service Activator Toolkit
Version 1.1.0 (20081206)