org.simpleframework.http.Request.getAttribute()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.simpleframework.http.Request.getAttribute方法的一些代码示例,展示了Request.getAttribute的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.getAttribute方法的具体详情如下:
包路径:org.simpleframework.http.Request
类名称:Request
方法名:getAttribute

Request.getAttribute介绍

[英]This is used as a shortcut for acquiring attributes for the response. This avoids acquiring the attribute Map in order to retrieve the attribute directly from that object. The attributes contain data specific to the response.
[中]这是获取响应属性的快捷方式。这避免了为了直接从该对象检索属性而获取属性Map。这些属性包含特定于响应的数据。

代码示例

代码示例来源:origin: org.restlet/org.restlet.ext.simple

/**
 * Returns the request socket.
 * 
 * @return The request socket.
 */
private SocketChannel getSocket() {
  return (SocketChannel) this.request
      .getAttribute(SimpleServer.PROPERTY_SOCKET);
}

代码示例来源:origin: org.restlet/org.restlet.ext.simple

/**
 * Returns the SSL engine.
 * 
 * @return the SSL engine
 */
private SSLEngine getSslEngine() {
  return (SSLEngine) this.request
      .getAttribute(SimpleServer.PROPERTY_ENGINE);
}

代码示例来源:origin: org.simpleframework/simple-http

/**
* This is used as a shortcut for acquiring attributes for the
* response. This avoids acquiring the attribute <code>Map</code>
* in order to retrieve the attribute directly from that object.
* The attributes contain data specific to the response.
* 
* @param key this is the key of the attribute to acquire
* 
* @return this returns the attribute for the specified name
*/ 
public Object getAttribute(Object key) {
 return request.getAttribute(key);
}

代码示例来源:origin: org.simpleframework/simple

/**
* This is used as a shortcut for acquiring attributes for the
* response. This avoids acquiring the attribute <code>Map</code>
* in order to retrieve the attribute directly from that object.
* The attributes contain data specific to the response.
* 
* @param key this is the key of the attribute to acquire
* 
* @return this returns the attribute for the specified name
*/ 
public Object getAttribute(Object key) {
 return request.getAttribute(key);
}

代码示例来源:origin: ngallagher/simpleframework

/**
* This is used as a shortcut for acquiring attributes for the
* response. This avoids acquiring the attribute <code>Map</code>
* in order to retrieve the attribute directly from that object.
* The attributes contain data specific to the response.
* 
* @param key this is the key of the attribute to acquire
* 
* @return this returns the attribute for the specified name
*/ 
public Object getAttribute(Object key) {
 return request.getAttribute(key);
}

代码示例来源:origin: lantunes/fixd

private boolean subscriberClientStillConnected() {
  
  try {
    subscriberConnectedReadBuffer.clear();
    int read =((SocketChannel)subscriberRequest.getAttribute("fixd-socket"))
        .read(subscriberConnectedReadBuffer);
    if (read == -1) return false;
  } catch (IOException e) {
    return false;
  }
  return true;
}

相关文章