1.0.0

org.eclipse.soda.dk.testagent.factory
Class TestAgentFactory

java.lang.Object
  extended by ManagedServiceFactoryBundleActivator
      extended by org.eclipse.soda.dk.testagent.factory.TestAgentFactory
Direct Known Subclasses:
TestAgentTestFactory

public abstract class TestAgentFactory
extends ManagedServiceFactoryBundleActivator

Version:
1.0.0

Field Summary
static java.lang.String CLASS_NAME
          Defines the class name.
static java.lang.String[] EXPORTED_SERVICE_NAMES
          Defines the service name(s) to be registered by the testAdapter bundle.
static java.lang.String ID_KEY
          Define the id key (String) constant.
static java.lang.String ID_KEY_FILTER
          Define the id key filter (String) constant.
static java.lang.String[] IMPORTED_SERVICE_NAMES
          Defines the imported service name(s) to be registered by the testAdapter bundle.
static java.lang.String METATYPE_SERVICE
          Define the metatype service (String) constant.
static java.lang.String[] OPTIONAL_SERVICES
          Define the optional services (String[]) constant.
 
Constructor Summary
TestAgentFactory()
           
 
Method Summary
 java.lang.Object create(java.lang.String pid, java.util.Dictionary properties, IBundleActivationManager manager)
          Create with the specified pid, properties and manager parameters and return the Object result.
protected  IManagedServiceFactoryAdvisor createAdvisor()
           
 void createImportedServiceFilters(java.lang.String pid, java.util.Dictionary oldProperties, java.util.Dictionary properties, IBundleActivationManager manager)
          Create imported service filters with the specified pid, old properties, properties and manager parameters.
 java.util.Hashtable createProperties()
          Gets the properties to be registered with the service(s).
abstract  TestAgent createService()
          Create service with the specified transport parameter and return the Object result.
 void destroy(java.lang.String pid, java.lang.Object object, java.util.Dictionary properties, IBundleActivationManager manager)
          Destroy with the specified pid, object, properties and manager parameters.
 java.lang.String[] getExportedServiceNames(java.lang.String pid, java.util.Dictionary oldProperties, java.util.Dictionary properties, IBundleActivationManager manager)
          Return the exported service name(s) to be registered by the testAdapter bundle.
 java.lang.String[] getImportedServiceNames(java.lang.String pid, java.util.Dictionary oldProperties, java.util.Dictionary properties, IBundleActivationManager manager)
          Return the imported service name(s) to be registered by the testAdapter bundle.
protected  java.lang.String[] getOptionalImportedServiceNames()
          Gets the optional imported service names (String[]) value.
 java.lang.String[] getOptionalImportedServiceNames(java.lang.String arg0, java.util.Dictionary arg1, java.util.Dictionary arg2, IBundleActivationManager arg3)
          Get optional imported service names with the specified arg0, arg1, arg2 and arg3 parameters and return the String[] result.
protected  void handleAcquiredOptionalImportedService(java.lang.String arg0, java.lang.Object arg1)
          Handle acquired optional imported service with the specified arg0 and arg1 parameters.
 void handleAcquiredOptionalImportedService(java.lang.String pid, java.lang.Object object, java.lang.String importedServiceName, java.lang.Object importedService, IBundleActivationManager manager)
          Handle acquired optional imported service with the specified pid, object, imported service name, imported service and manager parameters.
protected  void handleReleasedOptionalImportedService(java.lang.String arg0, java.lang.Object arg1)
          Handle released optional imported service with the specified arg0 and arg1 parameters.
 void handleReleasedOptionalImportedService(java.lang.String pid, java.lang.Object object, java.lang.String importedServiceName, java.lang.Object importedService, IBundleActivationManager manager)
          Handle released optional imported service with the specified pid, object, imported service name, imported service and manager parameters.
 java.lang.Object update(java.lang.String pid, java.lang.Object object, java.util.Dictionary oldProperties, java.util.Dictionary properties, IBundleActivationManager manager)
          Update with the specified pid, object, old properties, properties and manager parameters and return the Object result.
 void updateProperties(java.util.Dictionary table, java.util.Dictionary from)
          Update properties with the specified table and from parameters.
 void validateConfiguration(java.lang.String pid, java.util.Dictionary properties)
          Validate configuration with the specified pid and properties parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME
Defines the class name.

See Also:
Constant Field Values

ID_KEY

public static final java.lang.String ID_KEY
Define the id key (String) constant.


ID_KEY_FILTER

public static final java.lang.String ID_KEY_FILTER
Define the id key filter (String) constant.

See Also:
Constant Field Values

METATYPE_SERVICE

public static final java.lang.String METATYPE_SERVICE
Define the metatype service (String) constant.


EXPORTED_SERVICE_NAMES

public static final java.lang.String[] EXPORTED_SERVICE_NAMES
Defines the service name(s) to be registered by the testAdapter bundle.
org.eclipse.soda.dk.adapter.service.AdapterService


IMPORTED_SERVICE_NAMES

