Examples of TunnelException


Examples of com.adito.tunnels.TunnelException

                            + (tunnel.getSourceInterface() == null || tunnel.getSourceInterface().equals("") ? "" : tunnel
                                            .getSourceInterface());
            remoteTunnel = tunnels.get(tunnelId);
            if (remoteTunnel != null) {
                if (remoteTunnel.getAgent() == agent) {
                    throw new TunnelException(TunnelException.REMOTE_TUNNEL_IN_USE, (Throwable)null, String.valueOf(tunnel.getSourcePort()));
                }
                throw new TunnelException(TunnelException.REMOTE_TUNNEL_LOCKED, (Throwable)null, String.valueOf(tunnel.getSourcePort()));
            }
            try {
                remoteTunnel = new RemoteTunnel(tunnel, agent, this, launchSession);
                agent.addListener(new RemoteTunnelListener(remoteTunnel));
                if (log.isInfoEnabled())
                    log.info("Adding remote tunnel with id of " + tunnelId);
                List<RemoteTunnel> sessionTunnels = tunnelsBySession.get(agent.getSession().getId());
                if (sessionTunnels == null) {
                    sessionTunnels = new ArrayList<RemoteTunnel>();
                    tunnelsBySession.put(agent.getSession().getId(), sessionTunnels);
                }
                sessionTunnels.add(remoteTunnel);
                tunnels.put(tunnelId, remoteTunnel);
            } catch (IOException e) {
                log.error("Failed to create new remote tunnel.", e);
                throw new TunnelException(TunnelException.PORT_ALREADY_IN_USE, (Throwable)null, String.valueOf(tunnel.getSourcePort()));
            }
        }
        return remoteTunnel;
    }
View Full Code Here

Examples of net.janino.util.TunnelException

            // Compile the compilation unit.
            ClassFile[] cfs;
            try {
                cfs = compilationUnitToCompile.compile(this.iClassLoader, this.debuggingInformation);
            } catch (Java.CompileException e) {
                throw new TunnelException(e);
            }

            // Now that the CU is compiled, remove it from the set of uncompiled CUs.
            this.uncompiledCompilationUnits.remove(compilationUnitToCompile);

            // Get the generated class file.
            for (int i = 0; i < cfs.length; ++i) {
                if (cfs[i].getThisClassName().equals(name)) {
                    if (cf != null) throw new RuntimeException(); // SNO: Multiple CFs with the same name.
                    cf = cfs[i];
                } else {
                    if (this.precompiledClasses.containsKey(cfs[i].getThisClassName())) throw new TunnelException(new Java.CompileException("Class or interface \"" + name + "\" is defined in more than one compilation unit", null));
                    this.precompiledClasses.put(cfs[i].getThisClassName(), cfs[i]);
                }
            }
            if (cf == null) throw new RuntimeException(); // SNO: Compilation of CU does not generate CF with requested name.
        }
View Full Code Here

Examples of net.janino.util.TunnelException

                    sourceFile.getPath(),                                     // fileName
                    new BufferedInputStream(new FileInputStream(sourceFile)), // inputStream
                    Compiler.this.optionalCharacterEncoding                   // optionalCharacterEncoding
                );
            } catch (IOException ex) {
                throw new TunnelException(ex);
            } catch (Parser.ParseException ex) {
                throw new TunnelException(ex);
            } catch (Scanner.ScanException ex) {
                throw new TunnelException(ex);
            }

            // Remember compilation unit for later compilation.
            Compiler.this.parsedCompilationUnits.add(cu);
View Full Code Here

