@Override public void removeAttribute(String key) { channel.removeAttribute(key); }
@Override public void removeAttribute(String key) { channel.removeAttribute(key); }
@Override public void removeAttribute(String key) { channel.removeAttribute(key); }
@Override public void removeAttribute(String key) { channel.removeAttribute(key); }
private void clearWriteTimestamp(Channel channel) { channel.removeAttribute(KEY_WRITE_TIMESTAMP); }
@Override public void removeAttribute(String key) { channel.removeAttribute(key); }
@Override public void removeAttribute(String key) { channel.removeAttribute(key); }
private void clearReadTimestamp(Channel channel) { channel.removeAttribute(KEY_READ_TIMESTAMP); }
private void clearReadTimestamp(Channel channel) { channel.removeAttribute(KEY_READ_TIMESTAMP); }
private void clearWriteTimestamp(Channel channel) { channel.removeAttribute(KEY_WRITE_TIMESTAMP); }
public static void removeTracer(Class<?> type, String method, Channel channel) { channel.removeAttribute(TRACE_MAX); channel.removeAttribute(TRACE_COUNT); String key = method != null && method.length() > 0 ? type.getName() + "." + method : type.getName(); Set<Channel> channels = tracers.get(key); if (channels != null) { channels.remove(channel); } }
public static void removeTracer(Class<?> type, String method, Channel channel) { channel.removeAttribute(TRACE_MAX); channel.removeAttribute(TRACE_COUNT); String key = method != null && method.length() > 0 ? type.getName() + "." + method : type.getName(); Set<Channel> channels = tracers.get(key); if (channels != null) { channels.remove(channel); } }
static void removeChannelIfDisconnected(Channel ch) { if (ch != null && !ch.isConnected()) { ch.removeAttribute(CHANNEL_KEY); } }
private boolean isInvokedSelectCommand(Channel channel) { if (channel.hasAttribute(SelectTelnetHandler.SELECT_KEY)) { channel.removeAttribute(SelectTelnetHandler.SELECT_KEY); return true; } return false; } }
@Override public void removeAttribute(String key) { Channel channel = getChannel(); if (channel == null) { return; } channel.removeAttribute(key); }
private boolean isInvokedSelectCommand(Channel channel) { if (channel.hasAttribute(SelectTelnetHandler.SELECT_KEY)) { channel.removeAttribute(SelectTelnetHandler.SELECT_KEY); return true; } return false; } }
static void removeChannelIfDisconnected(Channel ch) { if (ch != null && !ch.isConnected()) { ch.removeAttribute(CHANNEL_KEY); } }
@Override public void removeAttribute(String key) { Channel channel = getChannel(); if (channel == null) { return; } channel.removeAttribute(key); }
@Override public String telnet(Channel channel, String message) { if (message == null || message.length() == 0) { return "Please input service name, eg: \r\ncd XxxService\r\ncd com.xxx.XxxService"; } StringBuilder buf = new StringBuilder(); if (message.equals("/") || message.equals("..")) { String service = (String) channel.getAttribute(SERVICE_KEY); channel.removeAttribute(SERVICE_KEY); buf.append("Cancelled default service " + service + "."); } else { boolean found = false; for (Exporter<?> exporter : DubboProtocol.getDubboProtocol().getExporters()) { if (message.equals(exporter.getInvoker().getInterface().getSimpleName()) || message.equals(exporter.getInvoker().getInterface().getName()) || message.equals(exporter.getInvoker().getUrl().getPath())) { found = true; break; } } if (found) { channel.setAttribute(SERVICE_KEY, message); buf.append("Used the " + message + " as default.\r\nYou can cancel default service by command: cd /"); } else { buf.append("No such service " + message); } } return buf.toString(); }
@Override public String telnet(Channel channel, String message) { if (message == null || message.length() == 0) { return "Please input service name, eg: \r\ncd XxxService\r\ncd com.xxx.XxxService"; } StringBuilder buf = new StringBuilder(); if (message.equals("/") || message.equals("..")) { String service = (String) channel.getAttribute(SERVICE_KEY); channel.removeAttribute(SERVICE_KEY); buf.append("Cancelled default service " + service + "."); } else { boolean found = false; for (Exporter<?> exporter : DubboProtocol.getDubboProtocol().getExporters()) { if (message.equals(exporter.getInvoker().getInterface().getSimpleName()) || message.equals(exporter.getInvoker().getInterface().getName()) || message.equals(exporter.getInvoker().getUrl().getPath())) { found = true; break; } } if (found) { channel.setAttribute(SERVICE_KEY, message); buf.append("Used the " + message + " as default.\r\nYou can cancel default service by command: cd /"); } else { buf.append("No such service " + message); } } return buf.toString(); }