org.objectweb.joram.client.jms.connection
Class MultiThreadSyncChannel

java.lang.Object
  extended by org.objectweb.joram.client.jms.connection.MultiThreadSyncChannel
All Implemented Interfaces:
RequestChannel

public class MultiThreadSyncChannel
extends java.lang.Object
implements RequestChannel

Class wrapping the RequestChannel in order to group the requests. It allows best performances with multiples senders.


Nested Class Summary
private static class MultiThreadSyncChannel.SyncRound
           
 
Field Summary
private  RequestChannel channel
          The related RequestChannel.
private  MultiThreadSyncChannel.SyncRound currentRound
          Synchronization round.
private  int multiThreadSyncDelay
          The maximum time the threads hang if 'multiThreadSync' is true.
private  int multiThreadSyncThreshold
          The maximum numbers of threads that hang if 'multiThreadSync' is true.
private  java.util.Vector syncRequests
          Synchronized requests.
 
Constructor Summary
MultiThreadSyncChannel(RequestChannel rc, int delay, int threshold)
           
 
Method Summary
 void close()
           
 void closing()
           
 void connect()
           
 AbstractJmsReply receive()
           
 void send(AbstractJmsRequest request)
           
 void setTimer(java.util.Timer timer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentRound

private MultiThreadSyncChannel.SyncRound currentRound
Synchronization round.


syncRequests

private java.util.Vector syncRequests
Synchronized requests.


multiThreadSyncDelay

private int multiThreadSyncDelay
The maximum time the threads hang if 'multiThreadSync' is true. Either they wake up (wait time out) or they are notified (by the first woken up thread).


multiThreadSyncThreshold

private int multiThreadSyncThreshold
The maximum numbers of threads that hang if 'multiThreadSync' is true.


channel

private RequestChannel channel
The related RequestChannel.

Constructor Detail

MultiThreadSyncChannel

MultiThreadSyncChannel(RequestChannel rc,
                       int delay,
                       int threshold)
Method Detail

send

public void send(AbstractJmsRequest request)
          throws java.lang.Exception
Specified by:
send in interface RequestChannel
Throws:
java.lang.Exception

setTimer

public void setTimer(java.util.Timer timer)
Specified by:
setTimer in interface RequestChannel

connect

public void connect()
             throws java.lang.Exception
Specified by:
connect in interface RequestChannel
Throws:
java.lang.Exception

receive

public AbstractJmsReply receive()
                         throws java.lang.Exception
Specified by:
receive in interface RequestChannel
Throws:
java.lang.Exception

close

public void close()
Specified by:
close in interface RequestChannel

closing

public void closing()
Specified by:
closing in interface RequestChannel


Copyright © 2010 ScalAgent D.T.. All Rights Reserved.