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