KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > client > multicast > LrmpClientSession


1 package com.ubermq.jms.client.multicast;
2
3 import com.ubermq.jms.client.*;
4 import com.ubermq.kernel.*;
5
6 import com.ubermq.jms.client.InternetConnectionDescriptor;
7 import java.net.InetSocketAddress JavaDoc;
8
9 /**
10  * An LRMP client session, which creates an LRMP connection on behalf
11  * of a connection factory. Assumes TTL_SUBNET for all broadcasts. Someday
12  * this should be configurable on the connection factory level.
13  */

14 public class LrmpClientSession
15     implements IClientSession
16 {
17     public static final int
18         TTL_MACHINE = 0,
19         TTL_SUBNET = 1,
20         TTL_SITE = 15,
21         TTL_REGION = 63,
22         TTL_WORLDWIDE = 127;
23
24     public LrmpClientSession()
25     {
26     }
27
28     public void started(IConnectionInfo c)
29     {
30     }
31
32     public IConnectionInfo connect(javax.jms.Connection JavaDoc cxn,
33                                    ConnectionDescriptor descriptor,
34                                    IMessageProcessor proc)
35         throws java.io.IOException JavaDoc
36     {
37         InternetConnectionDescriptor d = (InternetConnectionDescriptor)descriptor;
38         InetSocketAddress JavaDoc a = (InetSocketAddress JavaDoc)d.getAddress();
39         return new LrmpConnectionInfo(cxn, a.getHostName(), a.getPort(), TTL_SUBNET, proc);
40     }
41 }
42
Popular Tags