Java Code Examples for com.alibaba.dubbo.remoting.exchange.Request#setEvent()
The following examples show how to use
com.alibaba.dubbo.remoting.exchange.Request#setEvent() .
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: HeaderExchangeServer.java From dubbo-2.6.5 with Apache License 2.0 | 6 votes |
private void sendChannelReadOnlyEvent() { Request request = new Request(); request.setEvent(Request.READONLY_EVENT); request.setTwoWay(false); request.setVersion(Version.getProtocolVersion()); Collection<Channel> channels = getChannels(); for (Channel channel : channels) { try { if (channel.isConnected()) channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true)); } catch (RemotingException e) { logger.warn("send cannot write message error.", e); } } }
Example 2
Source File: HeaderExchangeHandlerTest.java From dubbo-2.6.5 with Apache License 2.0 | 5 votes |
@Test public void test_received_request_event_readonly() throws RemotingException { final Request request = new Request(); request.setTwoWay(true); request.setEvent(Request.READONLY_EVENT); final Channel mchannel = new MockedChannel(); HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler()); hexhandler.received(mchannel, request); Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)); }
Example 3
Source File: HeaderExchangeServer.java From dubbox with Apache License 2.0 | 5 votes |
private void sendChannelReadOnlyEvent(){ Request request = new Request(); request.setEvent(Request.READONLY_EVENT); request.setTwoWay(false); request.setVersion(Version.getVersion()); Collection<Channel> channels = getChannels(); for (Channel channel : channels) { try { if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true)); } catch (RemotingException e) { logger.warn("send connot write messge error.", e); } } }
Example 4
Source File: HeaderExchangeHandlerTest.java From dubbox with Apache License 2.0 | 5 votes |
@Test public void test_received_request_event_readonly() throws RemotingException{ final Request request = new Request(); request.setTwoWay(true); request.setEvent(Request.READONLY_EVENT); final Channel mchannel = new MockedChannel(); HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler()); hexhandler.received(mchannel, request); Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)); }
Example 5
Source File: HeaderExchangeServer.java From dubbox-hystrix with Apache License 2.0 | 5 votes |
private void sendChannelReadOnlyEvent(){ Request request = new Request(); request.setEvent(Request.READONLY_EVENT); request.setTwoWay(false); request.setVersion(Version.getVersion()); Collection<Channel> channels = getChannels(); for (Channel channel : channels) { try { if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true)); } catch (RemotingException e) { logger.warn("send connot write messge error.", e); } } }
Example 6
Source File: HeaderExchangeHandlerTest.java From dubbox-hystrix with Apache License 2.0 | 5 votes |
@Test public void test_received_request_event_readonly() throws RemotingException{ final Request request = new Request(); request.setTwoWay(true); request.setEvent(Request.READONLY_EVENT); final Channel mchannel = new MockedChannel(); HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler()); hexhandler.received(mchannel, request); Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)); }
Example 7
Source File: HeaderExchangeServer.java From dubbo3 with Apache License 2.0 | 5 votes |
private void sendChannelReadOnlyEvent(){ Request request = new Request(); request.setEvent(Request.READONLY_EVENT); request.setTwoWay(false); request.setVersion(Version.getVersion()); Collection<Channel> channels = getChannels(); for (Channel channel : channels) { try { if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true)); } catch (RemotingException e) { logger.warn("send connot write messge error.", e); } } }
Example 8
Source File: HeaderExchangeHandlerTest.java From dubbo3 with Apache License 2.0 | 5 votes |
@Test public void test_received_request_event_readonly() throws RemotingException{ final Request request = new Request(); request.setTwoWay(true); request.setEvent(Request.READONLY_EVENT); final Channel mchannel = new MockedChannel(); HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler()); hexhandler.received(mchannel, request); Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)); }
Example 9
Source File: HeaderExchangeServer.java From dubbox with Apache License 2.0 | 5 votes |
private void sendChannelReadOnlyEvent(){ Request request = new Request(); request.setEvent(Request.READONLY_EVENT); request.setTwoWay(false); request.setVersion(Version.getVersion()); Collection<Channel> channels = getChannels(); for (Channel channel : channels) { try { if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true)); } catch (RemotingException e) { logger.warn("send connot write messge error.", e); } } }
Example 10
Source File: HeaderExchangeHandlerTest.java From dubbox with Apache License 2.0 | 5 votes |
@Test public void test_received_request_event_readonly() throws RemotingException{ final Request request = new Request(); request.setTwoWay(true); request.setEvent(Request.READONLY_EVENT); final Channel mchannel = new MockedChannel(); HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler()); hexhandler.received(mchannel, request); Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)); }
Example 11
Source File: HeaderExchangeServer.java From dubbox with Apache License 2.0 | 5 votes |
private void sendChannelReadOnlyEvent(){ Request request = new Request(); request.setEvent(Request.READONLY_EVENT); request.setTwoWay(false); request.setVersion(Version.getVersion()); Collection<Channel> channels = getChannels(); for (Channel channel : channels) { try { if (channel.isConnected())channel.send(request, getUrl().getParameter(Constants.CHANNEL_READONLYEVENT_SENT_KEY, true)); } catch (RemotingException e) { logger.warn("send connot write messge error.", e); } } }
Example 12
Source File: HeaderExchangeHandlerTest.java From dubbox with Apache License 2.0 | 5 votes |
@Test public void test_received_request_event_readonly() throws RemotingException{ final Request request = new Request(); request.setTwoWay(true); request.setEvent(Request.READONLY_EVENT); final Channel mchannel = new MockedChannel(); HeaderExchangeHandler hexhandler = new HeaderExchangeHandler(new MockedExchangeHandler()); hexhandler.received(mchannel, request); Assert.assertTrue(mchannel.hasAttribute(Constants.CHANNEL_ATTRIBUTE_READONLY_KEY)); }