Tabnine Logo
WebServer.trace
Code IndexAdd Tabnine to your IDE (free)

How to use
trace
method
in
org.h2.server.web.WebServer

Best Java code snippets using org.h2.server.web.WebServer.trace (Showing top 20 results out of 315)

origin: com.h2database/h2

  private void trace(String s) {
    server.trace(s);
  }
}
origin: com.h2database/h2

private void trace(String s) {
  server.trace(s);
}
origin: com.h2database/h2

/**
 * Read the given file from the file system or from the resources.
 *
 * @param file the file name
 * @return the data
 */
byte[] getFile(String file) throws IOException {
  trace("getFile <" + file + ">");
  byte[] data = Utils.getResource("/org/h2/server/web/res/" + file);
  if (data == null) {
    trace(" null");
  } else {
    trace(" size=" + data.length);
  }
  return data;
}
origin: com.h2database/h2

/**
 * Get the web session object for the given session id.
 *
 * @param sessionId the session id
 * @return the web session or null
 */
WebSession getSession(String sessionId) {
  long now = System.currentTimeMillis();
  if (lastTimeoutCheck + SESSION_TIMEOUT < now) {
    for (String id : new ArrayList<>(sessions.keySet())) {
      WebSession session = sessions.get(id);
      if (session.lastAccess + SESSION_TIMEOUT < now) {
        trace("timeout for " + id);
        sessions.remove(id);
      }
    }
    lastTimeoutCheck = now;
  }
  WebSession session = sessions.get(sessionId);
  if (session != null) {
    session.lastAccess = System.currentTimeMillis();
  }
  return session;
}
origin: com.h2database/h2

@Override
public void listen() {
  this.listenerThread = Thread.currentThread();
  try {
    while (serverSocket != null) {
      Socket s = serverSocket.accept();
      WebThread c = new WebThread(s, this);
      running.add(c);
      c.start();
    }
  } catch (Exception e) {
    trace(e.toString());
  }
}
origin: com.h2database/h2

/**
 * Read the translation for this language and save them in the 'text'
 * property of this session.
 *
 * @param session the session
 * @param language the language
 */
void readTranslations(WebSession session, String language) {
  Properties text = new Properties();
  try {
    trace("translation: "+language);
    byte[] trans = getFile("_text_"+language+".prop");
    trace("  "+new String(trans));
    text = SortedProperties.fromLines(new String(trans, StandardCharsets.UTF_8));
    // remove starting # (if not translated yet)
    for (Entry<Object, Object> entry : text.entrySet()) {
      String value = (String) entry.getValue();
      if (value.startsWith("#")) {
        entry.setValue(value.substring(1));
      }
    }
  } catch (IOException e) {
    DbException.traceThrowable(e);
  }
  session.put("text", new HashMap<>(text));
}
origin: org.wowtools/h2

  private void trace(String s) {
    server.trace(s);
  }
}
origin: com.eventsourcing/h2

  private void trace(String s) {
    server.trace(s);
  }
}
origin: org.wowtools/h2

private void trace(String s) {
  server.trace(s);
}
origin: com.eventsourcing/h2

private void trace(String s) {
  server.trace(s);
}
origin: com.h2database/com.springsource.org.h2

byte[] getFile(String file) throws IOException {
  trace("getFile <" + file + ">");
  byte[] data = Resources.get("/org/h2/server/web/res/" + file);
  if (data == null) {
    trace(" null");
  } else {
    trace(" size=" + data.length);
  }
  return data;
}
origin: com.eventsourcing/h2

/**
 * Read the given file from the file system or from the resources.
 *
 * @param file the file name
 * @return the data
 */
byte[] getFile(String file) throws IOException {
  trace("getFile <" + file + ">");
  byte[] data = Utils.getResource("/org/h2/server/web/res/" + file);
  if (data == null) {
    trace(" null");
  } else {
    trace(" size=" + data.length);
  }
  return data;
}
origin: org.wowtools/h2

/**
 * Read the given file from the file system or from the resources.
 *
 * @param file the file name
 * @return the data
 */
byte[] getFile(String file) throws IOException {
  trace("getFile <" + file + ">");
  byte[] data = Utils.getResource("/org/h2/server/web/res/" + file);
  if (data == null) {
    trace(" null");
  } else {
    trace(" size=" + data.length);
  }
  return data;
}
origin: com.h2database/com.springsource.org.h2