Examples of net.janino.util.TunnelException

                InputStream is = null;
                ClassFile cf;
                try {
                    cf = new ClassFile(new BufferedInputStream(new FileInputStream(classFile)));
                } catch (IOException ex) {
                    throw new TunnelException(ex);
                } finally {
                    if (is != null) try { is.close(); } catch (IOException e) {}
                }
                ClassFileIClass result = new ClassFileIClass(
                    cf,                       // classFile
View Full Code Here

Examples of net.janino.util.TunnelException

            IClass res = cu.findClass(className);
            if (res == null) throw new Parser.ParseException("Source file \"" + sourceURL.getFile() + "\" does not declare class \"" + className + "\"", (Scanner.Location) null);
            this.defineIClass(res);
            return res;
        } catch (Scanner.ScanException e) {
            throw new TunnelException(e);
        } catch (Parser.ParseException e) {
            throw new TunnelException(e);
        } catch (IOException e) {
            throw new TunnelException(e);
        }
    }
View Full Code Here

Examples of org.cloudfoundry.caldecott.TunnelException

        }
      } catch (Exception e) {
        logger.error("Caught exception: "  + e.getClass().getName() + ": " + e.getMessage());
        logger.error("Closing tunnel " + this);
        stop();
        throw new TunnelException("Fatal exception during tunnel write", e);
      }
      if (!shutdown) {
        stop();
      }
      if (logger.isDebugEnabled()) {
View Full Code Here

Examples of org.cloudfoundry.caldecott.TunnelException

                logger.debug("Tunnel error - [" + hsce.getStatusCode().value() + "] " + hsce.getStatusText());
              }
            }
            else {
              logger.warn("Received HTTP Error: [" + hsce.getStatusCode().value() + "] " + hsce.getStatusText());
              throw new TunnelException("Error while reading from tunnel", hsce);
            }
          } catch (SocketTimeoutException e) {
            retry = true;
            if (logger.isTraceEnabled()) {
              logger.trace("Retrying tunnel read after receiving " + e.getClass().getName() + ": " + e.getMessage());
            }
          } catch (ResourceAccessException e) {
            Throwable t = e.getCause();
            if (t != null && t instanceof SocketTimeoutException) {
              retry = true;
              if (logger.isTraceEnabled()) {
                logger.trace("Retrying tunnel read after receiving " + e.getClass().getName() + ": " + e.getMessage());
              }
            } else {
              logger.error("Caught exception: "  + e.getClass().getName() + ": " + e.getMessage());
              logger.error("Closing tunnel " + this);
              stop();
              throw e;
            }
          } catch (RuntimeException e) {
            logger.error("Caught exception: "  + e.getClass().getName() + ": " + e.getMessage());
            logger.error("Closing tunnel " + this);
            stop();
            throw e;
          }
        }
      } catch (IOException ioe) {
        throw new TunnelException("Error while processing streams", ioe);
      }
      if (logger.isDebugEnabled()) {
        logger.debug("Completed reader thread for: " + this);
      }
    }
View Full Code Here

Examples of org.cloudfoundry.caldecott.TunnelException

      client.updateApplicationEnv(TUNNEL_APP_NAME,
          Collections.singletonMap("CALDECOTT_AUTH", UUID.randomUUID().toString()));
      client.startApplication(TUNNEL_APP_NAME);
      temp.delete();
    } catch (IOException e) {
      throw new TunnelException("Unable to deploy the Caldecott server application", e);
    }
  }
View Full Code Here

Examples of org.cloudfoundry.caldecott.TunnelException

      } catch (HttpClientErrorException e) {
        if (e.getStatusCode().equals(HttpStatus.NOT_FOUND)) {
          if (retries < 10) {
            retries++;
          } else {
            throw new TunnelException("Not able to locate tunnel server at: " + uriToUse, e);
          }
        } else {
          throw new TunnelException("Error accessing tunnel server at: " + uriToUse, e);
        }
      } catch (ResourceAccessException e) {
        if (e.getMessage().contains("refused") || e.getMessage().contains("unable")) {
          i++;
        }
View Full Code Here

Examples of org.cloudfoundry.caldecott.TunnelException

  public SocketClient(Socket socket) {
    this.socket = socket;
    try {
      this.socket.setSoTimeout(SOCKET_TIMEOUT);
    } catch (SocketException e) {
      throw new TunnelException("Unable to set timeout on socket " + e.getMessage());
    }
  }
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.