SMILA (incubation) API documentation

org.eclipse.smila.connectivity.framework.impl
Class AbstractController

java.lang.Object
  extended by org.eclipse.smila.connectivity.framework.impl.AbstractController
Direct Known Subclasses:
AgentControllerImpl, CrawlerControllerImpl

public abstract class AbstractController
extends java.lang.Object

Base class for Crawler- and AgentController. Contains shared functionality.


Constructor Summary
AbstractController()
           
 
Method Summary
 void addComponentFactory(ComponentFactory factory)
          Adds a ComponentFactory to the internal List of ComponentFactory.
protected
<T> T
createInstance(java.lang.Class<T> clazz, java.lang.String componentId)
          Returns a new Crawler or Agent instance for the given componentId.
protected  java.util.Collection<java.lang.String> getAvailableFactories()
          Returns the component names of all available ComponentFactories.
 CompoundManager getCompoundManager()
           
protected  DataSourceConnectionConfig getConfiguration(java.lang.String bundleId, java.lang.String dataSourceId)
          Returns the DataSourceConnectionConfig for the given dataSourceId.
 ConnectivityManager getConnectivityManager()
           
 void removeComponentFactory(ComponentFactory factory)
          Removes a ComponentFactory from the internal List of ComponentFactory.
 void setCompoundManager(CompoundManager compoundManager)
          Sets the compoundManager.
 void setConnectivityManager(ConnectivityManager connectivityManager)
          Sets the ConnectivityManager.
 void unsetCompoundManager(CompoundManager compoundManager)
          Set the compoundManager to null.
 void unsetConnectivityManager(ConnectivityManager connectivityManager)
          Set the _connectivityManager to null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractController

public AbstractController()
Method Detail

getConnectivityManager

public ConnectivityManager getConnectivityManager()
Returns:
the connectivityManager

setConnectivityManager

public void setConnectivityManager(ConnectivityManager connectivityManager)
Sets the ConnectivityManager. Used by OSGi Declarative Services.

Parameters:
connectivityManager - the connectivityManager to set

unsetConnectivityManager

public void unsetConnectivityManager(ConnectivityManager connectivityManager)
Set the _connectivityManager to null. Used by OSGi Declarative Services.

Parameters:
connectivityManager - the connectivityManager to unset

getCompoundManager

public CompoundManager getCompoundManager()
Returns:
the compoundManager

setCompoundManager

public void setCompoundManager(CompoundManager compoundManager)
Sets the compoundManager. Used by OSGi Declarative Services.

Parameters:
compoundManager - the compoundManager to set

unsetCompoundManager

public void unsetCompoundManager(CompoundManager compoundManager)
Set the compoundManager to null. Used by OSGi Declarative Services.

Parameters:
compoundManager - the compoundManager to unset

addComponentFactory

public void addComponentFactory(ComponentFactory factory)
Adds a ComponentFactory to the internal List of ComponentFactory. Used by OSGi Declarative Services.

Parameters:
factory - the ComponentFactory to add

removeComponentFactory

public void removeComponentFactory(ComponentFactory factory)
Removes a ComponentFactory from the internal List of ComponentFactory. Used by OSGi Declarative Services.

Parameters:
factory - the ComponentFactory to remove

getAvailableFactories

protected java.util.Collection<java.lang.String> getAvailableFactories()
Returns the component names of all available ComponentFactories.

Returns:
a Collection with the component names of all available ComponentFactories.

createInstance

protected <T> T createInstance(java.lang.Class<T> clazz,
                               java.lang.String componentId)
                    throws ConnectivityException
Returns a new Crawler or Agent instance for the given componentId. Uses a ComponentFactory to create new instances.

Type Parameters:
T - the return type
Parameters:
clazz - the class of the created instance (Agent or Crawler)
componentId - the Id of the Crawler or Agent
Returns:
the an Instance of type T
Throws:
ConnectivityException - if no ComponentFactory instance with the given Id could be created

getConfiguration

protected DataSourceConnectionConfig getConfiguration(java.lang.String bundleId,
                                                      java.lang.String dataSourceId)
                                               throws ConnectivityException
Returns the DataSourceConnectionConfig for the given dataSourceId.

Parameters:
bundleId - the id of the bundle
dataSourceId - the Id of the data source
Returns:
the DataSourceConnectionConfig
Throws:
ConnectivityException - if no DataSource with the given Id exists

SMILA (incubation) API documentation