GigaSpaces XAP 7.0 API

org.openspaces.esb.mule.eventcontainer
Class OpenSpacesMessageReceiver

java.lang.Object
  extended by org.mule.transport.AbstractConnectable
      extended by org.mule.transport.AbstractMessageReceiver
          extended by org.openspaces.esb.mule.eventcontainer.OpenSpacesMessageReceiver
All Implemented Interfaces:
ExceptionListener, org.mule.api.lifecycle.Disposable, org.mule.api.lifecycle.Initialisable, org.mule.api.lifecycle.Startable, org.mule.api.lifecycle.Stoppable, org.mule.api.transport.Connectable, org.mule.api.transport.MessageReceiver, SpaceDataEventListener

public class OpenSpacesMessageReceiver
extends org.mule.transport.AbstractMessageReceiver
implements SpaceDataEventListener

OpenSpacesMessageReceiver is used to receive data from an GigaSpaces's space. It implements SpaceDataEventListener and as such it register itself to Polling/Notify SpaceListeningContainer.

Author:
yitzhaki
See Also:
SpaceDataEventListener

Nested Class Summary
protected static class OpenSpacesMessageReceiver.GigaSpaceWorker
           
 
Field Summary
 
Fields inherited from class org.mule.transport.AbstractMessageReceiver
receiverKey, responseEndpoint, service
 
Fields inherited from class org.mule.transport.AbstractConnectable
connected, connector, endpoint, logger, retryTemplate, started, startOnConnect
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Constructor Summary
OpenSpacesMessageReceiver(org.mule.api.transport.Connector connector, org.mule.api.service.Service service, org.mule.api.endpoint.InboundEndpoint endpoint)
          Creates a OpenSpacesMessageReceiver and resister it as a SpaceDataEventListener to the Polling/Notify container that declared as umoEndpoint.EndpointURI.address.
 
Method Summary
protected  void doConnect()
           
protected  void doDisconnect()
           
protected  void doDispose()
           
protected  void doReceiveEvent(Object data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
           
protected  void doStart()
           
protected  void doStop()
           
 void onEvent(Object data, GigaSpace gigaSpace, TransactionStatus txStatus, Object source)
          An event callback with the actual data object of the event.
 
Methods inherited from class org.mule.transport.AbstractMessageReceiver
dispose, getConnectEventId, getConnectionDescription, getEndpoint, getEndpointURI, getListener, getReceiverKey, getService, getWorkManager, handleUnacceptedFilter, initialise, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, routeMessage, setEndpoint, setExceptionDetails, setListener, setReceiverKey, setService, toString
 
Methods inherited from class org.mule.transport.AbstractConnectable
activate, connect, disconnect, disposeAndLogException, doInitialise, exceptionThrown, getConnectEventId, getConnector, handleException, isConnected, isDoThreading, isStarted, passivate, setEndpoint, start, stop, validate, validateConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transport.Connectable
connect, disconnect, isConnected, validateConnection
 
Methods inherited from interface org.mule.api.lifecycle.Startable
start
 
Methods inherited from interface org.mule.api.lifecycle.Stoppable
stop
 

Constructor Detail

OpenSpacesMessageReceiver

public OpenSpacesMessageReceiver(org.mule.api.transport.Connector connector,
                                 org.mule.api.service.Service service,
                                 org.mule.api.endpoint.InboundEndpoint endpoint)
                          throws org.mule.api.lifecycle.CreateException
Creates a OpenSpacesMessageReceiver and resister it as a SpaceDataEventListener to the Polling/Notify container that declared as umoEndpoint.EndpointURI.address.

Parameters:
connector - the endpoint that created this listener
service - the service to associate with the receiver. When data is received the component dispatchEvent or sendEvent is used to dispatch the data to the relivant UMO.
endpoint - the provider contains the endpointUri on which the receiver will listen on. The URI structure must be declared as the following os://
Throws:
org.mule.api.lifecycle.CreateException
See Also:
Service, ImmutableEndpoint
Method Detail

onEvent

public void onEvent(Object data,
                    GigaSpace gigaSpace,
                    TransactionStatus txStatus,
                    Object source)
An event callback with the actual data object of the event. This method invoked by eventListenerContainer creates a UMOMessage that wraps the data object, then routes the UMOMessage via the Mule bus.

Specified by:
onEvent in interface SpaceDataEventListener
Parameters:
data - The actual data object of the event
gigaSpace - A GigaSpace instance that can be used to perofrm additional operations against the space
txStatus - An optional transaction status allowing to rollback a transaction programmatically
source - Optional additional data or the actual source event data object (where relevant)

doReceiveEvent

protected void doReceiveEvent(Object data,
                              GigaSpace gigaSpace,
                              TransactionStatus txStatus,
                              Object source)
                       throws Exception
Throws:
Exception

doStart

protected void doStart()
                throws org.mule.api.MuleException
Overrides:
doStart in class org.mule.transport.AbstractConnectable
Throws:
org.mule.api.MuleException

doDisconnect

protected void doDisconnect()
                     throws Exception
Overrides:
doDisconnect in class org.mule.transport.AbstractConnectable
Throws:
Exception

doStop

protected void doStop()
               throws org.mule.api.MuleException
Overrides:
doStop in class org.mule.transport.AbstractConnectable
Throws:
org.mule.api.MuleException

doConnect

protected void doConnect()
                  throws Exception
Overrides:
doConnect in class org.mule.transport.AbstractConnectable
Throws:
Exception

doDispose

protected void doDispose()
Overrides:
doDispose in class org.mule.transport.AbstractConnectable

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.