public static final java.lang.String[] IMPORTED_SERVICE_NAMES
Defines the imported service name(s) to be registered by the testAdapter bundle.
org.eclipse.soda.dk.test.adapter.service.testAdapterService
org.eclipse.soda.dk.notification.service.NotificationService


OPTIONAL_SERVICES

public static final java.lang.String[] OPTIONAL_SERVICES
Define the optional services (String[]) constant.

Constructor Detail

TestAgentFactory

public TestAgentFactory()
Method Detail

create

public java.lang.Object create(java.lang.String pid,
                               java.util.Dictionary properties,
                               IBundleActivationManager manager)
Create with the specified pid, properties and manager parameters and return the Object result. The pid (String) parameter. The properties (Dictionary) parameter. The manager (IBundleActivationManager) parameter.

Parameters:
pid - The pid (String) parameter.
properties - The properties (Dictionary) parameter.
manager - The manager (IBundleActivationManager) parameter.
Returns:
Results of the create (Object) value.

createAdvisor

protected IManagedServiceFactoryAdvisor createAdvisor()
Returns:
Results of the create advisor (IManagedServiceFactoryAdvisor) value.
See Also:
org.eclipse.soda.sat.core.framework.ManagedServiceFactoryBundleActivator#createAdvisor()

createImportedServiceFilters

public void createImportedServiceFilters(java.lang.String pid,
                                         java.util.Dictionary oldProperties,
                                         java.util.Dictionary properties,
                                         IBundleActivationManager manager)
Create imported service filters with the specified pid, old properties, properties and manager parameters. The pid (String) parameter. The old properties (Dictionary) parameter. The properties (Dictionary) parameter. The manager (IBundleActivationManager) parameter.

Parameters:
pid - The pid (String) parameter.
oldProperties - The old properties (Dictionary) parameter.
properties - The properties (Dictionary) parameter.
manager - The manager (IBundleActivationManager) parameter.

createProperties

public java.util.Hashtable createProperties()
Gets the properties to be registered with the service(s).

Returns:
Hashtable of properties.
org.eclipse.soda.dk.connection.bundle.ServiceBundle.DEVICE_CLASS testAdapter
org.osgi.framework.Constants.SERVICE_PID testAdapterService.SERVICE_NAME
org.osgi.framework.Constants.SERVICE_DESCRIPTION test Adapter
org.osgi.framework.Constants.SERVICE_VENDOR Eclipse
org.osgi.service.device.Constants.DRIVER_ID testAdapter
org.osgi.framework.Constants.SERVICE_RANKING 6
org.osgi.service.device.Constants.DEVICE_CATEGORY DeviceService
org.eclipse.soda.dk.connection.bundle.ServiceBundle.DEVICE_REVISION 1.0.0
See Also:
updateProperties(Dictionary,Dictionary)

createService

public abstract TestAgent createService()
Create service with the specified transport parameter and return the Object result. The device (DeviceService) parameter.

Returns:
Results of the create service (Object) value.
See Also:
#handleAcquiredImportedService(String,Object,Object,IBundleActivationManager), handleAcquiredOptionalImportedService(String,Object), handleAcquiredOptionalImportedService(String,Object,String,Object,IBundleActivationManager), #handleReleasedImportedService(String,Object,Object,IBundleActivationManager), handleReleasedOptionalImportedService(String,Object), handleReleasedOptionalImportedService(String,Object,String,Object,IBundleActivationManager)

destroy

public void destroy(java.lang.String pid,
                    java.lang.Object object,
                    java.util.Dictionary properties,
                    IBundleActivationManager manager)
Destroy with the specified pid, object, properties and manager parameters. The pid (String) parameter. The object (Object) parameter. The properties (Dictionary) parameter. The manager (IBundleActivationManager) parameter.

Parameters:
pid - The pid (String) parameter.
object - The object (Object) parameter.
properties - The properties (Dictionary) parameter.
manager - The manager (IBundleActivationManager) parameter.

getExportedServiceNames

public java.lang.String[] getExportedServiceNames(java.lang.String pid,
                                                  java.util.Dictionary oldProperties,
                                                  java.util.Dictionary properties,
                                                  IBundleActivationManager manager)
Return the exported service name(s) to be registered by the testAdapter bundle.

Parameters:
pid - The pid (String) parameter.
oldProperties - The old properties (Dictionary) parameter.
properties - The properties (Dictionary) parameter.
manager - The manager (IBundleActivationManager) parameter.
Returns:
String[] The device's service names.

getImportedServiceNames

public java.lang.String[] getImportedServiceNames(java.lang.String pid,
                                                  java.util.Dictionary oldProperties,
                                                  java.util.Dictionary properties,
                                                  IBundleActivationManager manager)
Return the imported service name(s) to be registered by the testAdapter bundle.

Parameters:
pid - The pid (String) parameter.
oldProperties - The old properties (Dictionary) parameter.
properties - The properties (Dictionary) parameter.
manager - The manager (IBundleActivationManager) parameter.
Returns:
String[] The imported service names.
See Also:
getOptionalImportedServiceNames(), getOptionalImportedServiceNames(String,Dictionary,Dictionary,IBundleActivationManager)

getOptionalImportedServiceNames