public void listen() {
  this.listenerThread = Thread.currentThread();
  try {
    while (serverSocket != null) {
      Socket s = serverSocket.accept();
      WebThread c = new WebThread(s, this);
      running.add(c);
      c.start();
    }
  } catch (Exception e) {
    trace(e.toString());
  }
}
origin: org.wowtools/h2

@Override
public void listen() {
  this.listenerThread = Thread.currentThread();
  try {
    while (serverSocket != null) {
      Socket s = serverSocket.accept();
      WebThread c = new WebThread(s, this);
      running.add(c);
      c.start();
    }
  } catch (Exception e) {
    trace(e.toString());
  }
}
origin: com.eventsourcing/h2

@Override
public void listen() {
  this.listenerThread = Thread.currentThread();
  try {
    while (serverSocket != null) {
      Socket s = serverSocket.accept();
      WebThread c = new WebThread(s, this);
      running.add(c);
      c.start();
    }
  } catch (Exception e) {
    trace(e.toString());
  }
}
origin: com.h2database/com.springsource.org.h2

WebSession getSession(String sessionId) {
  long now = System.currentTimeMillis();
  if (lastTimeoutCheck + SESSION_TIMEOUT < now) {
    Object[] list = sessions.keySet().toArray();
    for (int i = 0; i < list.length; i++) {
      String id = (String) list[i];
      WebSession session = (WebSession) sessions.get(id);
      Long last = (Long) session.get("lastAccess");
      if (last != null && last.longValue() + SESSION_TIMEOUT < now) {
        trace("timeout for " + id);
        sessions.remove(id);
      }
    }
    lastTimeoutCheck = now;
  }
  WebSession session = (WebSession) sessions.get(sessionId);
  if (session != null) {
    session.lastAccess = System.currentTimeMillis();
  }
  return session;
}
origin: com.h2database/com.springsource.org.h2

public void readTranslations(WebSession session, String language) {
  Properties text = new Properties();
  try {
    trace("translation: "+language);
    byte[] trans = getFile("_text_"+language+".properties");
    trace("  "+new String(trans));
    text.load(new ByteArrayInputStream(trans));
    // remove starting # (if not translated yet)
    for (Iterator it = text.entrySet().iterator(); it.hasNext();) {
      Entry entry = (Entry) it.next();
      String value = (String) entry.getValue();
      if (value.startsWith("#")) {
        entry.setValue(value.substring(1));
      }
    }
  } catch (IOException e) {
    TraceSystem.traceThrowable(e);
  }
  session.put("text", new HashMap(text));
}
origin: com.h2database/com.springsource.org.h2

private String adminSave() {
  try {
    server.setPort(MathUtils.decodeInt((String) attributes.get("port")));
    server.setAllowOthers(Boolean.valueOf((String) attributes.get("allowOthers")).booleanValue());
    server.setSSL(Boolean.valueOf((String) attributes.get("ssl")).booleanValue());
    server.saveSettings();
  } catch (Exception e) {
    server.trace(e.toString());
  }
  return admin();
}
origin: com.h2database/com.springsource.org.h2

private String logout() {
  try {
    Connection conn = session.getConnection();
    session.setConnection(null);
    session.remove("conn");
    session.remove("result");
    session.remove("tables");
    session.remove("user");
    session.remove("tool");
    if (conn != null) {
      conn.close();
    }
  } catch (Exception e) {
    server.trace(e.toString());
  }
  return "index.do";
}
org.h2.server.webWebServertrace

Javadoc

Write trace information if trace is enabled.

Popular methods of WebServer

  • <init>
  • getSession
    Get the web session object for the given session id.
  • init
  • addSession
    Create a session with a given connection.
  • getAllowOthers
  • getFile
    Read the given file from the file system or from the resources.
  • getStartDateTime
  • setAllowChunked
  • setAllowOthers
  • createNewSession
    Create a new web session id and object.
  • generateSessionId
  • getConnection
  • generateSessionId,
  • getConnection,
  • getPort,
  • getSSL,
  • getSessions,
  • getSetting,
  • getSettingNames,
  • getSettings,
  • loadProperties,
  • readTranslations

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • requestLocationUpdates (LocationManager)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Path (java.nio.file)
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JTable (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now