com.metamatrix.server.connector.service
Class ConnectorService

java.lang.Object
  extended by com.metamatrix.platform.service.controller.AbstractService
      extended by com.metamatrix.server.connector.service.ConnectorService
All Implemented Interfaces:
EventObjectListener, CacheAdmin, ServiceInterface, ConnectorServiceInterface, java.util.EventListener

public class ConnectorService
extends AbstractService
implements ConnectorServiceInterface, CacheAdmin

ConnectorService.


Field Summary
 
Fields inherited from interface com.metamatrix.server.connector.service.ConnectorServiceInterface
SERVICE_NAME
 
Fields inherited from interface com.metamatrix.platform.service.api.ServiceInterface
WAIT_TO_DIE_TIME
 
Fields inherited from interface com.metamatrix.platform.service.api.CacheAdmin
CODE_TABLE_CACHE, CONNECTOR_RESULT_SET_CACHE, PREPARED_PLAN_CACHE, QUERY_SERVICE_RESULT_SET_CACHE
 
Constructor Summary
ConnectorService()
           
 
Method Summary
 void cancelRequest(AtomicRequestID request)
           
 void checkState()
          Check the underlying connectorManager's state, then call the super.checkState().
 void clearCache(java.lang.String name, java.util.Properties props)
          Clear the named cached using properties to set options if necessary
 void closeRequest(AtomicRequestID request)
           
protected  void closeService()
          Close the service to new work if applicable.
 void executeRequest(AtomicRequestMessage request, ResultsReceiver<AtomicResultsMessage> resultListener)
          Execute the given request on a Connector.
 java.util.Map getCaches()
          Get names of all caches in this object
 SourceCapabilities getCapabilities(RequestID requestId, java.io.Serializable executionPayload, org.teiid.dqp.internal.process.DQPWorkContext message)
           
 java.util.Collection<ConnectionPoolStats> getConnectionPoolStats()
          Returns a list of ConnectionPoolStat objects for the specific ConnectorBinding service If there are no ConnectionPoolStats, null is returned.
 com.metamatrix.dqp.internal.datamgr.ConnectorID getConnectorID()
          Get the ConnectorID of the connector we're servicing.
 java.util.Collection getQueueStatistics()
          Returns a list of QueueStats objects that represent the queues in this service.
 WorkerPoolStats getQueueStatistics(java.lang.String name)
          Returns a QueueStats object that represent the queue in this service.
 void init(ServiceID id, DeployedComponentID deployedComponentID, java.util.Properties props, ClientServiceRegistry listenerRegistry, ClassLoaderManager clManager)
          Initialize ConnectorService
protected  void initService(java.util.Properties props)
          Perform initialization and commence processing.
protected  void killService()
          Terminate all processing and reclaim resources.
 void requestBatch(AtomicRequestID request)
           
protected  void waitForServiceToClear()
          Wait until the service has completed all outstanding work.
 
Methods inherited from class com.metamatrix.platform.service.controller.AbstractService
die, dieNow, getCurrentState, getHostname, getID, getInitException, getInstanceName, getProcessName, getProperties, getResourceName, getServiceData, getServiceName, getServiceType, getStartTime, getStateChangeTime, isAlive, isClosed, isInitialized, isOpen, processEvent, registerForEvents, setInitException, unregisterForEvents, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.metamatrix.platform.service.api.ServiceInterface
die, dieNow, getCurrentState, getHostname, getID, getInitException, getProcessName, getProperties, getServiceData, getServiceType, getStartTime, getStateChangeTime, isAlive, setInitException, updateState
 

Constructor Detail

ConnectorService

public ConnectorService()
Method Detail

init

public void init(ServiceID id,
                 DeployedComponentID deployedComponentID,
                 java.util.Properties props,
                 ClientServiceRegistry listenerRegistry,
                 ClassLoaderManager clManager)
Initialize ConnectorService

Specified by:
init in interface ServiceInterface
Overrides:
init in class AbstractService
Parameters:
id - The ServiceID this service was registered with
deployedComponentID - Unique identifier of this deployed component.
props - the properties which define the service configuration

getConnectorID

public com.metamatrix.dqp.internal.datamgr.ConnectorID getConnectorID()
                                                               throws ServiceStateException
Description copied from interface: ConnectorServiceInterface
Get the ConnectorID of the connector we're servicing.

Specified by:
getConnectorID in interface ConnectorServiceInterface
Returns:
The ConnectorID.
Throws:
ServiceStateException