protected java.lang.String[] getOptionalImportedServiceNames()
Gets the optional imported service names (String[]) value.

Returns:
The optional imported service names (String[]) value.
See Also:
getOptionalImportedServiceNames(String,Dictionary,Dictionary,IBundleActivationManager)

getOptionalImportedServiceNames

public java.lang.String[] getOptionalImportedServiceNames(java.lang.String arg0,
                                                          java.util.Dictionary arg1,
                                                          java.util.Dictionary arg2,
                                                          IBundleActivationManager arg3)
Get optional imported service names with the specified arg0, arg1, arg2 and arg3 parameters and return the String[] result. The arg0 (String) parameter. The arg1 (Dictionary) parameter. The arg2 (Dictionary) parameter. The arg3 (IBundleActivationManager) parameter.

Parameters:
arg0 - The arg0 (String) parameter.
arg1 - The arg1 (Dictionary) parameter.
arg2 - The arg2 (Dictionary) parameter.
arg3 - The arg3 (IBundleActivationManager) parameter.
Returns:
Results of the get optional imported service names (String[]) value.
See Also:
getOptionalImportedServiceNames()

handleAcquiredOptionalImportedService

protected void handleAcquiredOptionalImportedService(java.lang.String arg0,
                                                     java.lang.Object arg1)
Handle acquired optional imported service with the specified arg0 and arg1 parameters.

Parameters:
arg0 - The arg0 (String) parameter.
arg1 - The arg1 (Object) parameter.
See Also:
handleAcquiredOptionalImportedService(String,Object,String,Object,IBundleActivationManager)

handleAcquiredOptionalImportedService

public void handleAcquiredOptionalImportedService(java.lang.String pid,
                                                  java.lang.Object object,
                                                  java.lang.String importedServiceName,
                                                  java.lang.Object importedService,
                                                  IBundleActivationManager manager)
Handle acquired optional imported service with the specified pid, object, imported service name, imported service and manager parameters. The pid (String) parameter. The object (Object) parameter. The imported service name (String) parameter. The imported service (Object) parameter. The manager (IBundleActivationManager) parameter.

Parameters:
pid - The pid (String) parameter.
object - The object (Object) parameter.
importedServiceName - The imported service name (String) parameter.
importedService - The imported service (Object) parameter.
manager - The manager (IBundleActivationManager) parameter.
See Also:
handleAcquiredOptionalImportedService(String,Object)

handleReleasedOptionalImportedService

protected void handleReleasedOptionalImportedService(java.lang.String arg0,
                                                     java.lang.Object arg1)
Handle released optional imported service with the specified arg0 and arg1 parameters.

Parameters:
arg0 - The arg0 (String) parameter.
arg1 - The arg1 (Object) parameter.
See Also:
handleReleasedOptionalImportedService(String,Object,String,Object,IBundleActivationManager)

handleReleasedOptionalImportedService

public void handleReleasedOptionalImportedService(java.lang.String pid,
                                                  java.lang.Object object,
                                                  java.lang.String importedServiceName,
                                                  java.lang.Object importedService,
                                                  IBundleActivationManager manager)
Handle released optional imported service with the specified pid, object, imported service name, imported service and manager parameters. The pid (String) parameter. The object (Object) parameter. The imported service name (String) parameter. The imported service (Object) parameter. The manager (IBundleActivationManager) parameter.

Parameters:
pid - The pid (String) parameter.
object - The object (Object) parameter.
importedServiceName - The imported service name (String) parameter.
importedService - The imported service (Object) parameter.
manager - The manager (IBundleActivationManager) parameter.
See Also:
handleReleasedOptionalImportedService(String,Object)

update

public java.lang.Object update(java.lang.String pid,
                               java.lang.Object object,
                               java.util.Dictionary oldProperties,
                               java.util.Dictionary properties,
                               IBundleActivationManager manager)
Update with the specified pid, object, old properties, properties and manager parameters and return the Object result. The pid (String) parameter. The object (Object) parameter. The old properties (Dictionary) parameter. The properties (Dictionary) parameter. The manager (IBundleActivationManager) parameter.

Parameters:
pid - The pid (String) parameter.
object - The object (Object) parameter.
oldProperties - The old properties (Dictionary) parameter.
properties - The properties (Dictionary) parameter.
manager - The manager (IBundleActivationManager) parameter.
Returns:
Results of the update (Object) value.

updateProperties

public void updateProperties(java.util.Dictionary table,
                             java.util.Dictionary from)
Update properties with the specified table and from parameters. The table (Dictionary) parameter. The from (Dictionary) parameter.

Parameters:
table - The table (Dictionary) parameter.
from - The from (Dictionary) parameter.
See Also:
createProperties()

validateConfiguration

public void validateConfiguration(java.lang.String pid,
                                  java.util.Dictionary properties)
                           throws ConfigurationException
Validate configuration with the specified pid and properties parameters.

Parameters:
pid - The pid (String) parameter.
properties - The properties (Dictionary) parameter.
Throws:
ConfigurationException - Configuration Exception.

1.0.0

Copyright (c) 2007 IBM