Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.util
Class FactoryUtility

java.lang.Object
  extended by org.eclipse.soda.sat.core.util.FactoryUtility

public final class FactoryUtility
extends Object

The FactoryUtility class provides an API through which instances of many of the SAT abstractions may be created. The goal of this class is to keep the SAT implementation classes private, while allowing objects to be created and shared via public interfaces.

Note: This is a singleton class, accessible only via the static method getInstance(). For example:

 FactoryUtility utility = FactoryUtility.getInstance();
 IExportServiceRecordContainer container = utility.createExportServiceRecordContainer();
 


Method Summary
 IBundleActivationManager createBundleActivationManager()
          Create an IBundleActivationManager.
 IBundleActivationManager createBundleActivationManager(String id)
          Create an IBundleActivationManager.
 ICharBuffer createCharBuffer(int initialCapacity)
          Create a char buffer with the specified initial capacity.
 LogService createConsoleLog()
          Create a console log.
 IDependencyTracker createDependencyTracker(int prerequisites, int dependents)
          Create a dependency tracker.
 IExportProxyServiceRecord createExportProxyServiceRecord(BundleContext bundleContext, Class[] interfaceTypes, IProxyServiceHandler handler, Dictionary properties)
          Create an IExportProxyServiceRecord with properties that implements multiple interfaces.
 IExportProxyServiceRecord createExportProxyServiceRecord(BundleContext bundleContext, Class interfaceType, IProxyServiceHandler handler, Dictionary properties)
          Create an IExportProxyServiceRecord with properties that implements multiple interfaces.
 IExportServiceRecord createExportServiceRecord(BundleContext bundleContext, String[] names, Object service, Dictionary properties)
          Create an IExportServiceRecord.
 IExportServiceRecord createExportServiceRecord(BundleContext bundleContext, String name, Object service, Dictionary properties)
          Create an IExportServiceRecord.
 IExportServiceRecordContainer createExportServiceRecordContainer()
          Create an IExportServiceRecordContainer.
 IFileLog createFileLog(File file)
          Create an IFileLog.
 IImportServiceRecord createImportServiceRecord(BundleContext bundleContext, String name, Filter filter)
          Create an IImportServiceRecord.
 IImportServiceRecordContainer createImportServiceRecordContainer()
          Create a "strict" IImportServiceRecordContainer.
 ILineReader createLineReader(InputStream stream)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, ILineReader.IAdvisor advisor)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, int size)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, int size, ILineReader.IAdvisor advisor)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, String characterEncoding)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, String characterEncoding, ILineReader.IAdvisor advisor)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, String characterEncoding, int size)
          Create a line reader.
 ILineReader createLineReader(InputStream stream, String characterEncoding, int size, ILineReader.IAdvisor advisor)
          Create a line reader.
 ILineWriter createLineWriter(OutputStream stream)
          Create a line writer.
 ILineWriter createLineWriter(OutputStream stream, int size)
          Create a line writer.
 ILineWriter createLineWriter(OutputStream stream, String characterEncoding)
          Create a line writer.
 ILineWriter createLineWriter(OutputStream stream, String characterEncoding, int size)
          Create a line writer.
 IManagedServiceActivationManager createManagedServiceActivationManager(IManagedServiceAdvisor advisor)
          Create an IManagedServiceActivationManager.
 IManagedServiceFactoryActivationManager createManagedServiceFactoryActivationManager(String name, IManagedServiceFactoryAdvisor advisor)
          Create an IManagedServiceFactoryActivationManager.
 IManagedServiceFactoryActivationManager createManagedServiceFactoryActivationManager(String name, IManagedServiceFactoryAdvisor advisor, int numberOfConfigurationsHint)
          Create an IManagedServiceFactoryActivationManager.
 IQueue createQueue(int capacity)
          Create an IQueue.
 IServiceDetecter createServiceDetecter(BundleContext bundleContext, String name)
          Create an IServiceDetecter.
 ITokenizer createTokenizer(String value)
          Create an ITokenizer.
 ITokenizer createTokenizer(String value, char delimiter)
          Create an ITokenizer.
 ITokenizer createTokenizer(String value, char delimiter, int index)
          Create an ITokenizer.
 ITokenizer createTokenizer(String value, int index)
          Create an ITokenizer.
static FactoryUtility getInstance()
          Public getter for the FactoryUtility singleton instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static FactoryUtility getInstance()
Public getter for the FactoryUtility singleton instance.

Returns:
FactoryUtility

createBundleActivationManager

