@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; } }
/** * 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; } }