cancelRequest

public void cancelRequest(AtomicRequestID request)
                   throws MetaMatrixComponentException
Specified by:
cancelRequest in interface ConnectorServiceInterface
Throws:
MetaMatrixComponentException

closeRequest

public void closeRequest(AtomicRequestID request)
                  throws MetaMatrixComponentException
Specified by:
closeRequest in interface ConnectorServiceInterface
Throws:
MetaMatrixComponentException

executeRequest

public void executeRequest(AtomicRequestMessage request,
                           ResultsReceiver<AtomicResultsMessage> resultListener)
                    throws MetaMatrixComponentException
Description copied from interface: ConnectorServiceInterface
Execute the given request on a Connector.

Specified by:
executeRequest in interface ConnectorServiceInterface
Throws:
MetaMatrixComponentException

requestBatch

public void requestBatch(AtomicRequestID request)
                  throws MetaMatrixComponentException
Specified by:
requestBatch in interface ConnectorServiceInterface
Throws:
MetaMatrixComponentException

initService

protected void initService(java.util.Properties props)
                    throws ApplicationLifecycleException,
                           ApplicationInitializationException
Perform initialization and commence processing. This method is called only once.

Specified by:
initService in class AbstractService
Throws:
ApplicationLifecycleException
ApplicationInitializationException

closeService

protected void closeService()
                     throws ApplicationLifecycleException
Close the service to new work if applicable. After this method is called the service should no longer accept new work to perform but should continue to process any outstanding work. This method is called by die().

Specified by:
closeService in class AbstractService
Throws:
ApplicationLifecycleException

waitForServiceToClear

protected void waitForServiceToClear()
                              throws ApplicationLifecycleException
Description copied from class: AbstractService
Wait until the service has completed all outstanding work. This method is called by die() just before calling dieNow().

Specified by:
waitForServiceToClear in class AbstractService
Throws:
ApplicationLifecycleException

killService

protected void killService()
Terminate all processing and reclaim resources. This method is called by dieNow() and is only called once.

Specified by:
killService in class AbstractService

checkState

public void checkState()
                throws ServiceStateException
Check the underlying connectorManager's state, then call the super.checkState().

Specified by:
checkState in interface ServiceInterface
Overrides:
checkState in class AbstractService
Throws:
ServiceStateException

getCapabilities

public SourceCapabilities getCapabilities(RequestID requestId,
                                          java.io.Serializable executionPayload,
                                          org.teiid.dqp.internal.process.DQPWorkContext message)
                                   throws ConnectorException
Specified by:
getCapabilities in interface ConnectorServiceInterface
Throws:
ConnectorException

getQueueStatistics

public java.util.Collection getQueueStatistics()
Returns a list of QueueStats objects that represent the queues in this service. If there are no queues, null is returned.

Specified by:
getQueueStatistics in interface ServiceInterface
Overrides:
getQueueStatistics in class AbstractService

getQueueStatistics

public WorkerPoolStats getQueueStatistics(java.lang.String name)
Returns a QueueStats object that represent the queue in this service. If there is no queue with the given name, null is returned.

Specified by:
getQueueStatistics in interface ServiceInterface
Overrides:
getQueueStatistics in class AbstractService

getCaches

public java.util.Map getCaches()
                        throws MetaMatrixComponentException
Description copied from interface: CacheAdmin
Get names of all caches in this object

Specified by:
getCaches in interface CacheAdmin
Returns:
Map where each key is the name of a cache and each value is the type, as defined by constants in this interface.
Throws:
MetaMatrixComponentException - If an error occurs

clearCache

public void clearCache(java.lang.String name,
                       java.util.Properties props)
                throws MetaMatrixComponentException
Description copied from interface: CacheAdmin
Clear the named cached using properties to set options if necessary

Specified by:
clearCache in interface CacheAdmin
Parameters:
name - Name of the cache to clear
props - Optional additional properties which may vary by cache type
Throws:
MetaMatrixComponentException - If an error occurs

getConnectionPoolStats

public java.util.Collection<ConnectionPoolStats> getConnectionPoolStats()
Description copied from interface: ServiceInterface
Returns a list of ConnectionPoolStat objects for the specific ConnectorBinding service If there are no ConnectionPoolStats, null is returned.

Specified by:
getConnectionPoolStats in interface ServiceInterface
Overrides:
getConnectionPoolStats in class AbstractService


Copyright © 2009. All Rights Reserved.