public IBundleActivationManager createBundleActivationManager()
Create an IBundleActivationManager.

Returns:
The created IBundleActivationManager.

createBundleActivationManager

public IBundleActivationManager createBundleActivationManager(String id)
Create an IBundleActivationManager.

Parameters:
id - The id of the IBundleActivationManager.
Returns:
The created IBundleActivationManager.

createCharBuffer

public ICharBuffer createCharBuffer(int initialCapacity)
Create a char buffer with the specified initial capacity.

Parameters:
initialCapacity - The initial capacity of the buffer.
Returns:
The created ICharBuffer.

createConsoleLog

public LogService createConsoleLog()
Create a console log.

Returns:
A console log implementation of the LogService.

createDependencyTracker

public IDependencyTracker createDependencyTracker(int prerequisites,
                                                  int dependents)
Create a dependency tracker.

Parameters:
prerequisites - A hint to the number of prerequisites.
dependents - A hint to the number of dependents.
Returns:
IDependencyTracker

createExportProxyServiceRecord

public IExportProxyServiceRecord createExportProxyServiceRecord(BundleContext bundleContext,
                                                                Class interfaceType,
                                                                IProxyServiceHandler handler,
                                                                Dictionary properties)
Create an IExportProxyServiceRecord with properties that implements multiple interfaces.

Parameters:
bundleContext - The BundleContext handle back to the framework.
interfaceType - The interface type used to create the proxy service and register it with the OSGi framework.
handler - An IProxyServiceHandler.
properties - The properties of the exported service.
Returns:
The created IExportProxyServiceRecord.

createExportProxyServiceRecord

public IExportProxyServiceRecord createExportProxyServiceRecord(BundleContext bundleContext,
                                                                Class[] interfaceTypes,
                                                                IProxyServiceHandler handler,
                                                                Dictionary properties)
Create an IExportProxyServiceRecord with properties that implements multiple interfaces.

Parameters:
bundleContext - The BundleContext handle back to the framework.
interfaceTypes - The interface types used to create the proxy service and register it with the OSGi framework.
handler - An IProxyServiceHandler.
properties - The properties of the exported service.
Returns:
The created IExportProxyServiceRecord.

createExportServiceRecord

public IExportServiceRecord createExportServiceRecord(BundleContext bundleContext,
                                                      String name,
                                                      Object service,
                                                      Dictionary properties)
Create an IExportServiceRecord.

Parameters:
bundleContext - The BundleContext handle back to the framework.
name - The fully qualified type name of the exported service.
service - The exported service.
properties - The properties of the exported service.
Returns:
The created IExportServiceRecord.

createExportServiceRecord

public IExportServiceRecord createExportServiceRecord(BundleContext bundleContext,
                                                      String[] names,
                                                      Object service,
                                                      Dictionary properties)
Create an IExportServiceRecord.

Parameters:
bundleContext - The BundleContext handle back to the framework.
names - The fully qualified type names of the exported service.
service - The exported service.
properties - The properties of the exported service.
Returns:
The created IExportServiceRecord.

createExportServiceRecordContainer

public IExportServiceRecordContainer createExportServiceRecordContainer()
Create an IExportServiceRecordContainer.

Returns:
The created IExportServiceRecordContainer.

createFileLog

public IFileLog createFileLog(File file)
Create an IFileLog.

Parameters:
file - The file.
Returns:
The created IFileLog.

createImportServiceRecord

public IImportServiceRecord createImportServiceRecord(BundleContext bundleContext,
                                                      String name,
                                                      Filter filter)
Create an IImportServiceRecord.

Parameters:
bundleContext - The BundleContext handle back to the framework.
name - The fully qualified type name of the imported service.
filter - The LDAP filter used to acquire the imported service.
Returns:
The created IImportServiceRecord.

createImportServiceRecordContainer

public IImportServiceRecordContainer createImportServiceRecordContainer()
Create a "strict" IImportServiceRecordContainer.

Returns:
The created IImportServiceRecordContainer.

createLineReader

public ILineReader createLineReader(InputStream stream)
Create a line reader.

Parameters:
stream - The stream from which to read.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    ILineReader.IAdvisor advisor)
Create a line reader.

Parameters:
stream - The stream from which to read.
advisor - The reader's advisor.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    int size)
Create a line reader.

Parameters:
stream - The stream from which to read.
size - A hint to the size of the stream.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    int size,
                                    ILineReader.IAdvisor advisor)
Create a line reader.

Parameters:
stream - The stream from which to read.
size - A hint to the size of the stream.
advisor - The reader's advisor.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    String characterEncoding)
Create a line reader.

