1 package org.myoodb.core; 25 26 import java.io.*; 27 import java.net.*; 28 29 import org.myoodb.*; 30 import org.myoodb.util.*; 31 32 public class ServletConnection extends AbstractURL 33 { 34 protected MyOodbDatabase m_db; 35 36 public ServletConnection(MyOodbDatabase db, Long identifier, boolean passThrough, String host, int port, boolean secure, int timeout, String tunnelExtension) throws IOException 37 { 38 super(identifier, passThrough, host, port, secure, timeout, tunnelExtension); 39 m_db = db; 40 } 41 42 protected ObjectInputStream getObjectInputStream(InputStream inputStream) throws java.io.IOException 43 { 44 return new FastObjectInputStream(new BufferedInputStream(inputStream, BUFFER_SIZE), m_db); 45 } 46 47 public Object receive(int timeout) throws IOException, ClassNotFoundException , org.myoodb.exception.TimeoutException 48 { 49 if (m_in instanceof FastObjectInputStream) 50 { 51 ((FastObjectInputStream) m_in).setUserContext(m_db); 52 } 53 54 return super.receive(timeout); 55 } 56 } 57 | Popular Tags |