Package org.eclipse.scanning.event
Class EventServiceImpl
java.lang.Object
org.eclipse.scanning.event.EventServiceImpl
- All Implemented Interfaces:
IEventService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends EventListener>
ISubscriber<T> createAMQPSubscriber(URI uri, String topicName) Creates an ISubscriber for an AMQP topic with a given routingKey.<U extends StatusBean>
IJmsQueueReader<U> createJmsQueueReader(URI uri, String queueName) Create a Jms queue reader.<U extends StatusBean>
IJobQueue<U> createJobQueue(URI uri) Create anIJobQueuewith the default submission queue, status topic and command topic names<U extends StatusBean>
IJobQueue<U> createJobQueue(URI uri, String submissionQueueName, String statusTopicName) Create a consumer with the given submission queue, and status topic names.<U extends StatusBean>
IJobQueue<U> createJobQueue(URI uri, String submissionQName, String statusTopicName, String queueStatusTopicName, String commandTopicName, String commandAckTopicName) Create a job queue with the given submission queue, status queue, status topic, consumer status topic, command topic and command acknowledgement topic names.<U extends StatusBean>
IJobQueue<U> createJobQueueProxy(URI uri, String submissionQueueName) Create a proxy for theIJobQueuefor the given submission queue name, using the default command and command acknowledgement topics.<U extends StatusBean>
IJobQueue<U> createJobQueueProxy(URI uri, String submissionQueueName, String commandTopicName, String commandAckTopicName) Create a proxy for theIJobQueuefor the given submission queue.<U> IPublisher<U> createPublisher(URI uri, String topicName) Creates an IEventPublisher for the topic with the given name.<T> TcreateRemoteService(URI uri, Class<T> serviceClass) Use this call to create a remote service.<T extends IdBean>
IRequester<T> createRequestor(URI uri, String requestTopic, String responseTopic) A poster encapsulates sending and receiving a reply.<T extends IdBean>
IResponder<T> createResponder(URI uri, String requestTopic, String responseTopic) Creates a responder on a given topic.<U extends StatusBean>
ISubmitter<U> createSubmitter(URI uri, String queueName) Create a submitter for adding a bean of type U onto the queue.<T extends EventListener>
ISubscriber<T> createSubscriber(URI uri, String topicName) Creates an ISubscriber for the topic with the given name.voidDisconnect all JMS resources used by allIJobQueues and unregisters them from this service.voiddisposeJobQueue(String queueName) Disconnect the JMS resources used by theIJobQueuefor the given submission queue name and unregisters it from this service.The current event connector service that this event service is using to talk to messaging and to marshall objects.IJobQueue<? extends StatusBean> getJobQueue(String queueName) Returns the job queue for the given submission queue name.voidsetEventConnectorService(IEventConnectorService eventService)
-
Constructor Details
-
EventServiceImpl
public EventServiceImpl() -
EventServiceImpl
-
-
Method Details
-
setEventConnectorService
-
createSubscriber
Description copied from interface:IEventServiceCreates an ISubscriber for the topic with the given name. Useful on the client for adding event listeners to be notified. Scan events have a unique id with which to ascertain if a given scan event came from given scan.- Specified by:
createSubscriberin interfaceIEventService- Parameters:
uri- - the location of the JMS broker- Returns:
- IEventManager
-
createAMQPSubscriber
Description copied from interface:IEventServiceCreates an ISubscriber for an AMQP topic with a given routingKey.- Specified by:
createAMQPSubscriberin interfaceIEventService- Parameters:
uri- - the location of the JMS broker- Returns:
- IEventManager
-
createPublisher
Description copied from interface:IEventServiceCreates an IEventPublisher for the topic with the given name.- Specified by:
createPublisherin interfaceIEventService- Parameters:
uri- - the location of the JMS broker- Returns:
- IEventManager
-
createSubmitter
Description copied from interface:IEventServiceCreate a submitter for adding a bean of type U onto the queue.- Specified by:
createSubmitterin interfaceIEventService- Parameters:
uri-queueName-- Returns:
- the new submitter
-
createJobQueue
Description copied from interface:IEventServiceCreate anIJobQueuewith the default submission queue, status topic and command topic names- Specified by:
createJobQueuein interfaceIEventService- Parameters:
uri-- Returns:
- the new job queue
- Throws:
EventException
-
createJobQueue
public <U extends StatusBean> IJobQueue<U> createJobQueue(URI uri, String submissionQueueName, String statusTopicName) throws EventException Description copied from interface:IEventServiceCreate a consumer with the given submission queue, and status topic names.- Specified by:
createJobQueuein interfaceIEventService- Parameters:
uri-submissionQueueName- name of the submission queuestatusTopicName-- Returns:
- the new job queue
- Throws:
EventException
-
createJobQueue
public <U extends StatusBean> IJobQueue<U> createJobQueue(URI uri, String submissionQName, String statusTopicName, String queueStatusTopicName, String commandTopicName, String commandAckTopicName) throws EventException Description copied from interface:IEventServiceCreate a job queue with the given submission queue, status queue, status topic, consumer status topic, command topic and command acknowledgement topic names.- Specified by:
createJobQueuein interfaceIEventService- Parameters:
uri- the uri of the messagesubmissionQName-statusTopicName-commandTopicName-commandAckTopicName-- Returns:
- the new job queue
- Throws:
EventException
-
getJobQueue
Description copied from interface:IEventServiceReturns the job queue for the given submission queue name. For server-side code only! Client-side code should useIEventService.createJobQueueProxy(URI, String).- Specified by:
getJobQueuein interfaceIEventService- Parameters:
queueName-- Returns:
- the consumer for the given queue name
- Throws:
EventException- thrown if no job queue exists for the given queue name.
-
createJmsQueueReader
public <U extends StatusBean> IJmsQueueReader<U> createJmsQueueReader(URI uri, String queueName) throws EventException Description copied from interface:IEventServiceCreate a Jms queue reader. This will read messages from the JMS (ActiveMq) queue with the given name and add it to the submission queue of theIJobQueuewith the same name.- Specified by:
createJmsQueueReaderin interfaceIEventService- Parameters:
uri-queueName-- Returns:
- the JMS queue reader
- Throws:
EventException
-
createJobQueueProxy
public <U extends StatusBean> IJobQueue<U> createJobQueueProxy(URI uri, String submissionQueueName) throws EventException Description copied from interface:IEventServiceCreate a proxy for theIJobQueuefor the given submission queue name, using the default command and command acknowledgement topics.- Specified by:
createJobQueueProxyin interfaceIEventService- Parameters:
uri-submissionQueueName-- Returns:
- a proxy to the job queue for the given queue name
- Throws:
EventException
-
createJobQueueProxy
public <U extends StatusBean> IJobQueue<U> createJobQueueProxy(URI uri, String submissionQueueName, String commandTopicName, String commandAckTopicName) throws EventException Description copied from interface:IEventServiceCreate a proxy for theIJobQueuefor the given submission queue. The given command topic and command acknowledgement topic names are used to communicate with the job queue.- Specified by:
createJobQueueProxyin interfaceIEventService- Parameters:
uri-submissionQueueName-commandTopicName-commandAckTopicName-- Returns:
- a proxy to the job queue for the given queue name
- Throws:
EventException
-
disposeJobQueue
Description copied from interface:IEventServiceDisconnect the JMS resources used by theIJobQueuefor the given submission queue name and unregisters it from this service.- Specified by:
disposeJobQueuein interfaceIEventService- Parameters:
queueName-- Throws:
EventException
-
disposeAllJobQueues
Description copied from interface:IEventServiceDisconnect all JMS resources used by allIJobQueues and unregisters them from this service.- Specified by:
disposeAllJobQueuesin interfaceIEventService- Throws:
EventException
-
createRequestor
public <T extends IdBean> IRequester<T> createRequestor(URI uri, String requestTopic, String responseTopic) throws EventException Description copied from interface:IEventServiceA poster encapsulates sending and receiving a reply. For instance request a list of detectors on the server. This is the same as creating a broadcaster, sending an object then subscribing to the reply.- Specified by:
createRequestorin interfaceIEventService- Parameters:
uri-requestTopic-responseTopic-- Returns:
- Throws:
EventException
-
createResponder
public <T extends IdBean> IResponder<T> createResponder(URI uri, String requestTopic, String responseTopic) throws EventException Description copied from interface:IEventServiceCreates a responder on a given topic.- Specified by:
createResponderin interfaceIEventService- Parameters:
uri-requestTopic-responseTopic-- Returns:
- Throws:
EventException
-
getEventConnectorService
Description copied from interface:IEventServiceThe current event connector service that this event service is using to talk to messaging and to marshall objects.- Specified by:
getEventConnectorServicein interfaceIEventService- Returns:
-
createRemoteService
Description copied from interface:IEventServiceUse this call to create a remote service. A wrapper will be created around the service such that methods called on the client will cause an event to trigger which has a response generated by the server. The event service caches remote services assuming that each service should exist once.- Specified by:
createRemoteServicein interfaceIEventService- Parameters:
uri-serviceClass-- Returns:
- Throws:
EventException
-