Class JmsOutputChannel
java.lang.Object
org.apache.uima.adapter.jms.activemq.JmsOutputChannel
- All Implemented Interfaces:
Channel
,OutputChannel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
protected class
-
Field Summary
Fields inherited from interface org.apache.uima.aae.Channel
CloseAllChannels, InputChannels
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bindWithClientEndpoint
(Endpoint anEndpoint) This method verifies that the destination (queue) exists.void
org.apache.activemq.ActiveMQConnectionFactory
getName()
void
void
void
sendReply
(Throwable t, String aCasReferenceId, String aParentCasReferenceId, Endpoint anEndpoint, int aCommand) Sends JMS Reply Message to a given endpoint.void
sendReply
(InProcessCache.CacheEntry entry, Endpoint anEndpoint) void
sendReply
(org.apache.uima.resource.metadata.ProcessingResourceMetaData aProcessingResourceMetadata, Endpoint anEndpoint, boolean serialize) void
sendRequest
(int aCommand, String aCasReferenceId, Endpoint anEndpoint) Sends request message to a delegate.serializeCAS
(boolean isReply, org.apache.uima.cas.CAS aCAS, String aCasReferenceId, String aSerializerKey) Serializes CAS using indicated Serializer.void
setConnectionFactory
(org.apache.activemq.ActiveMQConnectionFactory connectionFactory) void
setController
(AnalysisEngineController analysisEngineController) void
setControllerInputEndpoint
(String controllerInputEndpoint) protected void
setFreeCasQueue
(javax.jms.Destination destination) void
setSecondaryInputQueue
(String anEndpoint) void
setServerURI
(String aServerURI) Sets the ActiveMQ Broker URIvoid
setServiceInputEndpoint
(String anEnpoint) void
stop()
void
stop
(int channelsToClose)
-
Constructor Details
-
JmsOutputChannel
public JmsOutputChannel()
-
-
Method Details
-
setServerURI
Sets the ActiveMQ Broker URI- Specified by:
setServerURI
in interfaceOutputChannel
-
setFreeCasQueue
protected void setFreeCasQueue(javax.jms.Destination destination) -
getServerURI
-
getName
-
setConnectionFactory
public void setConnectionFactory(org.apache.activemq.ActiveMQConnectionFactory connectionFactory) - Parameters:
connectionFactory
-
-
setServiceInputEndpoint
-
setSecondaryInputQueue
-
getConnectionFactory
public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory() -
initialize
- Specified by:
initialize
in interfaceOutputChannel
- Throws:
AsynchAEException
-
serializeCAS
public String serializeCAS(boolean isReply, org.apache.uima.cas.CAS aCAS, String aCasReferenceId, String aSerializerKey) throws Exception Serializes CAS using indicated Serializer.- Parameters:
aCAS
- - CAS instance to serializeaSerializerKey
- - a key identifying which serializer to use- Returns:
- - String - serialized CAS as String
- Throws:
Exception
-
bindWithClientEndpoint
This method verifies that the destination (queue) exists. It opens a connection the a broker, creates a session and a message producer. Finally, using the message producer, sends an empty message to a queue. This API support enables checking for existence of the reply (temp) queue before any processing of a cas is done. This is an optimization to prevent expensive processing if the client destination is no longer available.- Specified by:
bindWithClientEndpoint
in interfaceOutputChannel
- Throws:
Exception
-
sendRequest
public void sendRequest(int aCommand, String aCasReferenceId, Endpoint anEndpoint) throws AsynchAEException Sends request message to a delegate.- Specified by:
sendRequest
in interfaceOutputChannel
- Parameters:
aCommand
- - the type of request [Process|GetMeta]anEndpoint
- - the destination where the delegate receives messages- Throws:
AsynchAEException
-
sendReply
public void sendReply(InProcessCache.CacheEntry entry, Endpoint anEndpoint) throws AsynchAEException - Specified by:
sendReply
in interfaceOutputChannel
- Throws:
AsynchAEException
-
sendReply
public void sendReply(int aCommand, Endpoint anEndpoint, String aCasReferenceId, boolean notifyOnJmsException) throws AsynchAEException - Specified by:
sendReply
in interfaceOutputChannel
- Throws:
AsynchAEException
-
sendReply
public void sendReply(Throwable t, String aCasReferenceId, String aParentCasReferenceId, Endpoint anEndpoint, int aCommand) throws AsynchAEException Sends JMS Reply Message to a given endpoint. The reply message contains given Throwable (with full stack)- Specified by:
sendReply
in interfaceOutputChannel
- Parameters:
t
- - Throwable to include in the reply messageanEndpoint
- - an endpoint to receive the reply messageaCasReferenceId
- - a unique CAS reference id- Throws:
AsynchAEException
-
sendReply
public void sendReply(org.apache.uima.resource.metadata.ProcessingResourceMetaData aProcessingResourceMetadata, Endpoint anEndpoint, boolean serialize) throws AsynchAEException - Specified by:
sendReply
in interfaceOutputChannel
- Parameters:
aProcessingResourceMetadata
-anEndpoint
-serialize
-- Throws:
AsynchAEException
-
getAnalysisEngineController
-
setController
- Specified by:
setController
in interfaceOutputChannel
-
getControllerInputEndpoint
-
setControllerInputEndpoint
-
stop
public void stop()- Specified by:
stop
in interfaceChannel
- Specified by:
stop
in interfaceOutputChannel
-
stop
public void stop(int channelsToClose) -
cancelTimers
public void cancelTimers()- Specified by:
cancelTimers
in interfaceOutputChannel
-