1 package com.ubermq.jms.client.impl; 2 3 import com.ubermq.jms.client.*; 4 import com.ubermq.jms.client.impl.*; 5 import com.ubermq.kernel.*; 6 import java.io.*; 7 import java.nio.channels.*; 8 import org.apache.log4j.*; 9 10 17 public abstract class AbstractClientSession 18 implements IClientSession 19 { 20 private static final Logger log = Logger.getLogger(AbstractClientSession.class); 21 22 25 private static ReadWriteTransformThread read, write; 26 27 static 28 { 29 try 30 { 31 read = new ReadWriteTransformThread(SelectionKey.OP_READ); 32 read.start(); 33 34 write = new ReadWriteTransformThread(SelectionKey.OP_WRITE); 35 write.start(); 36 } 37 catch (IOException e) { 38 log.fatal("Unable to start I/O threads", e); 39 } 40 } 41 42 public AbstractClientSession() 43 throws java.io.IOException 44 { 45 } 46 47 50 public void started(IConnectionInfo c) 51 throws IOException 52 { 53 addConnection((ConnectionInfo)c); 54 } 55 56 64 public void addConnection(ConnectionInfo conn) 65 throws IOException 66 { 67 write.register(conn, true); 68 read.register(conn, true); 69 } 70 } 71 72 | Popular Tags |