Java Code Examples for com.alibaba.dubbo.remoting.exchange.Request#getData()

The following examples show how to use com.alibaba.dubbo.remoting.exchange.Request#getData() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThriftNativeCodec.java    From dubbox with Apache License 2.0 6 votes vote down vote up
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request)
    throws IOException {
    Invocation invocation = (Invocation) request.getData();
    TProtocol protocol = newProtocol(channel.getUrl(), buffer);
    try {
        protocol.writeMessageBegin(new TMessage(
            invocation.getMethodName(), TMessageType.CALL, 
            thriftSeq.getAndIncrement()));
        protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args"));
        for(int i = 0; i < invocation.getParameterTypes().length; i++) {
            Class<?> type = invocation.getParameterTypes()[i];

        }
    } catch (TException e) {
        throw new IOException(e.getMessage(), e);
    }

}
 
Example 2
Source File: ThriftNativeCodec.java    From dubbox with Apache License 2.0 6 votes vote down vote up
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request)
    throws IOException {
    Invocation invocation = (Invocation) request.getData();
    TProtocol protocol = newProtocol(channel.getUrl(), buffer);
    try {
        protocol.writeMessageBegin(new TMessage(
            invocation.getMethodName(), TMessageType.CALL, 
            thriftSeq.getAndIncrement()));
        protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args"));
        for(int i = 0; i < invocation.getParameterTypes().length; i++) {
            Class<?> type = invocation.getParameterTypes()[i];

        }
    } catch (TException e) {
        throw new IOException(e.getMessage(), e);
    }

}
 
Example 3
Source File: ThriftNativeCodec.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request)
        throws IOException {
    Invocation invocation = (Invocation) request.getData();
    TProtocol protocol = newProtocol(channel.getUrl(), buffer);
    try {
        protocol.writeMessageBegin(new TMessage(
                invocation.getMethodName(), TMessageType.CALL,
                thriftSeq.getAndIncrement()));
        protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args"));
        for (int i = 0; i < invocation.getParameterTypes().length; i++) {
            Class<?> type = invocation.getParameterTypes()[i];

        }
    } catch (TException e) {
        throw new IOException(e.getMessage(), e);
    }

}
 
Example 4
Source File: ThriftNativeCodec.java    From dubbox with Apache License 2.0 6 votes vote down vote up
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request)
    throws IOException {
    Invocation invocation = (Invocation) request.getData();
    TProtocol protocol = newProtocol(channel.getUrl(), buffer);
    try {
        protocol.writeMessageBegin(new TMessage(
            invocation.getMethodName(), TMessageType.CALL, 
            thriftSeq.getAndIncrement()));
        protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args"));
        for(int i = 0; i < invocation.getParameterTypes().length; i++) {
            Class<?> type = invocation.getParameterTypes()[i];

        }
    } catch (TException e) {
        throw new IOException(e.getMessage(), e);
    }

}
 
Example 5
Source File: ThriftNativeCodec.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request)
    throws IOException {
    Invocation invocation = (Invocation) request.getData();
    TProtocol protocol = newProtocol(channel.getUrl(), buffer);
    try {
        protocol.writeMessageBegin(new TMessage(
            invocation.getMethodName(), TMessageType.CALL, 
            thriftSeq.getAndIncrement()));
        protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args"));
        for(int i = 0; i < invocation.getParameterTypes().length; i++) {
            Class<?> type = invocation.getParameterTypes()[i];

        }
    } catch (TException e) {
        throw new IOException(e.getMessage(), e);
    }

}
 
Example 6
Source File: ExchangeCodec.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 7
Source File: DeprecatedExchangeCodec.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 8
Source File: ExchangeCodec.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 9
Source File: DeprecatedExchangeCodec.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 10
Source File: ExchangeCodec.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 11
Source File: DeprecatedExchangeCodec.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 12
Source File: ExchangeCodec.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 13
Source File: DeprecatedExchangeCodec.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 14
Source File: ExchangeCodec.java    From dubbox with Apache License 2.0 5 votes vote down vote up
protected Object getRequestData(long id) {
    DefaultFuture future = DefaultFuture.getFuture(id);
    if (future == null)
        return null;
    Request req = future.getRequest();
    if (req == null)
        return null;
    return req.getData();
}
 
Example 15
Source File: HeaderExchangeHandler.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
void handlerEvent(Channel channel, Request req) throws RemotingException {
    if (req.getData() != null && req.getData().equals(Request.READONLY_EVENT)) {
        channel.setAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY, Boolean.TRUE);
    }
}
 
Example 16
Source File: HeaderExchangeHandler.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
void handlerEvent(Channel channel, Request req) throws RemotingException {
    if (req.getData() != null && req.getData().equals(Request.READONLY_EVENT)) {
        channel.setAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY, Boolean.TRUE);
    }
}
 
Example 17
Source File: HeaderExchangeHandler.java    From dubbox with Apache License 2.0 4 votes vote down vote up
void handlerEvent(Channel channel, Request req) throws RemotingException {
    if (req.getData() != null && req.getData().equals(Request.READONLY_EVENT)) {
        channel.setAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY, Boolean.TRUE);
    }
}
 
Example 18
Source File: HeaderExchangeHandler.java    From dubbox with Apache License 2.0 4 votes vote down vote up
void handlerEvent(Channel channel, Request req) throws RemotingException {
    if (req.getData() != null && req.getData().equals(Request.READONLY_EVENT)) {
        channel.setAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY, Boolean.TRUE);
    }
}
 
Example 19
Source File: HeaderExchangeHandler.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
void handlerEvent(Channel channel, Request req) throws RemotingException {
//        设置只读事件,这里是服务优雅停机的处理逻辑会设置为只读
        if (req.getData() != null && req.getData().equals(Request.READONLY_EVENT)) {
            channel.setAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY, Boolean.TRUE);
        }
    }
 
Example 20
Source File: HeaderExchangeHandler.java    From dubbox with Apache License 2.0 4 votes vote down vote up
void handlerEvent(Channel channel, Request req) throws RemotingException {
    if (req.getData() != null && req.getData().equals(Request.READONLY_EVENT)) {
        channel.setAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY, Boolean.TRUE);
    }
}