Examples of XTraceException


Examples of edu.berkeley.xtrace.XTraceException

  @SuppressWarnings("serial")
  public synchronized void initialize() throws XTraceException {
    // Directory to store reports into
    dataDirName = System.getProperty("xtrace.server.storedirectory");
    if (dataDirName == null) {
      throw new XTraceException(
          "FileTreeReportStore selected, but no xtrace.server.storedirectory specified");
    }
    dataRootDir = new File(dataDirName);

    if (!dataRootDir.isDirectory()) {
      throw new XTraceException("Data Store location isn't a directory: "
          + dataDirName);
    }
    if (!dataRootDir.canWrite()) {
      throw new XTraceException("Can't write to data store directory");
    }

    // 25-element LRU file handle cache. The report data is stored here
    fileCache = new LRUFileHandleCache(25, dataRootDir);
View Full Code Here

Examples of edu.berkeley.xtrace.XTraceException

    // This embedded SQL database contains metadata about the reports
    System.setProperty("derby.system.home", dataDirName);
    try {
      Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
    } catch (InstantiationException e) {
      throw new XTraceException(
          "Unable to instantiate internal database", e);
    } catch (IllegalAccessException e) {
      throw new XTraceException(
          "Unable to access internal database class", e);
    } catch (ClassNotFoundException e) {
      throw new XTraceException(
          "Unable to locate internal database class", e);
    }
    try {
      try {
        // Connect to existing DB
        conn = DriverManager.getConnection("jdbc:derby:tasks");
      } catch (SQLException e) {
        // DB does not exist - create it
        conn = DriverManager
            .getConnection("jdbc:derby:tasks;create=true");
        createTables();
        conn.commit();
      }
      conn.setAutoCommit(false);
    } catch (SQLException e) {
      throw new XTraceException("Unable to connect to interal database: "
          + e.getSQLState(), e);
    }
    LOG.info("Successfully connected to the internal Derby database");

    try {
      createPreparedStatements();
    } catch (SQLException e) {
      throw new XTraceException("Unable to setup prepared statements", e);
    }
    databaseInitialized = true;
  }
View Full Code Here

Examples of edu.berkeley.xtrace.XTraceException

   
    InetAddress localAddr;
    try {
      localAddr = InetAddress.getByName(udpSource.split(":")[0]);
    } catch (UnknownHostException e) {
      throw new XTraceException("Unknown host: " + udpSource.split(":")[0], e);
    }
    int localPort = Integer.parseInt(udpSource.split(":")[1]);
    try {
      socket = new DatagramSocket(localPort, localAddr);
    } catch (SocketException e) {
      throw new XTraceException("Unable to open socket", e);
    }

    LOG.info("UDPReportSource initialized on " + localAddr + ":" + localPort);
  }
View Full Code Here

Examples of edu.berkeley.xtrace.XTraceException

      XTraceReporter.Processor processor = new XTraceReporter.Processor(handler);
     
    try {
      serverTransport = new TServerSocket(thriftport);
    } catch (TTransportException e) {
      throw new XTraceException("Unable to open Thrift server", e);
    }
      server = new TThreadPoolServer(processor, serverTransport);
  }
View Full Code Here

Examples of edu.berkeley.xtrace.XTraceException

      serverChannel = ServerSocketChannel.open();
      serverChannel.configureBlocking(false);
      serverChannel.socket().bind(new InetSocketAddress("0.0.0.0", tcpport));
      serverChannel.register(selector, SelectionKey.OP_ACCEPT);
    } catch (IOException e) {
      throw new XTraceException("Unable to open TCP server socket", e);
    }
  }
View Full Code Here

Examples of edu.berkeley.xtrace.XTraceException

    }
   
    try {
      serversock = new ServerSocket(tcpport);
    } catch (IOException e) {
      throw new XTraceException("Unable to open TCP server socket", e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.