You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/06/06 01:49:17 UTC

[GitHub] chickenlj closed pull request #1387: [dubbo-cache] A method level cache implementation for dubbo.

chickenlj closed pull request #1387: [dubbo-cache] A method level cache implementation for dubbo.
URL: https://github.com/apache/incubator-dubbo/pull/1387
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dubbo-cache/dubbo-cache-api/pom.xml b/dubbo-cache/dubbo-cache-api/pom.xml
new file mode 100644
index 0000000000..2179a71b6d
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-api/pom.xml
@@ -0,0 +1,50 @@
+<!--
+ - Copyright 1999-2011 Alibaba Group.
+ -  
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -  
+ -      http://www.apache.org/licenses/LICENSE-2.0
+ -  
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.alibaba</groupId>
+		<artifactId>dubbo-cache</artifactId>
+		<version>2.5.9</version>
+	</parent>
+	<artifactId>dubbo-cache-api</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId}</name>
+	<description>The cache module of dubbo project</description>
+	<properties>
+		<skip_maven_deploy>true</skip_maven_deploy>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>dubbo-common</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+		    <groupId>org.apache.zookeeper</groupId>
+		    <artifactId>zookeeper</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.101tec</groupId>
+			<artifactId>zkclient</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.curator</groupId>
+			<artifactId>curator-framework</artifactId>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file
diff --git a/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/CacheService.java b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/CacheService.java
new file mode 100644
index 0000000000..5da3e3b6bc
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/CacheService.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache;
+
+import com.alibaba.dubbo.cache.exception.CacheException;
+
+
+public interface CacheService {
+	
+	public void connect(String address, int maxActive, int maxIdle, int minIdle, int defaultTimeout) throws CacheException;
+	
+	public boolean isConnected();
+	
+	public void put(String key, Object value) throws CacheException;
+	
+	/**
+	 * 
+	 * @param key
+	 * @param value
+	 * @param timeout unit second.
+	 */
+	public void put(String key, Object value, int timeout) throws CacheException;
+	
+	public Object get(String key) throws CacheException;
+	
+	public void delete(String key) throws CacheException;
+	
+	public void shutdown();
+	
+	public boolean isShutdown();
+
+}
diff --git a/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/DubboCacheFactory.java b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/DubboCacheFactory.java
new file mode 100644
index 0000000000..306c6bdd03
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/DubboCacheFactory.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.alibaba.dubbo.cache.common.DubboCache;
+import com.alibaba.dubbo.common.logger.Logger;
+import com.alibaba.dubbo.common.logger.LoggerFactory;
+
+public class DubboCacheFactory {
+	
+	protected static final Logger logger = LoggerFactory.getLogger(DubboCacheFactory.class);
+	
+	private static Map<String, CacheService> cacheServiceMap = new HashMap<String, CacheService>();
+	
+	public static CacheService getCacheService(DubboCache dubboCache) {
+		//memcached://127.0.0.1:11211
+		String address = dubboCache.getAddress();
+		CacheService cacheService = cacheServiceMap.get(address);
+		if (cacheService == null) {
+			String cacheType = address.substring(0, address.indexOf("://"));
+			String server = address.substring(address.indexOf("://") + 3);
+			try {
+				if (cacheType.equals("memcached")) {
+					Class<?> clazz = Class.forName("com.alibaba.dubbo.cache.memcached.MemcachedCacheService");
+					cacheService = (CacheService)clazz.newInstance();
+				} else {
+					cacheService = (CacheService)Class.forName("com.alibaba.dubbo.cache.redis.RedisCacheService").newInstance();
+				}
+				cacheService.connect(server, dubboCache.getMaxActive(), dubboCache.getMaxIdle(), dubboCache.getMinIdle(), dubboCache.getDefaultTimeout());
+				cacheServiceMap.put(address, cacheService);
+			} catch (Exception e) {
+				logger.error("Initialize CacheService error! {}", e);
+			}
+		}
+		return cacheService;
+	}
+	
+	public static void removeCacheService(DubboCache dubboCache) {
+		String address = dubboCache.getAddress();
+		cacheServiceMap.remove(address);
+	}
+
+}
diff --git a/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/common/DubboBuffer.java b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/common/DubboBuffer.java
new file mode 100644
index 0000000000..aef30cc60f
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/common/DubboBuffer.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache.common;
+
+public class DubboBuffer {
+
+	private String key;
+	private String method;
+	private String command;
+	private int timeout;
+	
+	private String []keys;
+	
+	public String getKey() {
+		return key;
+	}
+	public void setKey(String key) {
+		this.key = key;
+		keys = key.split(",");
+	}
+	public String getMethod() {
+		return method;
+	}
+	public void setMethod(String method) {
+		this.method = method;
+	}
+	public String getCommand() {
+		return command;
+	}
+	public void setCommand(String command) {
+		this.command = command;
+	}
+	public int getTimeout() {
+		return timeout;
+	}
+	public void setTimeout(int timeout) {
+		this.timeout = timeout;
+	}
+	
+	public String[] getKeys() {
+		return keys;
+	}
+
+	
+}
diff --git a/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/common/DubboCache.java b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/common/DubboCache.java
new file mode 100644
index 0000000000..58f31bea5b
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/common/DubboCache.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache.common;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import java.util.HashMap;
+import java.util.Map;
+
+public class DubboCache {
+	
+	private String service;
+	private String address;
+	private String prefix;
+	private int maxActive;
+	private int maxIdle;
+	private int minIdle;
+	private int defaultTimeout;
+	
+	private Map<String, DubboBuffer> bufferMap;
+	
+	public String getService() {
+		return service;
+	}
+
+	public void setService(String service) {
+		this.service = service;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public String getPrefix() {
+		return prefix;
+	}
+
+	public void setPrefix(String prefix) {
+		this.prefix = prefix;
+	}
+
+	public int getMaxActive() {
+		return maxActive;
+	}
+
+	public void setMaxActive(int maxActive) {
+		this.maxActive = maxActive;
+	}
+
+	public int getMaxIdle() {
+		return maxIdle;
+	}
+
+	public void setMaxIdle(int maxIdle) {
+		this.maxIdle = maxIdle;
+	}
+
+	public int getMinIdle() {
+		return minIdle;
+	}
+
+	public void setMinIdle(int minIdle) {
+		this.minIdle = minIdle;
+	}
+
+	public int getDefaultTimeout() {
+		return defaultTimeout;
+	}
+
+	public void setDefaultTimeout(int defaultTimeout) {
+		this.defaultTimeout = defaultTimeout;
+	}
+
+	public Map<String, DubboBuffer> getBufferMap() {
+		return bufferMap;
+	}
+
+	public void setBufferMap(Map<String, DubboBuffer> bufferMap) {
+		this.bufferMap = bufferMap;
+	}
+	
+	public DubboCache(String cacheData) {
+		bufferMap = new HashMap<String, DubboBuffer>();
+		try {
+			String paramStr = URLDecoder.decode(cacheData, "utf-8");
+			String[] paramAry = paramStr.split("&");
+	    	for (String param : paramAry) {
+	    		String[] pv = param.split("=");
+	    		String key = pv[0];
+	    		String value = "";
+	    		if (pv.length > 1) {
+	    			value = pv[1];
+	    		}
+	    		if (key.equals("service")) {
+	    			this.service = value;
+	    		}
+	    		if (key.equals("address")) {
+	    			this.address = value;
+	    		}
+	    		if (key.equals("prefix")) {
+	    			this.prefix = value;
+	    		}
+
+	    		if (key.equals("maxActive")) {
+	    			this.maxActive = Integer.parseInt(value);
+	    		}
+	    		if (key.equals("maxIdle")) {
+	    			this.maxIdle = Integer.parseInt(value);
+	    		}
+	    		if (key.equals("minIdle")) {
+	    			this.minIdle = Integer.parseInt(value);
+	    		}
+	    		if (key.equals("defaultTimeout")) {
+	    			this.defaultTimeout = Integer.parseInt(value);
+	    		}
+	    		
+	    		if (key.equals("buffer")) {
+	    			String[] bufferValue = value.split(";");
+	    			for (String bufferString : bufferValue) {
+	    				String[] v = bufferString.split("\\|");
+		    			DubboBuffer buffer = new DubboBuffer();
+		    			buffer.setKey(v[0]);
+		    			buffer.setMethod(v[1]);
+		    			buffer.setCommand(v[2]);
+		    			buffer.setTimeout(Integer.parseInt(v[3]));
+		    			bufferMap.put(buffer.getMethod(), buffer);
+	    			}
+	    		}
+	    	}
+		} catch (UnsupportedEncodingException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+	
+
+}
diff --git a/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/exception/CacheException.java b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/exception/CacheException.java
new file mode 100644
index 0000000000..18c2d0c5bc
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-api/src/main/java/com/alibaba/dubbo/cache/exception/CacheException.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache.exception;
+
+public class CacheException extends Exception {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 3841008255052305024L;
+
+	public CacheException(Exception e) {
+		super(e);
+	}
+
+	public CacheException(String message) {
+		super(message);
+	}
+
+}
diff --git a/dubbo-cache/dubbo-cache-memcached/pom.xml b/dubbo-cache/dubbo-cache-memcached/pom.xml
new file mode 100644
index 0000000000..c24a9525ee
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-memcached/pom.xml
@@ -0,0 +1,60 @@
+<!--
+ - Copyright 1999-2011 Alibaba Group.
+ -  
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -  
+ -      http://www.apache.org/licenses/LICENSE-2.0
+ -  
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.alibaba</groupId>
+		<artifactId>dubbo-cache</artifactId>
+		<version>2.5.9</version>
+	</parent>
+	<artifactId>dubbo-cache-memcached</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId}</name>
+	<description>The cache module of dubbo project</description>
+	<properties>
+		<skip_maven_deploy>true</skip_maven_deploy>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>dubbo-common</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>dubbo-cache-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+		    <groupId>org.apache.zookeeper</groupId>
+		    <artifactId>zookeeper</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.101tec</groupId>
+			<artifactId>zkclient</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.curator</groupId>
+			<artifactId>curator-framework</artifactId>
+		</dependency>
+		<dependency>
+		    <groupId>net.spy</groupId>
+		    <artifactId>spymemcached</artifactId>
+		    <version>2.12.1</version>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file
diff --git a/dubbo-cache/dubbo-cache-memcached/src/main/java/com/alibaba/dubbo/cache/memcached/MemcachedCacheService.java b/dubbo-cache/dubbo-cache-memcached/src/main/java/com/alibaba/dubbo/cache/memcached/MemcachedCacheService.java
new file mode 100644
index 0000000000..14b05144ef
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-memcached/src/main/java/com/alibaba/dubbo/cache/memcached/MemcachedCacheService.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache.memcached;
+
+import net.spy.memcached.AddrUtil;
+import net.spy.memcached.ConnectionFactoryBuilder;
+import net.spy.memcached.ConnectionFactoryBuilder.Protocol;
+import net.spy.memcached.MemcachedClient;
+import net.spy.memcached.auth.AuthDescriptor;
+import net.spy.memcached.auth.PlainCallbackHandler;
+import net.spy.memcached.internal.OperationFuture;
+
+import com.alibaba.dubbo.cache.CacheService;
+import com.alibaba.dubbo.cache.exception.CacheException;
+
+public class MemcachedCacheService implements CacheService {
+
+	private MemcachedClient mc = null;
+	
+	private boolean isConnected = false;
+	private boolean isShutdown = false;
+	
+	private static int MAX_EXPIRY_TIME = -1;
+
+	@Override
+	public void connect(String address, int maxActive, int maxIdle,
+			int minIdle, int defaultTimeout) throws CacheException {
+		// address username:password@localhost:11211
+		MAX_EXPIRY_TIME = defaultTimeout;
+		try {
+			if (address.indexOf("@") != -1) {
+				String[] addr = address.split("@");
+				String authStr = addr[0];
+				String serverList = addr[1];
+				String[] auth = authStr.split(":");
+				String user = auth[0];
+				String password = auth[1];
+				// 指定验证机制,推荐PLAIN,
+				// 部分客户端存在协议BUG,只能使用PLAIN协议(PlainCallbackHandler)
+				AuthDescriptor ad = new AuthDescriptor(new String[] { "PLAIN" },
+						new PlainCallbackHandler(user, password)); // 用户名,密码
+				mc = new MemcachedClient(new ConnectionFactoryBuilder()
+						.setProtocol(Protocol.BINARY) // 指定使用Binary协议
+						// .setOpTimeout(100)// 设置超时时间为100ms, 默认2.5s
+						.setAuthDescriptor(ad).build(),
+						AddrUtil.getAddresses(serverList)); // 访问地址
+				isConnected = true;
+			} else {
+				mc = new MemcachedClient(AddrUtil.getAddresses(address));
+				isConnected = true;
+			}
+			OperationFuture<Boolean> future = mc.set("_check_cache_", 3600, "yes");
+			future.get();
+			Object obj = mc.get("_check_cache_");
+			if (obj == null) {
+				throw new CacheException("Memcached client start up failed! Cause can not get object which setted before!");
+			}
+		} catch (Exception e) {
+			isConnected = false;
+			throw new CacheException(e);
+		}
+	}
+	
+	@Override
+	public boolean isConnected() {
+		return isConnected;
+	}
+	
+	@Override
+	public boolean isShutdown() {
+		return isShutdown;
+	}
+	
+	@Override
+	public void put(String key, Object value) throws CacheException {
+		if (MAX_EXPIRY_TIME > 0) {
+			put(key, value, MAX_EXPIRY_TIME);
+		} else {
+			put(key, value, 0);
+		}
+	}
+	
+	@Override
+	public void put(String key, Object value, int timeout) throws CacheException {
+		try {
+			mc.set(key, timeout, value);//spymemcached expiry unit second
+		} catch (Exception e) {
+			throw new CacheException(e);
+		}
+	}
+
+	@Override
+	public Object get(String key) throws CacheException {
+		try {
+			return mc.get(key);
+		} catch (Exception e) {
+			throw new CacheException(e);
+		}
+	}
+
+	@Override
+	public void delete(String key) throws CacheException {
+		try {
+			mc.delete(key);
+		} catch (Exception e) {
+			throw new CacheException(e);
+		}
+	}
+	
+	@Override
+	public void shutdown() {
+		isShutdown = true;
+		mc.shutdown();
+	}
+
+	public static void main(String[] args) {
+		String str = "memcached://127.0.0.1:11211";
+		String str1 = str.substring(0, str.indexOf("://"));
+		String str2 = str.substring(str.indexOf("://") + 3);
+		System.out.println(str1);
+		System.out.println(str2);
+
+		// String address = "127.0.0.1:11211";
+		/*String address = "mm:pdss@127.0.0.1:11211";
+		MemcachedCacheService memcached = new MemcachedCacheService();
+		*/
+	}
+
+}
diff --git a/dubbo-cache/dubbo-cache-redis/pom.xml b/dubbo-cache/dubbo-cache-redis/pom.xml
new file mode 100644
index 0000000000..7d5da375db
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-redis/pom.xml
@@ -0,0 +1,61 @@
+<!--
+ - Copyright 1999-2011 Alibaba Group.
+ -  
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -  
+ -      http://www.apache.org/licenses/LICENSE-2.0
+ -  
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.alibaba</groupId>
+		<artifactId>dubbo-cache</artifactId>
+		<version>2.5.9</version>
+	</parent>
+	<artifactId>dubbo-cache-redis</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId}</name>
+	<description>The cache module of dubbo project</description>
+	<properties>
+		<skip_maven_deploy>true</skip_maven_deploy>
+	</properties>
+	<dependencies>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>dubbo-common</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>dubbo-cache-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
+		<dependency>
+		    <groupId>org.apache.zookeeper</groupId>
+		    <artifactId>zookeeper</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>com.101tec</groupId>
+			<artifactId>zkclient</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.curator</groupId>
+			<artifactId>curator-framework</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>redis.clients</groupId>
+			<artifactId>jedis</artifactId>
+			<version>2.9.0</version>
+			<scope>provided</scope>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file
diff --git a/dubbo-cache/dubbo-cache-redis/src/main/java/com/alibaba/dubbo/cache/redis/RedisCacheService.java b/dubbo-cache/dubbo-cache-redis/src/main/java/com/alibaba/dubbo/cache/redis/RedisCacheService.java
new file mode 100644
index 0000000000..77cd50e1b0
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-redis/src/main/java/com/alibaba/dubbo/cache/redis/RedisCacheService.java
@@ -0,0 +1,222 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.cache.redis;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+
+import redis.clients.jedis.Jedis;
+import redis.clients.jedis.JedisPool;
+import redis.clients.jedis.JedisPoolConfig;
+import redis.clients.jedis.Protocol;
+
+import com.alibaba.com.caucho.hessian.io.HessianInput;
+import com.alibaba.com.caucho.hessian.io.HessianOutput;
+import com.alibaba.dubbo.cache.CacheService;
+import com.alibaba.dubbo.cache.exception.CacheException;
+
+public class RedisCacheService implements CacheService {
+	
+	private boolean isConnected = false;
+	private boolean isShutdown = false;
+	
+	//private static int MAX_EXPIRY_TIME = 30 * 24 * 3600;
+	private static int MAX_EXPIRY_TIME = -1;
+	
+	private JedisPool pool;
+
+	@Override
+	public void connect(String address, int maxActive, int maxIdle,
+			int minIdle, int defaultTimeout) throws CacheException {
+		// address username:password@localhost:11211
+		if (maxActive == -1) {
+			maxActive = 20;
+		}
+		if (maxIdle == -1) {
+			maxIdle = 10;
+		}
+		if (minIdle == -1) {
+			minIdle = 5;
+		}
+		if (maxActive == -1) {
+			maxActive = 20;
+		}
+		MAX_EXPIRY_TIME = defaultTimeout;
+		try {
+			if (address.indexOf("@") != -1) {
+				String[] addr = address.split("@");
+				String authStr = addr[0];
+				String server = addr[1];
+				String[] auth = authStr.split(":");
+				//String user = auth[0];
+				String password = auth[1];
+				String[] ser = server.split(":");
+				String host = ser[0];
+				int port = Integer.parseInt(ser[1]);
+				int maxWait = 60000;
+				JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
+				jedisPoolConfig.setMaxTotal(maxActive);
+				jedisPoolConfig.setMaxIdle(maxIdle);
+				jedisPoolConfig.setMaxWaitMillis(maxWait);
+				jedisPoolConfig.setMinIdle(minIdle);
+				/*jedisPoolConfig
+						.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
+				jedisPoolConfig
+						.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);*/
+				jedisPoolConfig.setNumTestsPerEvictionRun(2);
+				jedisPoolConfig.setTestOnBorrow(false);
+				jedisPoolConfig.setTestOnReturn(false);
+				jedisPoolConfig.setTestWhileIdle(true);
+				int database = 0;
+				pool = new JedisPool(jedisPoolConfig, host, port, Protocol.DEFAULT_TIMEOUT, password, database);				
+				isConnected = true;
+			} else {
+				String[] ser = address.split(":");
+				String host = ser[0];
+				int port = Integer.parseInt(ser[1]);
+				int maxWait = 60000;
+				JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
+				jedisPoolConfig.setMaxTotal(maxActive);
+				jedisPoolConfig.setMaxIdle(maxIdle);
+				jedisPoolConfig.setMaxWaitMillis(maxWait);
+				jedisPoolConfig.setMinIdle(minIdle);
+				jedisPoolConfig.setNumTestsPerEvictionRun(2);
+				jedisPoolConfig.setTestOnBorrow(false);
+				jedisPoolConfig.setTestOnReturn(false);
+				jedisPoolConfig.setTestWhileIdle(true);
+				pool = new JedisPool(jedisPoolConfig, host, port);
+				isConnected = true;
+			}
+		} catch (Exception e) {
+			isConnected = false;
+			throw new CacheException(e);
+		}
+	}
+	
+	@Override
+	public boolean isConnected() {
+		return isConnected;
+	}
+	
+	@Override
+	public boolean isShutdown() {
+		return isShutdown;
+	}
+	
+	@Override
+	public void put(String key, Object value) throws CacheException {
+		if (MAX_EXPIRY_TIME > 0) {
+			put(key, value, MAX_EXPIRY_TIME);
+		} else {
+			Jedis jedis = null;
+			try {
+				jedis = pool.getResource();
+				byte[] bytes = serialize(value);
+				jedis.set(key.getBytes(), bytes);
+			} catch (Exception e) {
+				throw new CacheException(e);
+			} finally {
+				if (jedis != null) {
+					jedis.close();
+				}
+			}
+		}
+	}
+	
+	@Override
+	public void put(String key, Object value, int timeout) throws CacheException {
+		//mc.set(key, timeout, value);//spymemcached expiry unit second
+		Jedis jedis = null;
+		try {
+			jedis = pool.getResource();
+			byte[] bytes = serialize(value);
+			jedis.set(key.getBytes(), bytes);
+			jedis.expire(key, timeout);
+		} catch (Exception e) {
+			throw new CacheException(e);
+		} finally {
+			if (jedis != null) {
+				jedis.close();
+			}
+		}
+	}
+
+	@Override
+	public Object get(String key) throws CacheException {
+		//return mc.get(key);
+		Object value = null;
+		Jedis jedis = null;
+		try {
+			jedis = pool.getResource();
+			byte[] bytes = jedis.get(key.getBytes());
+			if (bytes != null) {
+				value = deserialize(bytes);
+			} else {
+				return null;
+			}
+		} catch (Exception e) {
+			throw new CacheException(e);
+		} finally {
+			if (jedis != null) {
+				jedis.close();
+			}
+		}
+		return value;
+	}
+
+	@Override
+	public void delete(String key) throws CacheException {
+		Jedis jedis = null;
+		try {
+			jedis = pool.getResource();
+			jedis.del(key);
+		} catch (Exception e) {
+			throw new CacheException(e);
+		} finally {
+			if (jedis != null) {
+				jedis.close();
+			}
+		}
+	}
+	
+	@Override
+	public void shutdown() {
+		isShutdown = true;
+		pool.close();
+	}
+	
+	public static byte[] serialize(Object obj) throws IOException{
+		if (obj == null) {
+			throw new NullPointerException();
+		}
+		ByteArrayOutputStream os = new ByteArrayOutputStream();
+		HessianOutput ho = new HessianOutput(os);
+		ho.writeObject(obj);
+		return os.toByteArray();
+	}
+
+	public static Object deserialize(byte[] bytes) throws IOException{
+		if (bytes == null) {
+			throw new NullPointerException();
+		}
+		ByteArrayInputStream is = new ByteArrayInputStream(bytes);
+		HessianInput hi = new HessianInput(is);
+		return hi.readObject();
+	}
+
+}
diff --git a/dubbo-cache/dubbo-cache-redis/src/main/java/com/alibaba/dubbo/cache/redis/User.java b/dubbo-cache/dubbo-cache-redis/src/main/java/com/alibaba/dubbo/cache/redis/User.java
new file mode 100644
index 0000000000..bfedfa1ba4
--- /dev/null
+++ b/dubbo-cache/dubbo-cache-redis/src/main/java/com/alibaba/dubbo/cache/redis/User.java
@@ -0,0 +1,28 @@
+package com.alibaba.dubbo.cache.redis;
+
+import java.io.Serializable;
+
+public class User implements Serializable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 7006027563608395262L;
+
+	private int userid;
+	private String name;
+	public int getUserid() {
+		return userid;
+	}
+	public void setUserid(int userid) {
+		this.userid = userid;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	
+}
diff --git a/dubbo-cache/pom.xml b/dubbo-cache/pom.xml
new file mode 100644
index 0000000000..afd668999f
--- /dev/null
+++ b/dubbo-cache/pom.xml
@@ -0,0 +1,36 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>com.alibaba</groupId>
+		<artifactId>dubbo-parent</artifactId>
+		<version>2.5.9</version>
+	</parent>
+	<artifactId>dubbo-cache</artifactId>
+	<packaging>pom</packaging>
+	<name>${project.artifactId}</name>
+	<description>The cache module of dubbo project</description>
+	<properties>
+		<skip_maven_deploy>true</skip_maven_deploy>
+	</properties>
+	<modules>
+		<module>dubbo-cache-api</module>
+		<module>dubbo-cache-memcached</module>
+		<module>dubbo-cache-redis</module>
+    </modules>
+</project>
\ No newline at end of file
diff --git a/dubbo-common/src/main/java/com/alibaba/dubbo/common/URL.java b/dubbo-common/src/main/java/com/alibaba/dubbo/common/URL.java
index 7827af3bda..0cee5fc55e 100644
--- a/dubbo-common/src/main/java/com/alibaba/dubbo/common/URL.java
+++ b/dubbo-common/src/main/java/com/alibaba/dubbo/common/URL.java
@@ -102,6 +102,8 @@
 
     private volatile transient String string;
 
+    private volatile transient String data;//skykong1981
+
     protected URL() {
         this.protocol = null;
         this.username = null;
@@ -143,6 +145,12 @@ public URL(String protocol, String username, String password, String host, int p
     public URL(String protocol, String username, String password, String host, int port, String path, String... pairs) {
         this(protocol, username, password, host, port, path, CollectionUtils.toStringMap(pairs));
     }
+    
+    //skykong1981
+    public URL(String protocol, String host, int port, String path, Map<String, String> parameters, String data) {
+		this(protocol, null, null, host, port, path, parameters);
+		this.data = data;
+	}
 
     public URL(String protocol, String username, String password, String host, int port, String path, Map<String, String> parameters) {
         if ((username == null || username.length() == 0)
@@ -407,6 +415,16 @@ public String getAbsolutePath() {
     public Map<String, String> getParameters() {
         return parameters;
     }
+    
+    //skykong1981
+    public void setData(String data) {
+    	this.data = data;
+    }
+    
+    public String getData() {
+		return data;
+	}
+    //skykong1981
 
     public String getParameterAndDecoded(String key) {
         return getParameterAndDecoded(key, null);
@@ -932,7 +950,11 @@ public URL addParameter(String key, String value) {
 
         Map<String, String> map = new HashMap<String, String>(getParameters());
         map.put(key, value);
-        return new URL(protocol, username, password, host, port, path, map);
+        //return new URL(protocol, username, password, host, port, path, map);
+        //skykong1981
+        URL newURL = new URL(protocol, username, password, host, port, path, map);
+        newURL.setData(data);
+        return newURL;
     }
 
     public URL addParameterIfAbsent(String key, String value) {
@@ -945,7 +967,11 @@ public URL addParameterIfAbsent(String key, String value) {
         }
         Map<String, String> map = new HashMap<String, String>(getParameters());
         map.put(key, value);
-        return new URL(protocol, username, password, host, port, path, map);
+        //return new URL(protocol, username, password, host, port, path, map);
+        //skykong1981
+        URL newURL = new URL(protocol, username, password, host, port, path, map);
+        newURL.setData(data);
+        return newURL;
     }
 
     /**
@@ -979,7 +1005,11 @@ public URL addParameters(Map<String, String> parameters) {
 
         Map<String, String> map = new HashMap<String, String>(getParameters());
         map.putAll(parameters);
-        return new URL(protocol, username, password, host, port, path, map);
+        //return new URL(protocol, username, password, host, port, path, map);
+        //skykong1981
+        URL newURL = new URL(protocol, username, password, host, port, path, map);
+        newURL.setData(data);
+        return newURL;
     }
 
     public URL addParametersIfAbsent(Map<String, String> parameters) {
@@ -988,7 +1018,11 @@ public URL addParametersIfAbsent(Map<String, String> parameters) {
         }
         Map<String, String> map = new HashMap<String, String>(parameters);
         map.putAll(getParameters());
-        return new URL(protocol, username, password, host, port, path, map);
+        //return new URL(protocol, username, password, host, port, path, map);
+        //skykong1981
+        URL newURL = new URL(protocol, username, password, host, port, path, map);
+        newURL.setData(data);
+        return newURL;
     }
 
     public URL addParameters(String... pairs) {
@@ -1038,11 +1072,19 @@ public URL removeParameters(String... keys) {
         if (map.size() == getParameters().size()) {
             return this;
         }
-        return new URL(protocol, username, password, host, port, path, map);
+        //return new URL(protocol, username, password, host, port, path, map);
+        //skykong1981
+        URL newURL = new URL(protocol, username, password, host, port, path, map);
+        newURL.setData(data);
+        return newURL;
     }
 
     public URL clearParameters() {
-        return new URL(protocol, username, password, host, port, path, new HashMap<String, String>());
+        //return new URL(protocol, username, password, host, port, path, new HashMap<String, String>());
+    	//skykong1981
+        URL newURL = new URL(protocol, username, password, host, port, path, new HashMap<String, String>());
+        newURL.setData(data);
+        return newURL;
     }
 
     public String getRawParameter(String key) {
diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/BufferConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/BufferConfig.java
new file mode 100644
index 0000000000..23d882acd2
--- /dev/null
+++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/BufferConfig.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.config;
+
+/**
+ * CacheConfig
+ * 
+ * @author 
+ * @export
+ */
+public class BufferConfig extends AbstractConfig {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 3655250290384872271L;
+	
+	protected String key;
+	protected String method;
+	protected String command;
+	protected int timeout;
+	
+	public String getKey() {
+		return key;
+	}
+	public void setKey(String key) {
+		this.key = key;
+	}
+	public String getMethod() {
+		return method;
+	}
+	public void setMethod(String method) {
+		this.method = method;
+	}
+	public String getCommand() {
+		return command;
+	}
+	public void setCommand(String command) {
+		this.command = command;
+	}
+	public int getTimeout() {
+		return timeout;
+	}
+	public void setTimeout(int timeout) {
+		this.timeout = timeout;
+	}
+
+}
diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/CacheConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/CacheConfig.java
new file mode 100644
index 0000000000..469404ed52
--- /dev/null
+++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/CacheConfig.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.config;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.List;
+
+import com.alibaba.dubbo.config.support.Parameter;
+
+/**
+ * CacheConfig
+ * 
+ * @author 
+ * @export
+ */
+public class CacheConfig extends AbstractConfig {
+
+	private static final long serialVersionUID = 5679092108207708658L;
+	
+    protected String server;
+	protected String service;
+	protected String address;
+	protected String prefix;
+	/*protected String user;
+	protected String password;*/
+	protected int maxActive;
+	protected int maxIdle;
+	protected int minIdle;
+	protected int defaultTimeout;
+	protected List<BufferConfig> bufferList;
+	private transient volatile boolean exported;
+	
+	public String getServer() {
+		return server;
+	}
+	public void setServer(String server) {
+		this.server = server;
+	}
+	public String getService() {
+		return service;
+	}
+	public void setService(String service) {
+		this.service = service;
+	}
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}	
+	public String getPrefix() {
+		return prefix;
+	}
+	public void setPrefix(String prefix) {
+		this.prefix = prefix;
+	}
+	/*public String getUser() {
+		return user;
+	}
+	public void setUser(String user) {
+		this.user = user;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}*/
+	public int getMaxActive() {
+		return maxActive;
+	}
+	public void setMaxActive(int maxActive) {
+		this.maxActive = maxActive;
+	}
+	public int getMaxIdle() {
+		return maxIdle;
+	}
+	public void setMaxIdle(int maxIdle) {
+		this.maxIdle = maxIdle;
+	}
+	public int getMinIdle() {
+		return minIdle;
+	}
+	public void setMinIdle(int minIdle) {
+		this.minIdle = minIdle;
+	}
+	public int getDefaultTimeout() {
+		return defaultTimeout;
+	}
+	public void setDefaultTimeout(int defaultTimeout) {
+		this.defaultTimeout = defaultTimeout;
+	}
+	public List<BufferConfig> getBufferList() {
+		return bufferList;
+	}
+	public void setBufferList(List<BufferConfig> bufferList) {
+		this.bufferList = bufferList;
+	}
+	
+	public String toUTFString() {
+		StringBuffer sb = new StringBuffer();
+		sb.append("service=");
+		sb.append(service);
+		sb.append("&address=");
+		sb.append(address);
+		sb.append("&prefix=");
+		if (prefix == null) {
+			prefix = "";
+		}
+		sb.append(prefix);
+		
+		sb.append("&maxActive=");
+		sb.append(maxActive);
+		sb.append("&maxIdle=");
+		sb.append(maxIdle);
+		sb.append("&minIdle=");
+		sb.append(minIdle);
+		sb.append("&defaultTimeout=");
+		sb.append(defaultTimeout);
+		
+		sb.append("&buffer=");
+		String bufferStr = "";
+		for (BufferConfig buffer : bufferList) {
+			try {
+				String key = buffer.getKey();
+				String method = buffer.getMethod();
+				/*Class<?> serviceClazz = Class.forName(service);
+				String[] methodParamNames = getMethodParamNames(serviceClazz, method);
+				Map<String, Integer> methodParamMap = new HashMap<String, Integer>();
+				for (int i=0; i<methodParamNames.length; i++) {
+					String methodParamName = methodParamNames[i];
+					methodParamMap.put(methodParamName, i+1);
+				}
+				key = getCacheKey(key, methodParamMap);*/
+				String bcs = key + "|" + method + "|" + buffer.getCommand() + "|" + buffer.getTimeout();
+				bufferStr += (";" + bcs);
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+		}
+		if (bufferStr.length() > 0) {
+			bufferStr = bufferStr.substring(1);
+		}
+		sb.append(bufferStr);
+		try {
+			String encodeStr = URLEncoder.encode(sb.toString(), "utf-8");
+			return encodeStr;
+		} catch (UnsupportedEncodingException e) {
+			return sb.toString();
+		}
+	}
+	
+	@Parameter(excluded = true)
+    public boolean isExported() {
+		return exported;
+	}
+	
+	public void doExport() {
+		exported = true;
+	}	
+
+}
diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/CacheServerConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/CacheServerConfig.java
new file mode 100644
index 0000000000..62eae58bb2
--- /dev/null
+++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/CacheServerConfig.java
@@ -0,0 +1,89 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.config;
+
+/**
+ * CacheServerConfig
+ * @author 
+ *
+ */
+public class CacheServerConfig extends AbstractConfig {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 3655250290384872271L;
+	
+	private String address;
+	private String prefix;
+	private String user;
+	private String password;
+	private int maxActive;
+	private int maxIdle;
+	private int minIdle;
+	private int defaultTimeout;
+	
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getPrefix() {
+		return prefix;
+	}
+	public void setPrefix(String prefix) {
+		this.prefix = prefix;
+	}
+	public String getUser() {
+		return user;
+	}
+	public void setUser(String user) {
+		this.user = user;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	public int getMaxActive() {
+		return maxActive;
+	}
+	public void setMaxActive(int maxActive) {
+		this.maxActive = maxActive;
+	}
+	public int getMaxIdle() {
+		return maxIdle;
+	}
+	public void setMaxIdle(int maxIdle) {
+		this.maxIdle = maxIdle;
+	}
+	public int getMinIdle() {
+		return minIdle;
+	}
+	public void setMinIdle(int minIdle) {
+		this.minIdle = minIdle;
+	}
+	public int getDefaultTimeout() {
+		return defaultTimeout;
+	}
+	public void setDefaultTimeout(int defaultTimeout) {
+		this.defaultTimeout = defaultTimeout;
+	}
+
+}
diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java
index 635245f155..67a67425e3 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java
@@ -94,6 +94,8 @@
     private transient volatile boolean unexported;
 
     private volatile String generic;
+    
+    private CacheConfig cacheConfig;//skykong1981
 
     public ServiceConfig() {
     }
@@ -190,6 +192,11 @@ public boolean isExported() {
     public boolean isUnexported() {
         return unexported;
     }
+    
+    //skykong1981
+    public void setCacheConfig(CacheConfig cacheConfig) {
+    	this.cacheConfig = cacheConfig;
+    }
 
     public synchronized void export() {
         if (provider != null) {
@@ -467,7 +474,14 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
 
         String host = this.findConfigedHosts(protocolConfig, registryURLs, map);
         Integer port = this.findConfigedPorts(protocolConfig, name, map);
-        URL url = new URL(name, host, port, (contextPath == null || contextPath.length() == 0 ? "" : contextPath + "/") + path, map);
+        //URL url = new URL(name, host, port, (contextPath == null || contextPath.length() == 0 ? "" : contextPath + "/") + path, map);
+        //skykong1981
+        String cacheData = null;
+        if (cacheConfig != null) {
+        	cacheData = cacheConfig.toUTFString();
+        }
+        URL url = new URL(name, host, port, (contextPath == null || contextPath.length() == 0 ? "" : contextPath + "/") + path, map, cacheData);
+        //skykong1981
 
         if (ExtensionLoader.getExtensionLoader(ConfiguratorFactory.class)
                 .hasExtension(url.getProtocol())) {
@@ -498,7 +512,12 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
                         if (logger.isInfoEnabled()) {
                             logger.info("Register dubbo service " + interfaceClass.getName() + " url " + url + " to registry " + registryURL);
                         }
-                        Invoker<?> invoker = proxyFactory.getInvoker(ref, (Class) interfaceClass, registryURL.addParameterAndEncoded(Constants.EXPORT_KEY, url.toFullString()));
+                        //Invoker<?> invoker = proxyFactory.getInvoker(ref, (Class) interfaceClass, registryURL.addParameterAndEncoded(Constants.EXPORT_KEY, url.toFullString()));
+                        //skykong1981
+                        registryURL = registryURL.addParameterAndEncoded(Constants.EXPORT_KEY, url.toFullString());
+                        registryURL.setData(url.getData());
+                        Invoker<?> invoker = proxyFactory.getInvoker(ref, (Class) interfaceClass, registryURL);
+                        
                         DelegateProviderMetaDataInvoker wrapperInvoker = new DelegateProviderMetaDataInvoker(invoker, this);
 
                         Exporter<?> exporter = protocol.export(wrapperInvoker);
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/CacheBean.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/CacheBean.java
new file mode 100644
index 0000000000..8c40422a30
--- /dev/null
+++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/CacheBean.java
@@ -0,0 +1,261 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.config.spring;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javassist.ClassPool;
+import javassist.CtClass;
+import javassist.CtMethod;
+import javassist.Modifier;
+import javassist.NotFoundException;
+import javassist.bytecode.CodeAttribute;
+import javassist.bytecode.LocalVariableAttribute;
+import javassist.bytecode.MethodInfo;
+
+import org.springframework.beans.factory.BeanNameAware;
+import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.support.AbstractApplicationContext;
+
+import com.alibaba.dubbo.config.BufferConfig;
+import com.alibaba.dubbo.config.CacheConfig;
+import com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory;
+
+@SuppressWarnings("rawtypes")
+public class CacheBean extends CacheConfig implements InitializingBean, DisposableBean, ApplicationContextAware, ApplicationListener, BeanNameAware {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 6107238933448094706L;
+	
+	@SuppressWarnings("unused")
+	private static transient ApplicationContext SPRING_CONTEXT;
+
+	private transient ApplicationContext applicationContext;
+	@SuppressWarnings("unused")
+    private transient String beanName;
+	@SuppressWarnings("unused")
+    private transient boolean supportedApplicationListener;
+
+	@Override
+	public void setBeanName(String name) {
+		// TODO Auto-generated method stub
+	}
+
+	@Override
+	public void onApplicationEvent(ApplicationEvent event) {
+		// TODO Auto-generated method stub
+		/*if (ContextRefreshedEvent.class.getName().equals(event.getClass().getName())) {
+        	if (! isExported()) {
+                
+            }
+        }*/
+	}
+
+	public synchronized void export() {
+		doExport();
+	}
+	
+	@Override
+	public void setApplicationContext(ApplicationContext applicationContext) {
+		this.applicationContext = applicationContext;
+		SpringExtensionFactory.addApplicationContext(applicationContext);
+		if (applicationContext != null) {
+		    SPRING_CONTEXT = applicationContext;
+		    try {
+	            Method method = applicationContext.getClass().getMethod("addApplicationListener", new Class<?>[]{ApplicationListener.class}); // 兼容Spring2.0.1
+	            method.invoke(applicationContext, new Object[] {this});
+	            supportedApplicationListener = true;
+	        } catch (Throwable t) {
+                if (applicationContext instanceof AbstractApplicationContext) {
+    	            try {
+    	                Method method = AbstractApplicationContext.class.getDeclaredMethod("addListener", new Class<?>[]{ApplicationListener.class}); // 兼容Spring2.0.1
+                        if (! method.isAccessible()) {
+                            method.setAccessible(true);
+                        }
+    	                method.invoke(applicationContext, new Object[] {this});
+                        supportedApplicationListener = true;
+    	            } catch (Throwable t2) {
+    	            }
+	            }
+	        }
+		}
+	}
+
+	@Override
+	public void destroy() throws Exception {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void afterPropertiesSet() throws Exception {
+		// TODO Auto-generated method stub
+		CacheServerBean cacheServer = (CacheServerBean)applicationContext.getBean(server);
+	    String protocol = cacheServer.getProtocol();
+    	String address = cacheServer.getAddress();
+    	String prefix = cacheServer.getPrefix();
+    	String user = cacheServer.getUser();
+    	String password = cacheServer.getPassword();
+    	int maxActive = -1, maxIdle = -1, minIdle = -1, defaultTimeout = -1;
+    	if (cacheServer.getMaxactive() != null) {
+    		maxActive = Integer.parseInt(cacheServer.getMaxactive());
+    	}
+    	if (cacheServer.getMaxidle() != null) {
+    		maxIdle = Integer.parseInt(cacheServer.getMaxidle());
+    	}
+    	if (cacheServer.getMinidle() != null) {
+    		minIdle = Integer.parseInt(cacheServer.getMinidle());
+    	}
+    	if (cacheServer.getTimeout() != null) {
+    		defaultTimeout = Integer.parseInt(cacheServer.getTimeout());
+    	}
+    	String connectStr;
+    	if (password != null && !password.isEmpty()) {//memcached://user:passwd@127.0.0.1:11211
+    		if (user == null) {//redis不需要配置user
+    			user = "";
+    		}
+    		connectStr = protocol + "://" + user + ":" + password + "@" + address;  
+    	} else {
+    		connectStr = protocol + "://" + address;
+        }
+    	this.address = connectStr;
+    	this.prefix = prefix;
+    	this.maxActive = maxActive;
+    	this.maxIdle = maxIdle;
+    	this.minIdle = minIdle;
+    	this.defaultTimeout = defaultTimeout;
+    	
+    	Class<?> serviceClazz = Class.forName(service);
+		Object bean = applicationContext.getBean(serviceClazz);
+		String className = bean.getClass().getName();
+		if (className.indexOf("$$") != -1) {
+			//com.xxx.user.aggregate.impl.UserAggregateImpl$$EnhancerBySpringCGLIB$$efa438ef
+			className = className.substring(0, className.indexOf("$$"));
+		}
+    	for (BufferConfig buffer : bufferList) {
+			try {
+				String key = buffer.getKey();
+				String method = buffer.getMethod();
+				String[] methodParamNames = getMethodParamNames(className, method);
+				Map<String, Integer> methodParamMap = new HashMap<String, Integer>();
+				for (int i=0; i<methodParamNames.length; i++) {
+					String methodParamName = methodParamNames[i];
+					methodParamMap.put(methodParamName, i+1);
+				}
+				key = getCacheKey(key, methodParamMap);
+				buffer.setKey(key);
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+		}
+	}
+	
+	private String getCacheKey(String key, Map<String, Integer> methodParamMap) throws Exception {
+        String regex = "\\{(.*?)\\}";
+        Pattern p = Pattern.compile(regex);
+        Matcher m = p.matcher(key);
+        while (m.find()) {
+            String k = m.group();
+            if (k.indexOf(".") == -1) {
+            	k = k.substring(1, k.length() - 1);
+            	if (!methodParamMap.containsKey(k)) {
+            		throw new Exception("Cache key : " + key + " - " + k + " does not exist!");
+            	}
+            	key = key.replaceFirst("\\{" + k + "\\}", "\\{" + methodParamMap.get(k) + "\\}");
+            } else {
+            	String nk = k.substring(1, k.length() - 1);//1.userid
+            	String[] nkAry = nk.split("\\.");
+            	if (!methodParamMap.containsKey(nkAry[0])) {
+            		throw new Exception("Cache key : " + key + " - " + nkAry[0] + " does not exist!");
+            	}
+            	key = key.replaceFirst("\\{" + nk + "\\}", "{" + methodParamMap.get(nkAry[0]) + "." + nkAry[1] + "}");
+            }
+        }
+        return key;
+    }
+	
+	/**
+     * 
+     * <p>
+     * 获取方法参数名称
+     * </p>
+     * 
+     * @param cm
+     * @return
+     */
+    private String[] getMethodParamNames(CtMethod cm) throws Exception {
+        CtClass cc = cm.getDeclaringClass();
+        MethodInfo methodInfo = cm.getMethodInfo();
+        CodeAttribute codeAttribute = methodInfo.getCodeAttribute();
+        LocalVariableAttribute attr = (LocalVariableAttribute) codeAttribute
+                .getAttribute(LocalVariableAttribute.tag);
+        if (attr == null) {
+            throw new Exception(cc.getName());
+        }
+ 
+        String[] paramNames = null;
+        try {
+            paramNames = new String[cm.getParameterTypes().length];
+        } catch (NotFoundException e) {
+            throw e;
+        }
+        int pos = Modifier.isStatic(cm.getModifiers()) ? 0 : 1;
+        for (int i = 0; i < paramNames.length; i++) {
+            paramNames[i] = attr.variableName(i + pos);
+        }
+        return paramNames;
+    }
+ 
+ 
+    /**
+     * 获取方法参数名称,匹配同名的某一个方法
+     * 
+     * @param clazz
+     * @param method
+     * @return
+     * @throws NotFoundException
+     *             如果类或者方法不存在
+     * @throws MissingLVException
+     *             如果最终编译的class文件不包含局部变量表信息
+     */
+    private String[] getMethodParamNames(String className, String method) throws Exception {
+        ClassPool pool = ClassPool.getDefault();
+        /*ClassClassPath classPath = new ClassClassPath(this.getClass());
+        pool.insertClassPath(classPath);*/
+        CtClass cc;
+        CtMethod cm = null;
+        try {
+            cc = pool.get(className);
+            cm = cc.getDeclaredMethod(method);
+        } catch (NotFoundException e) {
+        	throw e;
+        }
+        return getMethodParamNames(cm);
+    }
+
+}
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/CacheServerBean.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/CacheServerBean.java
new file mode 100644
index 0000000000..124e81934e
--- /dev/null
+++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/CacheServerBean.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.alibaba.dubbo.config.spring;
+
+public class CacheServerBean {
+	
+	private String id;
+	private String protocol;
+	private String address;
+	private String prefix;
+	private String user;
+	private String password;
+	private String maxactive;
+	private String maxidle;
+	private String minidle;
+	private String timeout;
+	
+	
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+	public String getProtocol() {
+		return protocol;
+	}
+	public void setProtocol(String protocol) {
+		this.protocol = protocol;
+	}
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getPrefix() {
+		return prefix;
+	}
+	public void setPrefix(String prefix) {
+		this.prefix = prefix;
+	}
+	public String getUser() {
+		return user;
+	}
+	public void setUser(String user) {
+		this.user = user;
+	}
+	public String getPassword() {
+		return password;
+	}
+	public void setPassword(String password) {
+		this.password = password;
+	}
+	public String getMaxactive() {
+		return maxactive;
+	}
+	public void setMaxactive(String maxactive) {
+		this.maxactive = maxactive;
+	}
+	public String getMaxidle() {
+		return maxidle;
+	}
+	public void setMaxidle(String maxidle) {
+		this.maxidle = maxidle;
+	}
+	public String getMinidle() {
+		return minidle;
+	}
+	public void setMinidle(String minidle) {
+		this.minidle = minidle;
+	}
+	public String getTimeout() {
+		return timeout;
+	}
+	public void setTimeout(String timeout) {
+		this.timeout = timeout;
+	}
+	
+	
+
+}
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/ServiceBean.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/ServiceBean.java
index 0166b1fffb..b0aba44082 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/ServiceBean.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/ServiceBean.java
@@ -16,15 +16,11 @@
  */
 package com.alibaba.dubbo.config.spring;
 
-import com.alibaba.dubbo.config.ApplicationConfig;
-import com.alibaba.dubbo.config.ModuleConfig;
-import com.alibaba.dubbo.config.MonitorConfig;
-import com.alibaba.dubbo.config.ProtocolConfig;
-import com.alibaba.dubbo.config.ProviderConfig;
-import com.alibaba.dubbo.config.RegistryConfig;
-import com.alibaba.dubbo.config.ServiceConfig;
-import com.alibaba.dubbo.config.annotation.Service;
-import com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
 import org.springframework.beans.factory.BeanFactoryUtils;
 import org.springframework.beans.factory.BeanNameAware;
@@ -36,10 +32,15 @@
 import org.springframework.context.event.ContextRefreshedEvent;
 import org.springframework.context.support.AbstractApplicationContext;
 
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
+import com.alibaba.dubbo.config.ApplicationConfig;
+import com.alibaba.dubbo.config.ModuleConfig;
+import com.alibaba.dubbo.config.MonitorConfig;
+import com.alibaba.dubbo.config.ProtocolConfig;
+import com.alibaba.dubbo.config.ProviderConfig;
+import com.alibaba.dubbo.config.RegistryConfig;
+import com.alibaba.dubbo.config.ServiceConfig;
+import com.alibaba.dubbo.config.annotation.Service;
+import com.alibaba.dubbo.config.spring.extension.SpringExtensionFactory;
 
 /**
  * ServiceFactoryBean
@@ -97,6 +98,16 @@ public void setApplicationContext(ApplicationContext applicationContext) {
                 }
             }
         }
+        //skykong1981
+        Map<String, CacheBean> beans = applicationContext.getBeansOfType(CacheBean.class);
+		Iterator<CacheBean> it = beans.values().iterator();
+		while (it.hasNext()) {
+			CacheBean cacheBean = it.next();
+			if (this.getInterface().equals(cacheBean.getService())) {
+				this.setCacheConfig(cacheBean);
+			}
+		}
+        //skykong1981
     }
 
     public void setBeanName(String name) {
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboBeanDefinitionParser.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboBeanDefinitionParser.java
index e6d386fc03..09e11ab66c 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboBeanDefinitionParser.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboBeanDefinitionParser.java
@@ -16,16 +16,15 @@
  */
 package com.alibaba.dubbo.config.spring.schema;
 
-import com.alibaba.dubbo.common.Constants;
-import com.alibaba.dubbo.common.extension.ExtensionLoader;
-import com.alibaba.dubbo.common.logger.Logger;
-import com.alibaba.dubbo.common.logger.LoggerFactory;
-import com.alibaba.dubbo.common.utils.ReflectUtils;
-import com.alibaba.dubbo.common.utils.StringUtils;
-import com.alibaba.dubbo.config.*;
-import com.alibaba.dubbo.config.spring.ReferenceBean;
-import com.alibaba.dubbo.config.spring.ServiceBean;
-import com.alibaba.dubbo.rpc.Protocol;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Pattern;
+
 import org.springframework.beans.PropertyValue;
 import org.springframework.beans.factory.config.BeanDefinition;
 import org.springframework.beans.factory.config.BeanDefinitionHolder;
@@ -41,12 +40,24 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.regex.Pattern;
+import com.alibaba.dubbo.common.Constants;
+import com.alibaba.dubbo.common.extension.ExtensionLoader;
+import com.alibaba.dubbo.common.logger.Logger;
+import com.alibaba.dubbo.common.logger.LoggerFactory;
+import com.alibaba.dubbo.common.utils.ReflectUtils;
+import com.alibaba.dubbo.common.utils.StringUtils;
+import com.alibaba.dubbo.config.ArgumentConfig;
+import com.alibaba.dubbo.config.BufferConfig;
+import com.alibaba.dubbo.config.ConsumerConfig;
+import com.alibaba.dubbo.config.MethodConfig;
+import com.alibaba.dubbo.config.ProtocolConfig;
+import com.alibaba.dubbo.config.ProviderConfig;
+import com.alibaba.dubbo.config.RegistryConfig;
+import com.alibaba.dubbo.config.spring.CacheBean;
+import com.alibaba.dubbo.config.spring.CacheServerBean;
+import com.alibaba.dubbo.config.spring.ReferenceBean;
+import com.alibaba.dubbo.config.spring.ServiceBean;
+import com.alibaba.dubbo.rpc.Protocol;
 
 /**
  * AbstractBeanDefinitionParser
@@ -120,6 +131,29 @@ private static BeanDefinition parse(Element element, ParserContext parserContext
             parseNested(element, parserContext, ServiceBean.class, true, "service", "provider", id, beanDefinition);
         } else if (ConsumerConfig.class.equals(beanClass)) {
             parseNested(element, parserContext, ReferenceBean.class, false, "reference", "consumer", id, beanDefinition);
+        } else if (CacheServerBean.class.equals(beanClass)) {//Laocoon
+        	parseNested(element, parserContext, CacheServerBean.class, false, "cacheServer", "", id, beanDefinition);
+        } else if (CacheBean.class.equals(beanClass)) {//Laocoon
+        	String server = element.getAttribute("server");
+        	String service = element.getAttribute("service");
+        	beanDefinition.getPropertyValues().addPropertyValue("server", server);
+        	beanDefinition.getPropertyValues().addPropertyValue("service", service);
+        	NodeList nodeList = element.getElementsByTagName("dubbo:buffer");
+        	List<BufferConfig> list = new ArrayList<BufferConfig>();
+        	for (int i=0; i<nodeList.getLength(); i++) {
+        		Element ele = (Element)nodeList.item(i);
+        		BufferConfig buffer = new BufferConfig();
+        		buffer.setKey(ele.getAttribute("key"));
+        		buffer.setMethod(ele.getAttribute("method"));
+        		buffer.setCommand(ele.getAttribute("command"));
+        		String timeout = ele.getAttribute("timeout");
+        		if (timeout == null || timeout.equals("")) {
+        			timeout = "0";
+        		}
+        		buffer.setTimeout(Integer.parseInt(timeout));
+        		list.add(buffer);
+        	}
+        	beanDefinition.getPropertyValues().addPropertyValue("bufferList", list);
         }
         Set<String> props = new HashSet<String>();
         ManagedMap parameters = null;
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.java
index da44826514..c0b297f6f6 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.java
@@ -16,11 +16,20 @@
  */
 package com.alibaba.dubbo.config.spring.schema;
 
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
 import com.alibaba.dubbo.common.Version;
-import com.alibaba.dubbo.config.*;
+import com.alibaba.dubbo.config.ApplicationConfig;
+import com.alibaba.dubbo.config.ConsumerConfig;
+import com.alibaba.dubbo.config.ModuleConfig;
+import com.alibaba.dubbo.config.MonitorConfig;
+import com.alibaba.dubbo.config.ProtocolConfig;
+import com.alibaba.dubbo.config.ProviderConfig;
+import com.alibaba.dubbo.config.RegistryConfig;
+import com.alibaba.dubbo.config.spring.CacheBean;
+import com.alibaba.dubbo.config.spring.CacheServerBean;
 import com.alibaba.dubbo.config.spring.ReferenceBean;
 import com.alibaba.dubbo.config.spring.ServiceBean;
-import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
 
 /**
  * DubboNamespaceHandler
@@ -44,6 +53,10 @@ public void init() {
         registerBeanDefinitionParser("service", new DubboBeanDefinitionParser(ServiceBean.class, true));
         registerBeanDefinitionParser("reference", new DubboBeanDefinitionParser(ReferenceBean.class, false));
         registerBeanDefinitionParser("annotation", new AnnotationBeanDefinitionParser());
+        
+        //Laocoon
+        registerBeanDefinitionParser("cacheServer", new DubboBeanDefinitionParser(CacheServerBean.class, true));
+        registerBeanDefinitionParser("cache", new DubboBeanDefinitionParser(CacheBean.class, true));
     }
 
 }
\ No newline at end of file
diff --git a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
index 2a41cb9cae..7b0aca179c 100644
--- a/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
+++ b/dubbo-config/dubbo-config-spring/src/main/resources/META-INF/dubbo.xsd
@@ -1095,6 +1095,107 @@
             </xsd:extension>
         </xsd:complexContent>
     </xsd:complexType>
+    
+    <!-- Laocoon -->
+	<xsd:complexType name="cacheServerType">
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The unique identifier for a bean. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="protocol" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The cache protocol. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="address" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The server address. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="prefix" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The cache key prefix. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="user" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The cache server auth user. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>		
+		<xsd:attribute name="password" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The cache server auth password. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="maxactive" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ max active connection. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="maxidle" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ max idle connection.. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="minidle" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ min idle connection.. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="timeout" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ default timeout. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+	<!-- Laocoon -->
+	<!-- Laocoon -->
+	<xsd:complexType name="cacheType">
+		<xsd:sequence minOccurs="0" maxOccurs="unbounded">
+			<xsd:element ref="buffer" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="id" type="xsd:ID">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The unique identifier for a bean. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="service" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The service of cache. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="server" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The reference of server. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+	<!-- Laocoon -->
+	<!-- Laocoon -->	
+	<xsd:complexType name="bufferType">
+		<xsd:attribute name="key" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The key of cache. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="method" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ The method of service. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="command" type="xsd:string" use="required">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ get or delete. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+		<xsd:attribute name="timeout" type="xsd:string" use="optional">
+			<xsd:annotation>
+				<xsd:documentation><![CDATA[ cache timeout. ]]></xsd:documentation>
+			</xsd:annotation>
+		</xsd:attribute>
+	</xsd:complexType>
+	<!-- Laocoon -->
 
     <xsd:complexType name="annotationType">
         <xsd:attribute name="id" type="xsd:ID">
@@ -1186,5 +1287,23 @@
             <xsd:documentation><![CDATA[ The service url parameter ]]></xsd:documentation>
         </xsd:annotation>
     </xsd:element>
+    
+    <!-- Laocoon -->
+	<xsd:element name="buffer" type="bufferType">
+		<xsd:annotation> 
+			<xsd:documentation><![CDATA[ The service url parameter ]]></xsd:documentation> 
+		</xsd:annotation>
+	</xsd:element>	
+	<xsd:element name="cache" type="cacheType">
+		<xsd:annotation> 
+			<xsd:documentation><![CDATA[ Export service default config ]]></xsd:documentation> 
+		</xsd:annotation>
+	</xsd:element>
+	<xsd:element name="cacheServer" type="cacheServerType">
+		<xsd:annotation> 
+			<xsd:documentation><![CDATA[ Export service default config ]]></xsd:documentation> 
+		</xsd:annotation>
+	</xsd:element>
+	<!-- Laocoon -->
 
 </xsd:schema>
\ No newline at end of file
diff --git a/dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoBean.java b/dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoBean.java
new file mode 100644
index 0000000000..052537c344
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoBean.java
@@ -0,0 +1,25 @@
+package com.alibaba.dubbo.demo;
+
+import java.io.Serializable;
+
+public class DemoBean implements Serializable {
+	
+	private int id;
+	private String name;
+	
+	public int getId() {
+		return id;
+	}
+	public void setId(int id) {
+		this.id = id;
+	}
+	public String getName() {
+		return name;
+	}
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	
+
+}
diff --git a/dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoCacheService.java b/dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoCacheService.java
new file mode 100644
index 0000000000..5650b6b92a
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoCacheService.java
@@ -0,0 +1,11 @@
+package com.alibaba.dubbo.demo;
+
+public interface DemoCacheService {
+	
+	public DemoBean getBeanById(int id);
+	
+	public DemoBean getBean(DemoBean bean);
+	
+	public void setBean(DemoBean bean);
+
+}
diff --git a/dubbo-demo/dubbo-demo-consumer/pom.xml b/dubbo-demo/dubbo-demo-consumer/pom.xml
index f8b730cd83..542ca47a9f 100644
--- a/dubbo-demo/dubbo-demo-consumer/pom.xml
+++ b/dubbo-demo/dubbo-demo-consumer/pom.xml
@@ -40,6 +40,16 @@ limitations under the License.
             <artifactId>dubbo</artifactId>
             <version>${project.parent.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>dubbo-cache-memcached</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>dubbo-cache-redis</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
         <dependency>
             <groupId>com.101tec</groupId>
             <artifactId>zkclient</artifactId>
diff --git a/dubbo-demo/dubbo-demo-consumer/src/main/java/com/alibaba/dubbo/demo/consumer/ConsumerCache.java b/dubbo-demo/dubbo-demo-consumer/src/main/java/com/alibaba/dubbo/demo/consumer/ConsumerCache.java
new file mode 100644
index 0000000000..8775aa8ef7
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-consumer/src/main/java/com/alibaba/dubbo/demo/consumer/ConsumerCache.java
@@ -0,0 +1,46 @@
+package com.alibaba.dubbo.demo.consumer;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import com.alibaba.dubbo.demo.DemoBean;
+import com.alibaba.dubbo.demo.DemoCacheService;
+
+public class ConsumerCache {
+	
+	public static void main(String[] args) {
+        //Prevent to get IPV6 address,this way only work in debug mode
+        //But you can pass use -Djava.net.preferIPv4Stack=true,then it work well whether in debug mode or not
+        System.setProperty("java.net.preferIPv4Stack", "true");
+        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/dubbo-demo-cache-consumer.xml"});
+        context.start();
+        DemoCacheService demoCacheService = (DemoCacheService) context.getBean("demoCacheService"); // get remote service proxy
+
+        while (true) {
+            try {
+                /*String hello = demoService.sayHello("world"); // call remote method
+                System.out.println(hello); // get result
+                */
+                DemoBean bean = demoCacheService.getBeanById(100);
+                System.out.println(bean.getName());
+                
+                bean = demoCacheService.getBean(bean);
+                System.out.println(bean.getName());
+                
+                bean.setName("name by consumer");
+                demoCacheService.setBean(bean);
+                
+                bean = demoCacheService.getBean(bean);
+                System.out.println(bean.getName());
+                
+
+                Thread.sleep(100000);
+            } catch (Throwable throwable) {
+                throwable.printStackTrace();
+            }
+
+
+        }
+
+    }
+
+}
diff --git a/dubbo-demo/dubbo-demo-consumer/src/main/resources/META-INF/spring/dubbo-demo-cache-consumer.xml b/dubbo-demo/dubbo-demo-consumer/src/main/resources/META-INF/spring/dubbo-demo-cache-consumer.xml
new file mode 100644
index 0000000000..657b20c074
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-consumer/src/main/resources/META-INF/spring/dubbo-demo-cache-consumer.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+       xmlns="http://www.springframework.org/schema/beans"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+
+    <!-- consumer's application name, used for tracing dependency relationship (not a matching criterion),
+    don't set it same as provider -->
+    <dubbo:application name="demo-consumer"/>
+
+    <!-- use multicast registry center to discover service -->
+    <dubbo:registry address="zookeeper://127.0.0.1:2181"/>
+
+    <!-- generate proxy for the remote service, then demoService can be used in the same way as the
+    local regular interface -->
+    <dubbo:reference id="demoCacheService" check="false" interface="com.alibaba.dubbo.demo.DemoCacheService"/>
+
+</beans>
\ No newline at end of file
diff --git a/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/DemoCacheServiceImpl.java b/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/DemoCacheServiceImpl.java
new file mode 100644
index 0000000000..093801f2c3
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/DemoCacheServiceImpl.java
@@ -0,0 +1,27 @@
+package com.alibaba.dubbo.demo.provider;
+
+import com.alibaba.dubbo.demo.DemoBean;
+import com.alibaba.dubbo.demo.DemoCacheService;
+
+public class DemoCacheServiceImpl implements DemoCacheService {
+	
+	@Override
+	public DemoBean getBeanById(int id) {
+		DemoBean bean = new DemoBean();
+		bean.setId(id);
+		bean.setName("name_" + id);
+		return bean;
+	}
+	
+	@Override
+	public DemoBean getBean(DemoBean bean) {
+		bean.setName(bean.getName() + " add " + bean.getName());
+		return bean;
+	}
+	
+	@Override
+	public void setBean(DemoBean bean) {
+		
+	}
+
+}
diff --git a/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/ProviderCache.java b/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/ProviderCache.java
new file mode 100644
index 0000000000..187d4e2d9a
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/ProviderCache.java
@@ -0,0 +1,17 @@
+package com.alibaba.dubbo.demo.provider;
+
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class ProviderCache {
+	
+	public static void main(String[] args) throws Exception {
+        //Prevent to get IPV6 address,this way only work in debug mode
+        //But you can pass use -Djava.net.preferIPv4Stack=true,then it work well whether in debug mode or not
+        System.setProperty("java.net.preferIPv4Stack", "true");
+        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"META-INF/spring/dubbo-demo-cache-provider.xml"});
+        context.start();
+
+        System.in.read(); // press any key to exit
+    }
+
+}
diff --git a/dubbo-demo/dubbo-demo-provider/src/main/resources/META-INF/spring/dubbo-demo-cache-provider.xml b/dubbo-demo/dubbo-demo-provider/src/main/resources/META-INF/spring/dubbo-demo-cache-provider.xml
new file mode 100644
index 0000000000..d20f45db2c
--- /dev/null
+++ b/dubbo-demo/dubbo-demo-provider/src/main/resources/META-INF/spring/dubbo-demo-cache-provider.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
+       xmlns="http://www.springframework.org/schema/beans"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
+
+    <!-- provider's application name, used for tracing dependency relationship -->
+    <dubbo:application name="demo-provider"/>
+
+    <!-- use multicast registry center to export service -->
+    <dubbo:registry address="zookeeper://127.0.0.1:2181"/>
+
+    <!-- use dubbo protocol to export service on port 20880 -->
+    <dubbo:protocol name="dubbo" port="20880"/>
+    
+    <!-- use cache -->
+    <dubbo:cacheServer id="demoCache" protocol="memcached" address="localhost:11211" prefix="demo_" user="" password="" timeout="30"/>
+
+    <!-- service implementation, as same as regular local bean -->
+    <bean id="demoCacheService" class="com.alibaba.dubbo.demo.provider.DemoCacheServiceImpl"/>
+
+    <!-- declare the service interface to be exported -->
+    <dubbo:service interface="com.alibaba.dubbo.demo.DemoCacheService" ref="demoCacheService"/>
+    
+    <dubbo:cache service="com.alibaba.dubbo.demo.DemoCacheService" server="demoCache">
+    	<dubbo:buffer key="bean_{id}" method="getBeanById" command="get" timeout="600"/>
+    	<dubbo:buffer key="bean_{bean.id}" method="getBean" command="get" timeout="600"/>
+    	<dubbo:buffer key="bean_{bean.id}" method="setBean" command="delete"/>
+    </dubbo:cache>
+
+</beans>
\ No newline at end of file
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryDirectory.java b/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryDirectory.java
index 5a03636ffc..c84fe7bd58 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryDirectory.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryDirectory.java
@@ -364,6 +364,7 @@ private void refreshInvoker(List<URL> invokerUrls) {
                 continue;
             }
             URL url = mergeUrl(providerUrl);
+            url.setData(providerUrl.getData());//skykong1981
 
             String key = url.toFullString(); // The parameter urls are sorted
             if (keys.contains(key)) { // Repeated url
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java b/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java
index 14a516137f..04b1787eb9 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java
@@ -242,12 +242,14 @@ private URL getSubscribedOverrideUrl(URL registedProviderUrl) {
      * @return
      */
     private URL getProviderUrl(final Invoker<?> origininvoker) {
+    	URL originURL = origininvoker.getUrl();//skykong1981
         String export = origininvoker.getUrl().getParameterAndDecoded(Constants.EXPORT_KEY);
         if (export == null || export.length() == 0) {
             throw new IllegalArgumentException("The registry export url is null! registry: " + origininvoker.getUrl());
         }
 
         URL providerUrl = URL.valueOf(export);
+        providerUrl.setData(originURL.getData());//skykong1981
         return providerUrl;
     }
 
diff --git a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java
index 6830104aea..128cbaf630 100644
--- a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java
+++ b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/com/alibaba/dubbo/registry/zookeeper/ZookeeperRegistry.java
@@ -107,7 +107,14 @@ public void destroy() {
 
     protected void doRegister(URL url) {
         try {
-            zkClient.create(toUrlPath(url), url.getParameter(Constants.DYNAMIC_KEY, true));
+            //zkClient.create(toUrlPath(url), url.getParameter(Constants.DYNAMIC_KEY, true));
+            
+            String data = url.getData();//skykong
+        	if (data == null || data.equals("")) {
+        		zkClient.create(toUrlPath(url), url.getParameter(Constants.DYNAMIC_KEY, true));
+        	} else {
+        		zkClient.create(toUrlPath(url), data, url.getParameter(Constants.DYNAMIC_KEY, true));
+        	}
         } catch (Throwable e) {
             throw new RpcException("Failed to register " + url + " to zookeeper " + getUrl() + ", cause: " + e.getMessage(), e);
         }
@@ -168,15 +175,29 @@ public void childChanged(String parentPath, List<String> currentChilds) {
                     if (zkListener == null) {
                         listeners.putIfAbsent(listener, new ChildListener() {
                             public void childChanged(String parentPath, List<String> currentChilds) {
-                                ZookeeperRegistry.this.notify(url, listener, toUrlsWithEmpty(url, parentPath, currentChilds));
+                                //ZookeeperRegistry.this.notify(url, listener, toUrlsWithEmpty(url, parentPath, currentChilds));
+                            	//skykong1981
+                            	List<String> childData = new ArrayList<String>();
+                                for (String child : currentChilds) {
+                                	childData.add(zkClient.get(parentPath + "/" + child));
+                                }
+                                ZookeeperRegistry.this.notify(url, listener, toUrlsWithEmpty(url, parentPath, currentChilds, childData));
+                                //skykong1981
                             }
                         });
                         zkListener = listeners.get(listener);
                     }
                     zkClient.create(path, false);
                     List<String> children = zkClient.addChildListener(path, zkListener);
+                    //skykong1981
+                    List<String> childData = new ArrayList<String>();
+                    for (String child : children) {
+                    	childData.add(zkClient.get(path + "/" + child));
+                    }
+                    //skykong1981
                     if (children != null) {
-                        urls.addAll(toUrlsWithEmpty(url, path, children));
+                        //urls.addAll(toUrlsWithEmpty(url, path, children));
+                    	urls.addAll(toUrlsWithEmpty(url, path, children, childData));
                     }
                 }
                 notify(url, listener, urls);
@@ -206,6 +227,12 @@ protected void doUnsubscribe(URL url, NotifyListener listener) {
                 List<String> children = zkClient.getChildren(path);
                 if (children != null) {
                     providers.addAll(children);
+                    //skykong1981
+                    for (String cpath : children) {
+                    	String data = zkClient.get(cpath);
+                    	url.setData(data);
+                    }
+                    //skykong1981
                 }
             }
             return toUrlsWithoutEmpty(url, providers);
@@ -272,7 +299,7 @@ private String toUrlPath(URL url) {
         return urls;
     }
 
-    private List<URL> toUrlsWithEmpty(URL consumer, String path, List<String> providers) {
+    /*private List<URL> toUrlsWithEmpty(URL consumer, String path, List<String> providers) {
         List<URL> urls = toUrlsWithoutEmpty(consumer, providers);
         if (urls == null || urls.isEmpty()) {
             int i = path.lastIndexOf('/');
@@ -281,6 +308,23 @@ private String toUrlPath(URL url) {
             urls.add(empty);
         }
         return urls;
+    }*/
+    //skykong1981
+    private List<URL> toUrlsWithEmpty(URL consumer, String path, List<String> providers, List<String> childData) {
+        List<URL> urls = toUrlsWithoutEmpty(consumer, providers);
+        if (urls == null || urls.isEmpty()) {
+        	int i = path.lastIndexOf('/');
+        	String category = i < 0 ? path : path.substring(i + 1);
+        	URL empty = consumer.setProtocol(Constants.EMPTY_PROTOCOL).addParameter(Constants.CATEGORY_KEY, category);
+            urls.add(empty);
+        }
+        for (int i=0; i<urls.size(); i++) {
+        	URL url = urls.get(i);
+        	if (!"empty".equals(url.getProtocol())) {
+        		url.setData(childData.get(i));
+        	}
+        }
+        return urls;
     }
 
 }
\ No newline at end of file
diff --git a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/ZookeeperClient.java b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/ZookeeperClient.java
index f4132a2a54..ed271578dc 100644
--- a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/ZookeeperClient.java
+++ b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/ZookeeperClient.java
@@ -22,11 +22,17 @@
 
 public interface ZookeeperClient {
 
-    void create(String path, boolean ephemeral);
+	void create(String path, boolean ephemeral);
+	
+	//skykong1981
+	void create(String path, String data, boolean ephemeral);
 
     void delete(String path);
 
     List<String> getChildren(String path);
+    
+    //skykong1981
+  	String get(String path);
 
     List<String> addChildListener(String path, ChildListener listener);
 
diff --git a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java
index 33ddf43d24..86ae2cb7bc 100644
--- a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java
+++ b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/curator/CuratorZookeeperClient.java
@@ -86,6 +86,26 @@ public void createEphemeral(String path) {
             throw new IllegalStateException(e.getMessage(), e);
         }
     }
+    
+    //skykong1981
+    public void createPersistent(String path, String data) {
+		try {
+			client.create().forPath(path, data.getBytes());
+		} catch (NodeExistsException e) {
+		} catch (Exception e) {
+			throw new IllegalStateException(e.getMessage(), e);
+		}
+	}
+
+	public void createEphemeral(String path, String data) {
+		try {
+			client.create().withMode(CreateMode.EPHEMERAL).forPath(path, data.getBytes());
+		} catch (NodeExistsException e) {
+		} catch (Exception e) {
+			throw new IllegalStateException(e.getMessage(), e);
+		}
+	}
+    //skykong1981
 
     public void delete(String path) {
         try {
@@ -105,6 +125,22 @@ public void delete(String path) {
             throw new IllegalStateException(e.getMessage(), e);
         }
     }
+    
+    //skykong1981
+    public String get(String path) {
+		try {
+			byte []buf = client.getData().forPath(path);
+			if (buf != null && buf.length > 0) {
+				return new String(buf);
+			} else {
+				return null;
+			}
+		} catch (NoNodeException e) {
+			return null;
+		} catch (Exception e) {
+			throw new IllegalStateException(e.getMessage(), e);
+		}
+	}
 
     public boolean checkExists(String path) {
         try {
diff --git a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java
index 0b4070adca..5c84973137 100644
--- a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java
+++ b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/support/AbstractZookeeperClient.java
@@ -50,18 +50,40 @@ public URL getUrl() {
     }
 
     public void create(String path, boolean ephemeral) {
+		logger.info("zkclient create path=" + path);
+		int i = path.lastIndexOf('/');
+		if (i > 0) {
+			create(path.substring(0, i), false);
+		}
+		if (ephemeral) {
+			createEphemeral(path);
+		} else {
+			createPersistent(path);
+		}
+	}
+    
+    //skykong1981
+    public void create(String path, String data, boolean ephemeral) {
         int i = path.lastIndexOf('/');
         if (i > 0) {
             String parentPath = path.substring(0, i);
             if (!checkExists(parentPath)) {
                 create(parentPath, false);
             }
-        }
-        if (ephemeral) {
-            createEphemeral(path);
-        } else {
-            createPersistent(path);
-        }
+        }        
+        if (data == null || data.equals("")) {
+			if (ephemeral) {
+				createEphemeral(path);
+			} else {
+				createPersistent(path);
+			}
+		} else {
+			if (ephemeral) {
+				createEphemeral(path, data);
+			} else {
+				createPersistent(path, data);
+			}
+		}
     }
 
     public void addStateListener(StateListener listener) {
@@ -123,7 +145,13 @@ public void close() {
     protected abstract void createPersistent(String path);
 
     protected abstract void createEphemeral(String path);
+    
+    //skykong1981
+    protected abstract void createPersistent(String path, String data);
 
+	protected abstract void createEphemeral(String path, String data);
+	//skykong1981
+	
     protected abstract boolean checkExists(String path);
 
     protected abstract TargetChildListener createTargetChildListener(String path, ChildListener listener);
diff --git a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkClientWrapper.java b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkClientWrapper.java
index 3ed350aba0..3754618564 100644
--- a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkClientWrapper.java
+++ b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkClientWrapper.java
@@ -103,6 +103,18 @@ public void createEphemeral(String path) {
         Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
         client.createEphemeral(path);
     }
+    
+    //skykong1981
+    public void createPersistent(String path, String data) {
+        Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
+        client.createPersistent(path, data);
+    }
+
+    public void createEphemeral(String path, String data) {
+        Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
+        client.createEphemeral(path, data);
+    }
+    //skykong1981
 
     public void delete(String path) {
         Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
@@ -113,6 +125,12 @@ public void delete(String path) {
         Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
         return client.getChildren(path);
     }
+    
+    //skykong1981
+    public String get(String path) {
+    	Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
+    	return client.readData(path, true);
+    }
 
     public boolean exists(String path) {
         Assert.notNull(client, new IllegalStateException("Zookeeper is not connected yet!"));
diff --git a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
index a8b4466c1a..58622de25a 100644
--- a/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
+++ b/dubbo-remoting/dubbo-remoting-zookeeper/src/main/java/com/alibaba/dubbo/remoting/zookeeper/zkclient/ZkclientZookeeperClient.java
@@ -69,6 +69,20 @@ public void createEphemeral(String path) {
         } catch (ZkNodeExistsException e) {
         }
     }
+    
+    public void createPersistent(String path, String data) {
+		try {
+			client.createPersistent(path, data);
+		} catch (ZkNodeExistsException e) {
+		}
+	}
+
+	public void createEphemeral(String path, String data) {
+		try {
+			client.createEphemeral(path, data);
+		} catch (ZkNodeExistsException e) {
+		}
+	}
 
     public void delete(String path) {
         try {
@@ -84,6 +98,15 @@ public void delete(String path) {
             return null;
         }
     }
+    
+    //skykong1981
+    public String get(String path) {
+		try {
+			return client.get(path);
+        } catch (ZkNoNodeException e) {
+            return null;
+        }
+	}
 
     public boolean checkExists(String path) {
         try {
diff --git a/dubbo-rpc/dubbo-rpc-default/pom.xml b/dubbo-rpc/dubbo-rpc-default/pom.xml
index 46518847ba..82c5fee454 100644
--- a/dubbo-rpc/dubbo-rpc-default/pom.xml
+++ b/dubbo-rpc/dubbo-rpc-default/pom.xml
@@ -51,6 +51,11 @@ limitations under the License.
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>dubbo-cache-api</artifactId>
+			<version>${project.parent.version}</version>
+		</dependency>
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>dubbo-remoting-netty</artifactId>
diff --git a/dubbo-rpc/dubbo-rpc-default/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboInvoker.java b/dubbo-rpc/dubbo-rpc-default/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboInvoker.java
index a5624fd76c..a8de68bfbc 100644
--- a/dubbo-rpc/dubbo-rpc-default/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboInvoker.java
+++ b/dubbo-rpc/dubbo-rpc-default/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboInvoker.java
@@ -16,6 +16,17 @@
  */
 package com.alibaba.dubbo.rpc.protocol.dubbo;
 
+import java.lang.reflect.Field;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.locks.ReentrantLock;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.alibaba.dubbo.cache.CacheService;
+import com.alibaba.dubbo.cache.DubboCacheFactory;
+import com.alibaba.dubbo.cache.common.DubboBuffer;
+import com.alibaba.dubbo.cache.common.DubboCache;
 import com.alibaba.dubbo.common.Constants;
 import com.alibaba.dubbo.common.URL;
 import com.alibaba.dubbo.common.utils.AtomicPositiveInteger;
@@ -34,9 +45,6 @@
 import com.alibaba.dubbo.rpc.protocol.AbstractInvoker;
 import com.alibaba.dubbo.rpc.support.RpcUtils;
 
-import java.util.Set;
-import java.util.concurrent.locks.ReentrantLock;
-
 /**
  * DubboInvoker
  */
@@ -52,6 +60,8 @@
 
     private final Set<Invoker<?>> invokers;
 
+    private DubboCache dubboCache;//skykong1981
+    
     public DubboInvoker(Class<T> serviceType, URL url, ExchangeClient[] clients) {
         this(serviceType, url, clients, null);
     }
@@ -62,6 +72,11 @@ public DubboInvoker(Class<T> serviceType, URL url, ExchangeClient[] clients, Set
         // get version.
         this.version = url.getParameter(Constants.VERSION_KEY, "0.0.0");
         this.invokers = invokers;
+        //skykong1981
+        String cacheData = url.getData();
+        if (cacheData != null && !cacheData.isEmpty()) {
+        	dubboCache = new DubboCache(cacheData);
+        }
     }
 
     @Override
@@ -70,6 +85,59 @@ protected Result doInvoke(final Invocation invocation) throws Throwable {
         final String methodName = RpcUtils.getMethodName(invocation);
         inv.setAttachment(Constants.PATH_KEY, getUrl().getPath());
         inv.setAttachment(Constants.VERSION_KEY, version);
+        
+        //skykong1981
+        Object[] args = invocation.getArguments();        
+        boolean needRemoteCall = true;
+        boolean needRemoteCache = false;
+        String cacheKey = null;
+        Object cacheValue = null;
+        int cacheTimeout = 0;
+        CacheService cacheService = null;
+        if (dubboCache != null) {
+    		try {
+    			cacheService = DubboCacheFactory.getCacheService(dubboCache);
+            	if (cacheService != null && cacheService.isConnected()) {
+            		Map<String, DubboBuffer> bufferMap = dubboCache.getBufferMap();
+            		DubboBuffer buffer = bufferMap.get(methodName);
+            		if (buffer != null) {//configed cache in this function
+                		String command = buffer.getCommand();
+                		if (command.equals("get")) {
+                			String key = buffer.getKey();
+                			cacheKey = getCacheKey(key, args);
+                			cacheValue = cacheService.get(cacheKey);
+                			cacheTimeout = buffer.getTimeout();
+                			if (cacheValue != null) {
+                				if (logger.isDebugEnabled()) {
+                					logger.debug("Cache contains key : " + cacheKey);
+                				}
+                				needRemoteCall = false;
+                			} else {
+                				if (logger.isDebugEnabled()) {
+                					logger.debug("Cache doesn't contain key : " + cacheKey);
+                				}
+                				needRemoteCache = true;
+                			}
+                		} else {//command is delete
+                			String[] keys = buffer.getKeys();
+                			for (String key : keys) {
+                    			cacheKey = getCacheKey(key, args);
+                    			cacheService.delete(cacheKey);
+                			}
+                		}
+            		}
+            	}
+    		} catch (Exception e) {
+    			logger.warn("Get result from remote cache error!", e);
+    			needRemoteCall = true;
+    	        needRemoteCache = false;
+    		}
+    	}
+        
+        if (!needRemoteCall) {
+        	return new RpcResult(cacheValue);
+        }
+        //skykong1981
 
         ExchangeClient currentClient;
         if (clients.length == 1) {
@@ -92,7 +160,21 @@ protected Result doInvoke(final Invocation invocation) throws Throwable {
                 return new RpcResult();
             } else {
                 RpcContext.getContext().setFuture(null);
-                return (Result) currentClient.request(inv, timeout).get();
+                //return (Result) currentClient.request(inv, timeout).get();
+                //skykong1981
+            	RpcResult rpcResult = (RpcResult) currentClient.request(inv, timeout).get();
+            	if (needRemoteCache) {
+            		Object value = rpcResult.getValue();
+            		if (value != null) {
+            			if (cacheTimeout == 0) {
+            				cacheService.put(cacheKey, value);
+            			} else {
+            				cacheService.put(cacheKey, value, cacheTimeout);
+            			}
+            		}
+            	}
+            	return rpcResult;
+            	//skykong1981
             }
         } catch (TimeoutException e) {
             throw new RpcException(RpcException.TIMEOUT_EXCEPTION, "Invoke remote method timeout. method: " + invocation.getMethodName() + ", provider: " + getUrl() + ", cause: " + e.getMessage(), e);
@@ -138,10 +220,50 @@ public void destroy() {
                         logger.warn(t.getMessage(), t);
                     }
                 }
-
+                //skykong1981
+                if (dubboCache != null) {
+                	try {
+                		CacheService cacheService = DubboCacheFactory.getCacheService(dubboCache);
+                		if (cacheService != null) {
+                			cacheService.shutdown();
+                			DubboCacheFactory.removeCacheService(dubboCache);
+                		}
+                	} catch (Throwable t) {
+                        logger.warn(t.getMessage(), t);
+                    }
+                }
+                //skykong1981
             } finally {
                 destroyLock.unlock();
             }
         }
     }
+    
+    private String getCacheKey(String key, Object[] args) throws Exception {
+        String regex = "\\{(.*?)\\}";
+        Pattern p = Pattern.compile(regex);
+        Matcher m = p.matcher(key);
+        while (m.find()) {
+            String k = m.group();
+            if (k.indexOf(".") == -1) {
+            	int idx = Integer.parseInt(k.substring(1, k.length() - 1));
+            	key = key.replaceFirst("\\{" + idx + "\\}", String.valueOf(args[idx - 1]));
+            } else {
+            	String nk = k.substring(1, k.length() - 1);//1.userid
+            	String[] nkAry = nk.split("\\.");
+            	int idx = Integer.parseInt(nkAry[0]);//1
+            	String fieldName = nkAry[1];//userid
+            	Object paramObj = args[idx - 1];//User
+            	
+            	Class<? extends Object> clazz = paramObj.getClass();
+            	Field field = clazz.getDeclaredField(fieldName);//userid
+    			field.setAccessible(true);
+    			String paramValue = String.valueOf(field.get(paramObj));//userid's value
+    			key = key.replaceFirst("\\{" + nk + "\\}", paramValue);
+        		
+            }
+        }
+        return dubboCache.getPrefix() + key;
+    }
+    
 }
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index a873282384..a2649cc28a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,6 +46,7 @@ limitations under the License.
         <module>dubbo-registry</module>
         <module>dubbo-monitor</module>
         <module>dubbo-config</module>
+		<module>dubbo-cache</module>
         <module>dubbo</module>
         <module>dubbo-simple</module>
         <module>dubbo-admin</module>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org