org.gcube.datatransfer.common.messaging
Class BrokerSubscription<LISTENER extends javax.jms.MessageListener>

java.lang.Object
  extended by java.lang.Thread
      extended by org.gcube.datatransfer.common.messaging.BrokerSubscription<LISTENER>
Type Parameters:
LISTENER -
All Implemented Interfaces:
Runnable, javax.jms.ExceptionListener

public abstract class BrokerSubscription<LISTENER extends javax.jms.MessageListener>
extends Thread
implements javax.jms.ExceptionListener

Author:
Andrea Manzi(CERN)

Nested Class Summary
 class BrokerSubscription.DestinationPair
          destination pair
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected static int ackMode
           
protected  ArrayList<javax.jms.Connection> connections
           
protected  LISTENER listener
           
protected  ArrayList<String> messageSelectors
           
protected  BrokerSubscription.DestinationPair pair
           
protected  String subscriberEndpoint
           
protected static boolean transacted
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BrokerSubscription(String subscriberEndpoint)
          default constructor
 
Method Summary
 ArrayList<javax.jms.Connection> getConnections()
          Get the list of connections
 BrokerSubscription.DestinationPair getDestinationPair()
          get the DestinationPair info
 LISTENER getListener()
          Get the listener associated to the subscription
 ArrayList<String> getMessageSelectors()
          Get the message Selectors for this subscription
 void onException(javax.jms.JMSException exce)
          
 void run()
           
 void setConnections(ArrayList<javax.jms.Connection> connections)
          Set the list of connections
 void setDestinationPair(BrokerSubscription.DestinationPair pair)
          set the DestinationPair info
 void setListener(LISTENER listener)
          set the listener associated to the connection
 void setMessageSelectors(ArrayList<String> messageSelectors)
          Set the message selectors for this subscription
abstract  void setScope(org.gcube.common.core.scope.GCUBEScope scope)
          set the scope
 void setupQueueSubscription()
          setupQueueSubscription
 void subscribe()
          subscribe
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subscriberEndpoint

protected String subscriberEndpoint

pair

protected BrokerSubscription.DestinationPair pair

messageSelectors

protected ArrayList<String> messageSelectors

listener

protected LISTENER extends javax.jms.MessageListener listener

connections

protected ArrayList<javax.jms.Connection> connections

transacted

protected static boolean transacted

ackMode

protected static int ackMode
Constructor Detail

BrokerSubscription

public BrokerSubscription(String subscriberEndpoint)
default constructor

Method Detail

setScope

public abstract void setScope(org.gcube.common.core.scope.GCUBEScope scope)
set the scope

Parameters:
scope - the scope to set

subscribe

public void subscribe()
               throws Exception
subscribe

Throws:
Exception

getConnections

public ArrayList<javax.jms.Connection> getConnections()
Get the list of connections

Returns:
the list of connections

setConnections

public void setConnections(ArrayList<javax.jms.Connection> connections)
Set the list of connections

Parameters:
connections - the list of connections

setupQueueSubscription

public void setupQueueSubscription()
                            throws Exception
setupQueueSubscription

Throws:
Exception

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

onException

public void onException(javax.jms.JMSException exce)

Specified by:
onException in interface javax.jms.ExceptionListener

getDestinationPair

public BrokerSubscription.DestinationPair getDestinationPair()
get the DestinationPair info

Returns:
the DestinationPair info

setDestinationPair

public void setDestinationPair(BrokerSubscription.DestinationPair pair)
set the DestinationPair info

Parameters:
pair - the DestinationPair info

getListener

public LISTENER getListener()
Get the listener associated to the subscription

Returns:
the listener

setListener

public void setListener(LISTENER listener)
set the listener associated to the connection

Parameters:
listener - the listener

getMessageSelectors

public ArrayList<String> getMessageSelectors()
Get the message Selectors for this subscription

Returns:
the message selectors

setMessageSelectors

public void setMessageSelectors(ArrayList<String> messageSelectors)
Set the message selectors for this subscription

Parameters:
messageSelectors - the message selector


Copyright © 2013. All Rights Reserved.