Package org.apache.uima.aae.controller
Class AnalysisEngineControllerAdapter
- java.lang.Object
-
- org.apache.uima.aae.controller.AnalysisEngineControllerAdapter
-
- All Implemented Interfaces:
AnalysisEngineController
,ControllerLifecycle
- Direct Known Subclasses:
UimacppServiceController
public abstract class AnalysisEngineControllerAdapter extends java.lang.Object implements AnalysisEngineController
Abstract class meant to provide default implementations for AnalysisEngineController instances.
-
-
Field Summary
-
Fields inherited from interface org.apache.uima.aae.controller.AnalysisEngineController
AEInstanceCount, CasPoolSize
-
-
Constructor Summary
Constructors Constructor Description AnalysisEngineControllerAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addAbortedCasReferenceId(java.lang.String casReferenceId)
void
addControllerCallbackListener(ControllerCallbackListener listener)
Register one or more listeners through which the controller can send notification of events.void
addEndpointToDoNotProcessList(java.lang.String anEndpointName)
void
addInputChannel(InputChannel anInputChannel)
void
addServiceInfo(ServiceInfo serviceInfo)
void
addTimeSnapshot(long snapshot, java.lang.String key)
void
beginProcess(int msgType)
void
cacheClientEndpoint(Endpoint anEndpoint)
void
changeState(BaseAnalysisEngineController.ServiceState state)
void
collectionProcessComplete(Endpoint anEndpoint)
void
dropCAS(java.lang.String casReferenceId, boolean dropCacheEntry)
void
dropCAS(org.apache.uima.cas.CAS acas)
void
dropStats(java.lang.String casReferenceId, java.lang.String anEndpointName)
void
endProcess(int msgType)
void
evictExpiredEntries()
void
forceTimeoutOnPendingCases(java.lang.String key)
long
getAnalysisTime()
AsynchAECasManager
getCasManagerWrapper()
ServicePerformance
getCasStatistics(java.lang.String casReferenceId)
org.apache.uima.UimaContext
getChildUimaContext(java.lang.String delegateEndpointName)
Endpoint
getClientEndpoint()
java.lang.String
getComponentName()
ControllerLatch
getControllerLatch()
long
getCpuTime()
java.util.Map<java.lang.String,java.lang.String>
getDeadClientMap()
ErrorHandlerChain
getErrorHandlerChain()
EventSubscriber
getEventListener()
long
getIdleTime()
long
getIdleTimeBetweenProcessCalls(int msgType)
int
getIndex()
InProcessCache
getInProcessCache()
InputChannel
getInputChannel()
InputChannel
getInputChannel(java.lang.String queueName)
java.lang.String
getJmxContext()
java.lang.String
getJMXDomain()
LocalCache
getLocalCache()
JmxManagement
getManagementInterface()
Monitor
getMonitor()
java.lang.String
getName()
OutputChannel
getOutputChannel()
AnalysisEngineController
getParentController()
InputChannel
getReplyInputChannel(java.lang.String delegateKey)
long
getReplyTime()
java.lang.String
getServiceEndpointName()
ServiceErrors
getServiceErrors()
ServiceInfo
getServiceInfo()
ServicePerformance
getServicePerformance()
BaseAnalysisEngineController.ServiceState
getState()
java.util.Map
getStats()
long
getTime(java.lang.String casReferenceId, java.lang.String anEndpointName)
long
getTimeSnapshot(java.lang.String key)
UimaTransport
getTransport(java.lang.String key)
UimaTransport
getTransport(UimaAsContext context, java.lang.String key)
UimaEEAdminContext
getUimaEEAdminContext()
UimaMessageListener
getUimaMessageListener(java.lang.String delegateKey)
void
handleDelegateLifeCycleEvent(java.lang.String anEndpoint, int delegateCount)
void
incrementDeserializationTime(long cpuTime)
void
incrementSerializationTime(long cpuTime)
void
initialize()
void
initializeVMTransport(int parentControllerReplyConsumerCount)
boolean
isAwaitingCacheCallbackNotification()
boolean
isCasMultiplier()
boolean
isEndpointOnDontProcessList(java.lang.String anEndpointName)
boolean
isPrimitive()
boolean
isStopped()
Returns true if the AnalysisEngineController has been (or is in the process of) shutdown.boolean
isTopLevelComponent()
void
notifyListenersWithInitializationStatus(java.lang.Exception e)
void
onInitialize()
void
process(org.apache.uima.cas.CAS cas, java.lang.String casId)
void
process(org.apache.uima.cas.CAS acas, java.lang.String anInputCasReferenceId, java.lang.String newCasReferenceId, java.lang.String newCASProducedBy)
void
process(org.apache.uima.cas.CAS acas, java.lang.String casReferenceId, Endpoint anEndpoint)
abstract void
quiesceAndStop()
void
registerVmQueueWithJMX(java.lang.Object o, java.lang.String name)
void
releaseNextCas(java.lang.String casReferenceId)
void
removeControllerCallbackListener(ControllerCallbackListener listener)
Removes named application listener.void
saveReplyTime(long snapshot, java.lang.String key)
void
saveTime(long anArrivalTime, java.lang.String casReferenceId, java.lang.String anEndpointName)
void
sendMetadata(Endpoint anEndpoint)
void
setCasManager(AsynchAECasManager casManager)
void
setDeployDescriptor(java.lang.String deployDescriptor)
void
setInputChannel(InputChannel anInputChannel)
void
setOutputChannel(OutputChannel anOutputChannel)
void
setStopped()
Called to set the state of the AnalysisEngineController to STOPPED.void
setUimaEEAdminContext(UimaEEAdminContext anAdminContext)
void
stop()
void
takeAction(java.lang.String anAction, java.lang.String anEndpointName, ErrorContext anErrorContext)
void
terminate()
Called to initiate shutdown of the Asynchronous Service.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.uima.aae.controller.AnalysisEngineController
dumpState, getKey
-
-
-
-
Method Detail
-
addAbortedCasReferenceId
public void addAbortedCasReferenceId(java.lang.String casReferenceId)
- Specified by:
addAbortedCasReferenceId
in interfaceAnalysisEngineController
-
addInputChannel
public void addInputChannel(InputChannel anInputChannel) throws java.lang.Exception
- Specified by:
addInputChannel
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
addServiceInfo
public void addServiceInfo(ServiceInfo serviceInfo)
- Specified by:
addServiceInfo
in interfaceAnalysisEngineController
-
addTimeSnapshot
public void addTimeSnapshot(long snapshot, java.lang.String key)
-
beginProcess
public void beginProcess(int msgType)
- Specified by:
beginProcess
in interfaceAnalysisEngineController
-
cacheClientEndpoint
public void cacheClientEndpoint(Endpoint anEndpoint)
- Specified by:
cacheClientEndpoint
in interfaceAnalysisEngineController
-
collectionProcessComplete
public void collectionProcessComplete(Endpoint anEndpoint) throws AsynchAEException
- Specified by:
collectionProcessComplete
in interfaceAnalysisEngineController
- Throws:
AsynchAEException
-
dropCAS
public void dropCAS(java.lang.String casReferenceId, boolean dropCacheEntry)
- Specified by:
dropCAS
in interfaceAnalysisEngineController
-
dropCAS
public void dropCAS(org.apache.uima.cas.CAS acas)
- Specified by:
dropCAS
in interfaceAnalysisEngineController
-
dropStats
public void dropStats(java.lang.String casReferenceId, java.lang.String anEndpointName)
- Specified by:
dropStats
in interfaceAnalysisEngineController
-
endProcess
public void endProcess(int msgType)
- Specified by:
endProcess
in interfaceAnalysisEngineController
-
forceTimeoutOnPendingCases
public void forceTimeoutOnPendingCases(java.lang.String key)
- Specified by:
forceTimeoutOnPendingCases
in interfaceAnalysisEngineController
-
getAnalysisTime
public long getAnalysisTime()
- Specified by:
getAnalysisTime
in interfaceAnalysisEngineController
-
getCasManagerWrapper
public AsynchAECasManager getCasManagerWrapper()
- Specified by:
getCasManagerWrapper
in interfaceAnalysisEngineController
-
getCasStatistics
public ServicePerformance getCasStatistics(java.lang.String casReferenceId)
- Specified by:
getCasStatistics
in interfaceAnalysisEngineController
-
getChildUimaContext
public org.apache.uima.UimaContext getChildUimaContext(java.lang.String delegateEndpointName) throws java.lang.Exception
- Specified by:
getChildUimaContext
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
getClientEndpoint
public Endpoint getClientEndpoint()
- Specified by:
getClientEndpoint
in interfaceAnalysisEngineController
-
getComponentName
public java.lang.String getComponentName()
- Specified by:
getComponentName
in interfaceAnalysisEngineController
-
getDeadClientMap
public java.util.Map<java.lang.String,java.lang.String> getDeadClientMap()
- Specified by:
getDeadClientMap
in interfaceAnalysisEngineController
-
getControllerLatch
public ControllerLatch getControllerLatch()
- Specified by:
getControllerLatch
in interfaceAnalysisEngineController
-
getCpuTime
public long getCpuTime()
- Specified by:
getCpuTime
in interfaceAnalysisEngineController
-
getErrorHandlerChain
public ErrorHandlerChain getErrorHandlerChain()
- Specified by:
getErrorHandlerChain
in interfaceAnalysisEngineController
-
getEventListener
public EventSubscriber getEventListener()
- Specified by:
getEventListener
in interfaceAnalysisEngineController
-
getIdleTime
public long getIdleTime()
- Specified by:
getIdleTime
in interfaceAnalysisEngineController
-
getIdleTimeBetweenProcessCalls
public long getIdleTimeBetweenProcessCalls(int msgType)
- Specified by:
getIdleTimeBetweenProcessCalls
in interfaceAnalysisEngineController
-
getInProcessCache
public InProcessCache getInProcessCache()
- Specified by:
getInProcessCache
in interfaceAnalysisEngineController
-
getIndex
public int getIndex()
- Specified by:
getIndex
in interfaceAnalysisEngineController
-
getInputChannel
public InputChannel getInputChannel()
- Specified by:
getInputChannel
in interfaceAnalysisEngineController
-
getInputChannel
public InputChannel getInputChannel(java.lang.String queueName)
- Specified by:
getInputChannel
in interfaceAnalysisEngineController
-
getJMXDomain
public java.lang.String getJMXDomain()
- Specified by:
getJMXDomain
in interfaceAnalysisEngineController
-
getJmxContext
public java.lang.String getJmxContext()
- Specified by:
getJmxContext
in interfaceAnalysisEngineController
-
getLocalCache
public LocalCache getLocalCache()
- Specified by:
getLocalCache
in interfaceAnalysisEngineController
-
getManagementInterface
public JmxManagement getManagementInterface()
- Specified by:
getManagementInterface
in interfaceAnalysisEngineController
-
getMonitor
public Monitor getMonitor()
- Specified by:
getMonitor
in interfaceAnalysisEngineController
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceAnalysisEngineController
-
getOutputChannel
public OutputChannel getOutputChannel()
- Specified by:
getOutputChannel
in interfaceAnalysisEngineController
-
getParentController
public AnalysisEngineController getParentController()
- Specified by:
getParentController
in interfaceAnalysisEngineController
-
getReplyInputChannel
public InputChannel getReplyInputChannel(java.lang.String delegateKey)
- Specified by:
getReplyInputChannel
in interfaceAnalysisEngineController
-
getReplyTime
public long getReplyTime()
- Specified by:
getReplyTime
in interfaceAnalysisEngineController
-
getServiceEndpointName
public java.lang.String getServiceEndpointName()
- Specified by:
getServiceEndpointName
in interfaceAnalysisEngineController
-
getServiceErrors
public ServiceErrors getServiceErrors()
- Specified by:
getServiceErrors
in interfaceAnalysisEngineController
-
getServiceInfo
public ServiceInfo getServiceInfo()
- Specified by:
getServiceInfo
in interfaceAnalysisEngineController
-
getServicePerformance
public ServicePerformance getServicePerformance()
- Specified by:
getServicePerformance
in interfaceAnalysisEngineController
-
getStats
public java.util.Map getStats()
- Specified by:
getStats
in interfaceAnalysisEngineController
-
getTime
public long getTime(java.lang.String casReferenceId, java.lang.String anEndpointName)
- Specified by:
getTime
in interfaceAnalysisEngineController
-
getTimeSnapshot
public long getTimeSnapshot(java.lang.String key)
-
getTransport
public UimaTransport getTransport(UimaAsContext context, java.lang.String key) throws java.lang.Exception
- Specified by:
getTransport
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
getTransport
public UimaTransport getTransport(java.lang.String key) throws java.lang.Exception
- Specified by:
getTransport
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
getUimaEEAdminContext
public UimaEEAdminContext getUimaEEAdminContext()
- Specified by:
getUimaEEAdminContext
in interfaceAnalysisEngineController
-
getUimaMessageListener
public UimaMessageListener getUimaMessageListener(java.lang.String delegateKey)
- Specified by:
getUimaMessageListener
in interfaceAnalysisEngineController
-
handleDelegateLifeCycleEvent
public void handleDelegateLifeCycleEvent(java.lang.String anEndpoint, int delegateCount)
- Specified by:
handleDelegateLifeCycleEvent
in interfaceAnalysisEngineController
-
incrementDeserializationTime
public void incrementDeserializationTime(long cpuTime)
- Specified by:
incrementDeserializationTime
in interfaceAnalysisEngineController
-
incrementSerializationTime
public void incrementSerializationTime(long cpuTime)
- Specified by:
incrementSerializationTime
in interfaceAnalysisEngineController
-
initialize
public void initialize() throws AsynchAEException
- Specified by:
initialize
in interfaceAnalysisEngineController
- Throws:
AsynchAEException
-
initializeVMTransport
public void initializeVMTransport(int parentControllerReplyConsumerCount) throws java.lang.Exception
- Specified by:
initializeVMTransport
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
isAwaitingCacheCallbackNotification
public boolean isAwaitingCacheCallbackNotification()
- Specified by:
isAwaitingCacheCallbackNotification
in interfaceAnalysisEngineController
-
isCasMultiplier
public boolean isCasMultiplier()
- Specified by:
isCasMultiplier
in interfaceAnalysisEngineController
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitive
in interfaceAnalysisEngineController
-
isStopped
public boolean isStopped()
Description copied from interface:AnalysisEngineController
Returns true if the AnalysisEngineController has been (or is in the process of) shutdown.- Specified by:
isStopped
in interfaceAnalysisEngineController
- Returns:
- - true if stopped
-
isTopLevelComponent
public boolean isTopLevelComponent()
- Specified by:
isTopLevelComponent
in interfaceAnalysisEngineController
-
notifyListenersWithInitializationStatus
public void notifyListenersWithInitializationStatus(java.lang.Exception e)
- Specified by:
notifyListenersWithInitializationStatus
in interfaceAnalysisEngineController
-
onInitialize
public void onInitialize()
- Specified by:
onInitialize
in interfaceAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS cas, java.lang.String casId)
- Specified by:
process
in interfaceAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS acas, java.lang.String anInputCasReferenceId, java.lang.String newCasReferenceId, java.lang.String newCASProducedBy)
- Specified by:
process
in interfaceAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS acas, java.lang.String casReferenceId, Endpoint anEndpoint)
- Specified by:
process
in interfaceAnalysisEngineController
-
quiesceAndStop
public abstract void quiesceAndStop()
- Specified by:
quiesceAndStop
in interfaceAnalysisEngineController
-
registerVmQueueWithJMX
public void registerVmQueueWithJMX(java.lang.Object o, java.lang.String name) throws java.lang.Exception
- Specified by:
registerVmQueueWithJMX
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
releaseNextCas
public void releaseNextCas(java.lang.String casReferenceId)
- Specified by:
releaseNextCas
in interfaceAnalysisEngineController
-
saveReplyTime
public void saveReplyTime(long snapshot, java.lang.String key)
- Specified by:
saveReplyTime
in interfaceAnalysisEngineController
-
saveTime
public void saveTime(long anArrivalTime, java.lang.String casReferenceId, java.lang.String anEndpointName)
- Specified by:
saveTime
in interfaceAnalysisEngineController
-
sendMetadata
public void sendMetadata(Endpoint anEndpoint) throws AsynchAEException
- Specified by:
sendMetadata
in interfaceAnalysisEngineController
- Throws:
AsynchAEException
-
setCasManager
public void setCasManager(AsynchAECasManager casManager)
- Specified by:
setCasManager
in interfaceAnalysisEngineController
-
setDeployDescriptor
public void setDeployDescriptor(java.lang.String deployDescriptor)
- Specified by:
setDeployDescriptor
in interfaceAnalysisEngineController
-
setInputChannel
public void setInputChannel(InputChannel anInputChannel) throws java.lang.Exception
- Specified by:
setInputChannel
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
setOutputChannel
public void setOutputChannel(OutputChannel anOutputChannel) throws java.lang.Exception
- Specified by:
setOutputChannel
in interfaceAnalysisEngineController
- Throws:
java.lang.Exception
-
setStopped
public void setStopped()
Description copied from interface:AnalysisEngineController
Called to set the state of the AnalysisEngineController to STOPPED. This method does not stop input or output channels.- Specified by:
setStopped
in interfaceAnalysisEngineController
-
setUimaEEAdminContext
public void setUimaEEAdminContext(UimaEEAdminContext anAdminContext)
- Specified by:
setUimaEEAdminContext
in interfaceAnalysisEngineController
-
stop
public void stop()
- Specified by:
stop
in interfaceAnalysisEngineController
-
takeAction
public void takeAction(java.lang.String anAction, java.lang.String anEndpointName, ErrorContext anErrorContext)
- Specified by:
takeAction
in interfaceAnalysisEngineController
-
addControllerCallbackListener
public void addControllerCallbackListener(ControllerCallbackListener listener)
Description copied from interface:ControllerLifecycle
Register one or more listeners through which the controller can send notification of events.- Specified by:
addControllerCallbackListener
in interfaceControllerLifecycle
- Parameters:
listener
- - application listener object to register
-
removeControllerCallbackListener
public void removeControllerCallbackListener(ControllerCallbackListener listener)
Description copied from interface:ControllerLifecycle
Removes named application listener.- Specified by:
removeControllerCallbackListener
in interfaceControllerLifecycle
- Parameters:
listener
- - application listener to remove
-
terminate
public void terminate()
Description copied from interface:ControllerLifecycle
Called to initiate shutdown of the Asynchronous Service. An implementation can close an input and output channels and do any necessary cleanup before terminating.- Specified by:
terminate
in interfaceControllerLifecycle
-
addEndpointToDoNotProcessList
public void addEndpointToDoNotProcessList(java.lang.String anEndpointName)
-
isEndpointOnDontProcessList
public boolean isEndpointOnDontProcessList(java.lang.String anEndpointName)
-
evictExpiredEntries
public void evictExpiredEntries()
-
changeState
public void changeState(BaseAnalysisEngineController.ServiceState state)
- Specified by:
changeState
in interfaceAnalysisEngineController
-
getState
public BaseAnalysisEngineController.ServiceState getState()
- Specified by:
getState
in interfaceAnalysisEngineController
-
-