@Override public HessianConnection open(URL url) throws IOException { HessianConnection connection = super.open(url); RpcContext context = RpcContext.getContext(); for (String key : context.getAttachments().keySet()) { connection.addHeader(Constants.DEFAULT_EXCHANGER + key, context.getAttachment(key)); } return connection; } }
os = conn.getOutputStream(); } catch (Exception e) { throw new HessianRuntimeException(e); out.flush(); conn.sendRequest(); } finally { if (!isValid && conn != null) conn.destroy();
protected InputStream getInputStream(HessianConnection conn) throws IOException { InputStream is = conn.getInputStream(); if ("deflate".equals(conn.getContentEncoding())) { is = new InflaterInputStream(is, new Inflater(true)); } return is; }
conn.close();
conn.destroy(); } catch (Exception e) { log.log(Level.FINE, e.toString(), e);
os = conn.getOutputStream(); } catch (Exception e) { throw new HessianRuntimeException(e); out.flush(); conn.sendRequest(); } finally { if (! isValid && conn != null) conn.destroy();
protected InputStream getInputStream(HessianConnection conn) throws IOException { InputStream is = conn.getInputStream(); if ("deflate".equals(conn.getContentEncoding())) { is = new InflaterInputStream(is, new Inflater(true)); } return is; }
conn.destroy(); } catch (Exception e) { log.log(Level.FINE, e.toString(), e);
@Override public HessianConnection open(URL url) throws IOException { HessianConnection connection = super.open(url); RpcContext context = RpcContext.getContext(); for (String key : context.getAttachments().keySet()) { connection.addHeader(Constants.DEFAULT_EXCHANGER + key, context.getAttachment(key)); } return connection; } }
/** * Method that allows subclasses to add request headers such as cookies. * Default implementation is empty. */ protected void addRequestHeaders(HessianConnection conn) { conn.addHeader("Content-Type", "x-application/hessian"); conn.addHeader("Accept-Encoding", "deflate"); String basicAuth = _factory.getBasicAuth(); if (basicAuth != null) conn.addHeader("Authorization", basicAuth); }
/** * Method that allows subclasses to add request headers such as cookies. * Default implementation is empty. */ protected void addRequestHeaders(HessianConnection conn) { conn.addHeader("Content-Type", "x-application/hessian"); conn.addHeader("Accept-Encoding", "deflate"); String basicAuth = _factory.getBasicAuth(); if (basicAuth != null) conn.addHeader("Authorization", basicAuth); }
@Override public HessianConnection open(URL url) throws IOException { HessianConnection connection = super.open(url); String interfaze = HessianUrlUtil.extractInterface(url.toString()); ReferenceConfig referenceConfig = referenceConfigMap.get(interfaze); String secretKey = referenceConfig.getSecretKey(); int version = referenceConfig.getVersion(); connection.addHeader(ThunderConstant.INTERFACE_ATTRIBUTE_NAME, interfaze); connection.addHeader(ThunderConstant.SECRET_KEY_ATTRIBUTE_NAME, secretKey); connection.addHeader(ThunderConstant.VERSION_ATTRIBUTE_NAME, String.valueOf(version)); return connection; } };
@Override public HessianConnection open(URL url) throws IOException { HessianConnection connection = super.open(url); RpcContext context = RpcContext.getContext(); for (String key : context.getAttachments().keySet()) { connection.addHeader(Constants.DEFAULT_EXCHANGER + key, context.getAttachment(key)); } return connection; } }
@Override public HessianConnection open(URL url) throws IOException { HessianConnection connection = super.open(url); RpcContext context = RpcContext.getContext(); for (String key : context.getAttachments().keySet()) { connection.addHeader(Constants.DEFAULT_EXCHANGER + key, context.getAttachment(key)); } return connection; } }
@Override public HessianConnection open(URL url) throws IOException { HessianConnection connection = super.open(url); RpcContext context = RpcContext.getContext(); for (String key : context.getAttachments().keySet()) { connection.addHeader(Constants.DEFAULT_EXCHANGER + key, context.getAttachment(key)); } return connection; } }