Parameters:
stream - The stream from which to read.
characterEncoding - The character encoding to use.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    String characterEncoding,
                                    ILineReader.IAdvisor advisor)
Create a line reader.

Parameters:
stream - The stream from which to read.
characterEncoding - The character encoding to use.
advisor - The reader's advisor.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    String characterEncoding,
                                    int size)
Create a line reader.

Parameters:
stream - The stream from which to read.
characterEncoding - The character encoding to use.
size - A hint to the size of the stream.
Returns:
ILineReader

createLineReader

public ILineReader createLineReader(InputStream stream,
                                    String characterEncoding,
                                    int size,
                                    ILineReader.IAdvisor advisor)
Create a line reader.

Parameters:
stream - The stream from which to read.
characterEncoding - The character encoding to use.
size - A hint to the size of the stream.
advisor - The reader's advisor.
Returns:
ILineReader

createLineWriter

public ILineWriter createLineWriter(OutputStream stream)
Create a line writer.

Parameters:
stream - The stream to which to write.
Returns:
ILineWriter

createLineWriter

public ILineWriter createLineWriter(OutputStream stream,
                                    int size)
Create a line writer.

Parameters:
stream - The stream to which to write.
size - A hint to the size of the stream.
Returns:
ILineWriter

createLineWriter

public ILineWriter createLineWriter(OutputStream stream,
                                    String characterEncoding)
Create a line writer.

Parameters:
stream - The stream to which to write.
characterEncoding - The character encoding to use.
Returns:
ILineWriter

createLineWriter

public ILineWriter createLineWriter(OutputStream stream,
                                    String characterEncoding,
                                    int size)
Create a line writer.

Parameters:
stream - The stream to which to write.
characterEncoding - The character encoding to use.
size - A hint to the size of the stream.
Returns:
ILineWriter

createManagedServiceActivationManager

public IManagedServiceActivationManager createManagedServiceActivationManager(IManagedServiceAdvisor advisor)
Create an IManagedServiceActivationManager.

Parameters:
advisor - The advisor for the ManagedService.
Returns:
The created IManagedServiceActivationManager.

createManagedServiceFactoryActivationManager

public IManagedServiceFactoryActivationManager createManagedServiceFactoryActivationManager(String name,
                                                                                            IManagedServiceFactoryAdvisor advisor)
Create an IManagedServiceFactoryActivationManager.

Parameters:
name - The name of the ManagedServiceFactory.
advisor - The advisor for the ManagedServiceFactory.
Returns:
The created IManagedServiceFactoryActivationManager.

createManagedServiceFactoryActivationManager

public IManagedServiceFactoryActivationManager createManagedServiceFactoryActivationManager(String name,
                                                                                            IManagedServiceFactoryAdvisor advisor,
                                                                                            int numberOfConfigurationsHint)
Create an IManagedServiceFactoryActivationManager.

Parameters:
name - The name of the ManagedServiceFactory.
advisor - The advisor for the ManagedServiceFactory.
numberOfConfigurationsHint - A hint to the number of configurations.
Returns:
The created IManagedServiceFactoryActivationManager.

createQueue

public IQueue createQueue(int capacity)
Create an IQueue.

Parameters:
capacity - The initial capacity of the queue.
Returns:
The created IQueue.

createServiceDetecter

public IServiceDetecter createServiceDetecter(BundleContext bundleContext,
                                              String name)
Create an IServiceDetecter.

Parameters:
bundleContext - The BundleContext handle back to the framework.
name - The fully qualified type name of the imported service.
Returns:
The created IServiceDetecter.

createTokenizer

public ITokenizer createTokenizer(String value)
Create an ITokenizer.

Parameters:
value - The text to tokenize.
Returns:
ITokenizer

createTokenizer

public ITokenizer createTokenizer(String value,
                                  char delimiter)
Create an ITokenizer.

Parameters:
value - The text to tokenize.
delimiter - The delimiter.
Returns:
ITokenizer

createTokenizer

public ITokenizer createTokenizer(String value,
                                  char delimiter,
                                  int index)
Create an ITokenizer.

Parameters:
value - The text to tokenize.
delimiter - The delimiter.
index - The index at which to start tokenizing the text.
Returns:
ITokenizer

createTokenizer

public ITokenizer createTokenizer(String value,
                                  int index)
Create an ITokenizer.

Parameters:
value - The text to tokenize.
index - The index at which to start tokenizing the text.
Returns:
ITokenizer

Service Activator Toolkit
Version 1.1.0 (20081206)