Package com.wombat.mama
Class MamaBasicSubscription
- java.lang.Object
-
- com.wombat.mama.MamaBasicSubscription
-
public class MamaBasicSubscription extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MamaBasicSubscription()
The constructor allocates the underlying C subscription.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createBasicSubscription(MamaBasicSubscriptionCallback callback, MamaTransport transport, MamaQueue queue, java.lang.String topic, java.lang.Object closure)
Create a basic subscription without marketdata semantics.void
createBasicWildCardSubscription(MamaBasicWildCardSubscriptionCallback callback, MamaTransport transport, MamaQueue queue, java.lang.String source, java.lang.String topic, java.lang.Object closure)
Create a basic wildcard subscription.void
deallocate()
De-allocates the underlying C subscription.void
destroy()
This function will destroy the subscription, it must be called from the same thread that is processing the queue for the subscription.void
destroyEx()
This function will destroy the subscription and can be called from any thread.java.lang.Object
getClosure()
This function returns the closure supplied to the createSubscription function.long
getPointerVal()
This function returns the pointer to the underlying C subscription.MamaSubscriptionState
getState()
This function returns the current state of the subscription as one of the MamaSubscriptionState instances, see this class for more information.java.lang.String
getSymbol()
This function returns the symbol subscribed to.
-
-
-
Method Detail
-
createBasicSubscription
public void createBasicSubscription(MamaBasicSubscriptionCallback callback, MamaTransport transport, MamaQueue queue, java.lang.String topic, java.lang.Object closure)
Create a basic subscription without marketdata semantics.- Parameters:
callback
- The object implementing the callback functions.transport
- The MamaTransport.queue
- The MamaQueue.topic
- The symbol name.closure
- The closure will be passed to subsequent callback invocations for this subscription.
-
createBasicWildCardSubscription
public void createBasicWildCardSubscription(MamaBasicWildCardSubscriptionCallback callback, MamaTransport transport, MamaQueue queue, java.lang.String source, java.lang.String topic, java.lang.Object closure)
Create a basic wildcard subscription. The topic must be a valid wildcard topic for the underlying middleware. For WMW a source with a NULL symbol parameter creates a "transport" subscription that receives all messages on the transport and bypasses the naming service. A publishing transport can be assigned a name with the publish_name property.- Parameters:
subscription
- The subscription.transport
- The transport to use.queue
- The mama queue.callbacks
- The mamaMsgCallbacks structure containing the callback functions.source
- The source name of the feed handler to provide the subscription.symbol
- The symbol name.closure
- The closure will be passed to subsequent callback invocations for this subscription.
-
getClosure
public java.lang.Object getClosure()
This function returns the closure supplied to the createSubscription function.- Returns:
- The closure object.
-
getPointerVal
public long getPointerVal()
This function returns the pointer to the underlying C subscription.- Returns:
- The pointer.
-
getState
public MamaSubscriptionState getState()
This function returns the current state of the subscription as one of the MamaSubscriptionState instances, see this class for more information.- Returns:
- The MamaSubscriptionState that represents the current state of the subscription.
-
deallocate
public void deallocate()
De-allocates the underlying C subscription. This can be used to reduce time during finalization.
-
destroy
public void destroy()
This function will destroy the subscription, it must be called from the same thread that is processing the queue for the subscription. Use destroyEx to destroy the subscription from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received.
-
destroyEx
public void destroyEx()
This function will destroy the subscription and can be called from any thread. Note that the subscription will not be fully destroyed until the onDestroy callback is received. To destroy from the dispatching thread the destroy function should be used in preference.
-
getSymbol
public java.lang.String getSymbol()
This function returns the symbol subscribed to.- Returns:
- The symbol.
-
-