Service Activator Toolkit
Version 1.0.0

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

java.lang.Object
  extended byorg.eclipse.soda.sat.core.util.FactoryUtility

public 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.
 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(IExportServiceRecord exportServiceRecord, Class[] interfaceTypes, IProxyServiceHandler handler)
          Create an IExportProxyServiceRecord with properties that implements multiple interfaces.
 IExportServiceRecord createExportServiceRecord(BundleContext bundleContext, String[] names, 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.
 ILineWriter createLineWriter(OutputStream stream)
          Create a line writer.
 ILineWriter createLineWriter(OutputStream stream, int size)
          Create a line writer.
 IManagedServiceFactoryActivationManager createManagedServiceFactoryActivationManager(String name, IManagedServiceFactoryAdvisor advisor)
          Create an IManagedServiceFactoryActivationManager.
 IQueue createQueue(int capacity)
          Create an IQueue.
 IServiceDetecter createServiceDetecter(BundleContext bundleContext, String name)
          Create an IServiceDetecter.
 IThreadLocal createThreadLocal()
          Create an IThreadLocal.
 IThreadLocal createThreadLocal(int size)
          Create an IThreadLocal.
 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.

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[] 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.

createExportProxyServiceRecord

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

Parameters:
exportServiceRecord - The export service record.
interfaceTypes - The interface types used to create the proxy service and register it with the OSGi framework.
handler - An IProxyServiceHandler.
Returns:
The created IExportProxyServiceRecord.

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

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

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.

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.

createThreadLocal

public IThreadLocal createThreadLocal()
Create an IThreadLocal.

Returns:
IThreadLocal

createThreadLocal

public IThreadLocal createThreadLocal(int size)
Create an IThreadLocal.

Parameters:
size - The size of the IThreadLocal.
Returns:
IThreadLocal

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.0.0