diff --git a/README b/README index 2f9152b04d28..a30818206994 100644 --- a/README +++ b/README @@ -1,10 +1,3 @@ -由于开源站点因为安全问题被下掉,如果编译时出现找不到opensesame依赖情况的,请先手动下载https://github.com/alibaba/opensesame -本地install,这几天我们会把opensesame发到mavan中央仓库。 - -临时文档地址:http://alibaba.github.io/dubbo-doc-static/Developer+Guide-zh.htm - -================================================================ - Dubbo is a distributed service framework enpowers applications with service import/export capability with high performance RPC. It's composed of three kernel parts: @@ -17,7 +10,7 @@ Registry: a service directory framework for service registration and service eve For more, please refer to: - http://code.alibabatech.com/wiki/display/dubbo + http://dubbo.io ================================================================ Quick Start @@ -50,7 +43,7 @@ Source Building wget http://www.apache.org/dist//maven/binaries/apache-maven-2.2.1-bin.tar.gz tar zxvf apache-maven-2.2.1-bin.tar.gz vi .bash_profile - - edit: export PATH=$PATH:~/apache-maven-2.2.1/bin + - append: export PATH=$PATH:~/apache-maven-2.2.1/bin source .bash_profile 1. Checkout the dubbo source code: @@ -58,8 +51,8 @@ Source Building cd ~ git clone https://github.com/alibaba/dubbo.git dubbo - git checkout -b dubbo-2.4.0 git checkout master + or: git checkout -b dubbo-2.4.0 2. Import the dubbo source code to eclipse project: diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/extension/ExtensionLoader.java b/dubbo-common/src/main/java/com/alibaba/dubbo/common/extension/ExtensionLoader.java index 89080bf64fca..982ab819eba5 100644 --- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/extension/ExtensionLoader.java +++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/extension/ExtensionLoader.java @@ -931,7 +931,7 @@ private String createAdaptiveExtensionClassCode() { if (i > 0) { codeBuidler.append(", "); } - codeBuidler.append(pts[i].getCanonicalName()); + codeBuidler.append(ets[i].getCanonicalName()); } } codeBuidler.append(" {"); diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java index ccd6aa7b9653..da886593950e 100644 --- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java +++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/utils/ReflectUtils.java @@ -784,9 +784,9 @@ private static Class[] desc2classArray(ClassLoader cl, String desc) throws Cl */ public static Method findMethodByMethodSignature(Class clazz, String methodName, String[] parameterTypes) throws NoSuchMethodException, ClassNotFoundException { - String signature = methodName; + String signature = clazz.getName() + "." + methodName; if(parameterTypes != null && parameterTypes.length > 0){ - signature = methodName + StringUtils.join(parameterTypes); + signature += StringUtils.join(parameterTypes); } Method method = Signature_METHODS_CACHE.get(signature); if(method != null){ diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/ByteBufferBackedChannelBuffer.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/ByteBufferBackedChannelBuffer.java index f571606cbfe6..b84ac00455d5 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/ByteBufferBackedChannelBuffer.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/ByteBufferBackedChannelBuffer.java @@ -20,7 +20,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; -import java.nio.ByteOrder; /** * @author kimi @@ -41,7 +40,7 @@ public ByteBufferBackedChannelBuffer(ByteBuffer buffer) { writerIndex(capacity); } - private ByteBufferBackedChannelBuffer(ByteBufferBackedChannelBuffer buffer) { + public ByteBufferBackedChannelBuffer(ByteBufferBackedChannelBuffer buffer) { this.buffer = buffer.buffer; capacity = buffer.capacity; setIndex(buffer.readerIndex(), buffer.writerIndex()); @@ -55,12 +54,12 @@ public ChannelBufferFactory factory() { } } - @Override + public int capacity() { return capacity; } - @Override + public ChannelBuffer copy(int index, int length) { ByteBuffer src; try { @@ -77,12 +76,12 @@ public ChannelBuffer copy(int index, int length) { return new ByteBufferBackedChannelBuffer(dst); } - @Override + public byte getByte(int index) { return buffer.get(index); } - @Override + public void getBytes(int index, byte[] dst, int dstIndex, int length) { ByteBuffer data = buffer.duplicate(); try { @@ -93,7 +92,7 @@ public void getBytes(int index, byte[] dst, int dstIndex, int length) { data.get(dst, dstIndex, length); } - @Override + public void getBytes(int index, ByteBuffer dst) { ByteBuffer data = buffer.duplicate(); int bytesToCopy = Math.min(capacity() - index, dst.remaining()); @@ -105,7 +104,7 @@ public void getBytes(int index, ByteBuffer dst) { dst.put(data); } - @Override + public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) { if (dst instanceof ByteBufferBackedChannelBuffer) { ByteBufferBackedChannelBuffer bbdst = (ByteBufferBackedChannelBuffer) dst; @@ -120,7 +119,7 @@ public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) { } } - @Override + public void getBytes(int index, OutputStream out, int length) throws IOException { if (length == 0) { return; @@ -138,31 +137,31 @@ public void getBytes(int index, OutputStream out, int length) throws IOException } } - @Override + public boolean isDirect() { return buffer.isDirect(); } - @Override + public void setByte(int index, int value) { buffer.put(index, (byte) value); } - @Override + public void setBytes(int index, byte[] src, int srcIndex, int length) { ByteBuffer data = buffer.duplicate(); data.limit(index + length).position(index); data.put(src, srcIndex, length); } - @Override + public void setBytes(int index, ByteBuffer src) { ByteBuffer data = buffer.duplicate(); data.limit(index + src.remaining()).position(index); data.put(src); } - @Override + public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) { if (src instanceof ByteBufferBackedChannelBuffer) { ByteBufferBackedChannelBuffer bbsrc = (ByteBufferBackedChannelBuffer) src; @@ -177,7 +176,7 @@ public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) { } } - @Override + public ByteBuffer toByteBuffer(int index, int length) { if (index == 0 && length == capacity()) { return buffer.duplicate(); @@ -187,7 +186,7 @@ public ByteBuffer toByteBuffer(int index, int length) { } } - @Override + public int setBytes(int index, InputStream in, int length) throws IOException { int readBytes = 0; @@ -227,17 +226,17 @@ public int setBytes(int index, InputStream in, int length) throws IOException { return readBytes; } - @Override + public byte[] array() { return buffer.array(); } - @Override + public boolean hasArray() { return buffer.hasArray(); } - @Override + public int arrayOffset() { return buffer.arrayOffset(); } diff --git a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/DynamicChannelBuffer.java b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/DynamicChannelBuffer.java index 9c0220153f23..5bde27955bd5 100644 --- a/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/DynamicChannelBuffer.java +++ b/dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/buffer/DynamicChannelBuffer.java @@ -20,7 +20,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteBuffer; -import java.nio.ByteOrder; /** * @author kimi @@ -68,12 +67,12 @@ public void ensureWritableBytes(int minWritableBytes) { buffer = newBuffer; } - @Override + public int capacity() { return buffer.capacity(); } - @Override + public ChannelBuffer copy(int index, int length) { DynamicChannelBuffer copiedBuffer = new DynamicChannelBuffer(Math.max(length, 64), factory()); copiedBuffer.buffer = buffer.copy(index, length); @@ -81,67 +80,67 @@ public ChannelBuffer copy(int index, int length) { return copiedBuffer; } - @Override + public ChannelBufferFactory factory() { return factory; } - @Override + public byte getByte(int index) { return buffer.getByte(index); } - @Override + public void getBytes(int index, byte[] dst, int dstIndex, int length) { buffer.getBytes(index, dst, dstIndex, length); } - @Override + public void getBytes(int index, ByteBuffer dst) { buffer.getBytes(index, dst); } - @Override + public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) { buffer.getBytes(index, dst, dstIndex, length); } - @Override + public void getBytes(int index, OutputStream dst, int length) throws IOException { buffer.getBytes(index, dst, length); } - @Override + public boolean isDirect() { return buffer.isDirect(); } - @Override + public void setByte(int index, int value) { buffer.setByte(index, value); } - @Override + public void setBytes(int index, byte[] src, int srcIndex, int length) { buffer.setBytes(index, src, srcIndex, length); } - @Override + public void setBytes(int index, ByteBuffer src) { buffer.setBytes(index, src); } - @Override + public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) { buffer.setBytes(index, src, srcIndex, length); } - @Override + public int setBytes(int index, InputStream src, int length) throws IOException { return buffer.setBytes(index, src, length); } - @Override + public ByteBuffer toByteBuffer(int index, int length) { return buffer.toByteBuffer(index, length); } @@ -176,17 +175,17 @@ public int writeBytes(InputStream in, int length) throws IOException { return super.writeBytes(in, length); } - @Override + public byte[] array() { return buffer.array(); } - @Override + public boolean hasArray() { return buffer.hasArray(); } - @Override + public int arrayOffset() { return buffer.arrayOffset(); } diff --git a/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java b/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java index 9ed56f5f00fb..59218fa000d3 100644 --- a/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java +++ b/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBuffer.java @@ -26,37 +26,37 @@ public NettyBackedChannelBuffer(org.jboss.netty.buffer.ChannelBuffer buffer) { this.buffer = buffer; } - @Override + public int capacity() { return buffer.capacity(); } - @Override + public ChannelBuffer copy(int index, int length) { return new NettyBackedChannelBuffer(buffer.copy(index, length)); } - @Override + public ChannelBufferFactory factory() { return NettyBackedChannelBufferFactory.getInstance(); } - @Override + public byte getByte(int index) { return buffer.getByte(index); } - @Override + public void getBytes(int index, byte[] dst, int dstIndex, int length) { buffer.getBytes(index, dst, dstIndex, length); } - @Override + public void getBytes(int index, ByteBuffer dst) { buffer.getBytes(index, dst); } - @Override + public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) { // careful byte[] data = new byte[length]; @@ -64,32 +64,32 @@ public void getBytes(int index, ChannelBuffer dst, int dstIndex, int length) { dst.setBytes(dstIndex, data, 0, length); } - @Override + public void getBytes(int index, OutputStream dst, int length) throws IOException { buffer.getBytes(index, dst, length); } - @Override + public boolean isDirect() { return buffer.isDirect(); } - @Override + public void setByte(int index, int value) { buffer.setByte(index, value); } - @Override + public void setBytes(int index, byte[] src, int srcIndex, int length) { buffer.setBytes(index, src, srcIndex, length); } - @Override + public void setBytes(int index, ByteBuffer src) { buffer.setBytes(index, src); } - @Override + public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) { // careful byte[] data = new byte[length]; @@ -97,27 +97,27 @@ public void setBytes(int index, ChannelBuffer src, int srcIndex, int length) { setBytes(0, data, index, length); } - @Override + public int setBytes(int index, InputStream src, int length) throws IOException { return buffer.setBytes(index, src, length); } - @Override + public ByteBuffer toByteBuffer(int index, int length) { return buffer.toByteBuffer(index, length); } - @Override + public byte[] array() { return buffer.array(); } - @Override + public boolean hasArray() { return buffer.hasArray(); } - @Override + public int arrayOffset() { return buffer.arrayOffset(); } @@ -126,38 +126,38 @@ public int arrayOffset() { // AbstractChannelBuffer - @Override + public void clear() { buffer.clear(); } - @Override + public ChannelBuffer copy() { return new NettyBackedChannelBuffer(buffer.copy()); } - @Override + public void discardReadBytes() { buffer.discardReadBytes(); } - @Override + public void ensureWritableBytes(int writableBytes) { buffer.ensureWritableBytes(writableBytes); } - @Override + public void getBytes(int index, byte[] dst) { buffer.getBytes(index, dst); } - @Override + public void getBytes(int index, ChannelBuffer dst) { // careful getBytes(index, dst, dst.writableBytes()); } - @Override + public void getBytes(int index, ChannelBuffer dst, int length) { // careful if (length > dst.writableBytes()) { @@ -167,53 +167,53 @@ public void getBytes(int index, ChannelBuffer dst, int length) { dst.writerIndex(dst.writerIndex() + length); } - @Override + public void markReaderIndex() { buffer.markReaderIndex(); } - @Override + public void markWriterIndex() { buffer.markWriterIndex(); } - @Override + public boolean readable() { return buffer.readable(); } - @Override + public int readableBytes() { return buffer.readableBytes(); } - @Override + public byte readByte() { return buffer.readByte(); } - @Override + public void readBytes(byte[] dst) { buffer.readBytes(dst); } - @Override + public void readBytes(byte[] dst, int dstIndex, int length) { buffer.readBytes(dst, dstIndex, length); } - @Override + public void readBytes(ByteBuffer dst) { buffer.readBytes(dst); } - @Override + public void readBytes(ChannelBuffer dst) { // careful readBytes(dst, dst.writableBytes()); } - @Override + public void readBytes(ChannelBuffer dst, int length) { // carefule if (length > dst.writableBytes()) { @@ -223,7 +223,7 @@ public void readBytes(ChannelBuffer dst, int length) { dst.writerIndex(dst.writerIndex() + length); } - @Override + public void readBytes(ChannelBuffer dst, int dstIndex, int length) { // careful if (readableBytes() < length) { @@ -234,48 +234,48 @@ public void readBytes(ChannelBuffer dst, int dstIndex, int length) { dst.setBytes(dstIndex, data, 0, length); } - @Override + public ChannelBuffer readBytes(int length) { return new NettyBackedChannelBuffer(buffer.readBytes(length)); } - @Override + public void resetReaderIndex() { buffer.resetReaderIndex(); } - @Override + public void resetWriterIndex() { buffer.resetWriterIndex(); } - @Override + public int readerIndex() { return buffer.readerIndex(); } - @Override + public void readerIndex(int readerIndex) { buffer.readerIndex(readerIndex); } - @Override + public void readBytes(OutputStream dst, int length) throws IOException { buffer.readBytes(dst, length); } - @Override + public void setBytes(int index, byte[] src) { buffer.setBytes(index, src); } - @Override + public void setBytes(int index, ChannelBuffer src) { // careful setBytes(index, src, src.readableBytes()); } - @Override + public void setBytes(int index, ChannelBuffer src, int length) { // careful if (length > src.readableBytes()) { @@ -285,58 +285,58 @@ public void setBytes(int index, ChannelBuffer src, int length) { src.readerIndex(src.readerIndex() + length); } - @Override + public void setIndex(int readerIndex, int writerIndex) { buffer.setIndex(readerIndex, writerIndex); } - @Override + public void skipBytes(int length) { buffer.skipBytes(length); } - @Override + public ByteBuffer toByteBuffer() { return buffer.toByteBuffer(); } - @Override + public boolean writable() { return buffer.writable(); } - @Override + public int writableBytes() { return buffer.writableBytes(); } - @Override + public void writeByte(int value) { buffer.writeByte(value); } - @Override + public void writeBytes(byte[] src) { buffer.writeBytes(src); } - @Override + public void writeBytes(byte[] src, int index, int length) { buffer.writeBytes(src, index, length); } - @Override + public void writeBytes(ByteBuffer src) { buffer.writeBytes(src); } - @Override + public void writeBytes(ChannelBuffer src) { // careful writeBytes(src, src.readableBytes()); } - @Override + public void writeBytes(ChannelBuffer src, int length) { // careful if (length > src.readableBytes()) { @@ -346,7 +346,7 @@ public void writeBytes(ChannelBuffer src, int length) { src.readerIndex(src.readerIndex() + length); } - @Override + public void writeBytes(ChannelBuffer src, int srcIndex, int length) { // careful byte[] data = new byte[length]; @@ -354,22 +354,22 @@ public void writeBytes(ChannelBuffer src, int srcIndex, int length) { writeBytes(data, 0, length); } - @Override + public int writeBytes(InputStream src, int length) throws IOException { return buffer.writeBytes(src, length); } - @Override + public int writerIndex() { return buffer.writerIndex(); } - @Override + public void writerIndex(int writerIndex) { buffer.writerIndex(writerIndex); } - @Override + public int compareTo(ChannelBuffer o) { return ChannelBuffers.compare(this, o); } diff --git a/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBufferFactory.java b/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBufferFactory.java index aa1ae80cfc38..75c1585d52b0 100644 --- a/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBufferFactory.java +++ b/dubbo-remoting/dubbo-remoting-netty/src/main/java/com/alibaba/dubbo/remoting/transport/netty/NettyBackedChannelBufferFactory.java @@ -20,19 +20,19 @@ public static ChannelBufferFactory getInstance() { return INSTANCE; } - @Override + public ChannelBuffer getBuffer(int capacity) { return new NettyBackedChannelBuffer(ChannelBuffers.dynamicBuffer(capacity)); } - @Override + public ChannelBuffer getBuffer(byte[] array, int offset, int length) { org.jboss.netty.buffer.ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(length); buffer.writeBytes(array, offset, length); return new NettyBackedChannelBuffer(buffer); } - @Override + public ChannelBuffer getBuffer(ByteBuffer nioBuffer) { return new NettyBackedChannelBuffer(ChannelBuffers.wrappedBuffer(nioBuffer)); } diff --git a/dubbo-remoting/dubbo-remoting-netty/src/test/java/com/alibaba/dubbo/remoting/transport/netty/ThreadNameTest.java b/dubbo-remoting/dubbo-remoting-netty/src/test/java/com/alibaba/dubbo/remoting/transport/netty/ThreadNameTest.java index 377fbb450152..abbc767cb429 100644 --- a/dubbo-remoting/dubbo-remoting-netty/src/test/java/com/alibaba/dubbo/remoting/transport/netty/ThreadNameTest.java +++ b/dubbo-remoting/dubbo-remoting-netty/src/test/java/com/alibaba/dubbo/remoting/transport/netty/ThreadNameTest.java @@ -100,31 +100,26 @@ private void output(String method) { + " " + (client ? "client " + method : "server " + method)); } - @Override public void connected(Channel channel) throws RemotingException { output("connected"); checkThreadName(); } - @Override public void disconnected(Channel channel) throws RemotingException { output("disconnected"); checkThreadName(); } - @Override public void sent(Channel channel, Object message) throws RemotingException { output("sent"); checkThreadName(); } - @Override public void received(Channel channel, Object message) throws RemotingException { output("received"); checkThreadName(); } - @Override public void caught(Channel channel, Throwable exception) throws RemotingException { output("caught"); checkThreadName(); diff --git a/pom.xml b/pom.xml index 7cdbfb61a0f8..3a6353a3a36f 100644 --- a/pom.xml +++ b/pom.xml @@ -16,11 +16,6 @@ 4.0.0 - com.alibaba dubbo-parent 2.5.4-SNAPSHOT @@ -42,6 +37,7 @@ http://www.alibaba.com + hessian-lite dubbo-common dubbo-container dubbo-remoting @@ -52,10 +48,9 @@ dubbo-monitor dubbo-config dubbo - dubbo-simple - dubbo-admin - dubbo-demo - hessian-lite + dubbo-simple + dubbo-admin + dubbo-demo @@ -139,12 +134,7 @@ 1.5 1.5 UTF-8 - - 2.1.1 - 2.3.2 - 2.1.1 - 2.3.1 - 2.7 + @@ -464,51 +454,15 @@ - - - - - org.apache.maven.plugins - maven-jar-plugin - ${maven_jar_plugin_version} - - - org.apache.maven.plugins - maven-war-plugin - ${maven_war_plugin_version} - - - org.apache.maven.plugins - maven-install-plugin - ${maven_install_plugin_version} - - - org.apache.maven.plugins - maven-deploy-plugin - ${maven_deploy_plugin_version} - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven_compiler_plugin_version} - - ${java_source_version} - ${java_target_version} - ${file_encoding} - - - - - - jira - http://code.alibabatech.com/jira/browse/DUBBO + github + https://github.com/alibaba/dubbo/issues - http://code.alibabatech.com/svn/dubbo/trunk - scm:svn:http://code.alibabatech.com/svn/dubbo/trunk + https://github.com/alibaba/dubbo + https://github.com/alibaba/dubbo.git