Examples of GaeaContext


Examples of com.bj58.spat.gaea.server.contract.context.GaeaContext

   * @return
   */
  private String getLogMsg(String msg) {
    StringBuilder sbLog = new StringBuilder();
    sbLog.append(msg);
    GaeaContext context = GaeaContext.getFromThreadLocal();
    if(context != null) {
      sbLog.append("--");
      sbLog.append("remoteIP:");
      sbLog.append(context.getChannel().getRemoteIP());
      sbLog.append("--remotePort:");
      sbLog.append(context.getChannel().getRemotePort());
    }
   
    return sbLog.toString();
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.contract.context.GaeaContext

      public void messageReceived(Object obj) {
        if(context.getServerType() == ServerType.HTTP){
          httpThreadLocal.remove();
        }
        if(obj != null) {
          GaeaContext ctx = (GaeaContext)obj;
          ctx.getServerHandler().writeResponse(ctx);
        } else {
          logger.error("context is null!");
        }
      }
     
View Full Code Here

Examples of com.bj58.spat.gaea.server.contract.context.GaeaContext

      System.arraycopy(reciveByte, 0, headDelimiter, 0, 0);
     
      byte[] requestBuffer = new byte[reciveByte.length];
      System.arraycopy(reciveByte, 0, requestBuffer, 0, (reciveByte.length));
     
      GaeaContext gaeaContext = new GaeaContext(requestBuffer,
          new GaeaChannel(e.getChannel()),
          ServerType.TCP,
          this);
     
      SocketServer.invokerHandle.invoke(gaeaContext);
View Full Code Here

Examples of com.bj58.spat.gaea.server.contract.context.GaeaContext

  }

  @Override
  public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception {
    for(IFilter filter : Global.getSingleton().getConnectionFilterList()) {
      filter.filter(new GaeaContext(new GaeaChannel(e.getChannel())));
    }
  }
View Full Code Here

Examples of com.bj58.spat.gaea.server.contract.context.GaeaContext

        List<KeyValuePair> paraKVList = new ArrayList<KeyValuePair>();
        for(Parameter para : action.getParamList()) {
          paraKVList.add(new KeyValuePair(Util.getSimpleParaName(para.getType()), para.getValue()));
        }
       
        GaeaContext gaeaContext = new GaeaContext();
        gaeaContext.setServerType(ServerType.HTTP);
        gaeaContext.setServerHandler(this);
        gaeaContext.setChannel(new GaeaChannel(e.getChannel()));
      /**协议*/
      Protocol protocol = new Protocol();
      RequestProtocol request = new RequestProtocol();
      request.setLookup(action.getLookup());
      request.setMethodName(action.getMethodName());
      request.setParaKVList(paraKVList);
      protocol.setSdpEntity(request);
      gaeaContext.getGaeaRequest().setProtocol(protocol);
      /**HttpContext 上下文*/
      com.bj58.spat.gaea.server.contract.http.HttpContext httpcontext = new com.bj58.spat.gaea.server.contract.http.HttpContext();
      com.bj58.spat.gaea.server.contract.http.HttpRequest httpRequest = new com.bj58.spat.gaea.server.contract.http.HttpRequest();
      httpRequest.setContent(httpContext.getContentBuffer());
      httpRequest.setFromIP(httpContext.getFromIP());
      httpRequest.setToIP(httpContext.getToIP());
      httpRequest.setUri(httpContext.getUri());
      httpRequest.setHeaders_(httpContext.getHeaders());
      httpcontext.setRequest(httpRequest);
      gaeaContext.setHttpContext(httpcontext);
     
      HttpServer.invokerHandle.invoke(gaeaContext);
     
      } catch (Throwable ex) {
        logger.error("http request error!!!", ex);
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.