Merge branch 'master' of github.com:redisson/redisson
commit
083065c332
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright 2016 Nikita Koksharov
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
package org.redisson.misc;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rui Gu (https://github.com/jackygurui)
|
||||
*/
|
||||
public class URIBuilder {
|
||||
|
||||
public static URI create(String uri) {
|
||||
URI u = URI.create(uri);
|
||||
//Let's assuming most of the time it is OK.
|
||||
if (u.getHost() != null) {
|
||||
return u;
|
||||
}
|
||||
String s = uri.substring(0, uri.lastIndexOf(":"))
|
||||
.replaceFirst("redis://", "")
|
||||
.replaceFirst("rediss://", "");
|
||||
//Assuming this is an IPv6 format, other situations will be handled by
|
||||
//Netty at a later stage.
|
||||
return URI.create(uri.replace(s, "[" + s + "]"));
|
||||
}
|
||||
|
||||
}
|
@ -1,2 +1,3 @@
|
||||
http\://redisson.org/schema/redisson/redisson.xsd=org/redisson/spring/support/redisson-1.0.xsd
|
||||
http\://redisson.org/schema/redisson/redisson.xsd=org/redisson/spring/support/redisson-1.1.xsd
|
||||
http\://redisson.org/schema/redisson/redisson-1.0.xsd=org/redisson/spring/support/redisson-1.0.xsd
|
||||
http\://redisson.org/schema/redisson/redisson-1.1.xsd=org/redisson/spring/support/redisson-1.1.xsd
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:redisson="http://redisson.org/schema/redisson"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
||||
http://redisson.org/schema/redisson classpath:org/redisson/spring/support/redisson-1.1.xsd
|
||||
">
|
||||
<bean id="myExecutor" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
|
||||
<property name="staticMethod" value="java.util.concurrent.Executors.newFixedThreadPool"/>
|
||||
<property name="arguments" value="8"/>
|
||||
</bean>
|
||||
<bean id="myEventLoopGroup" class="io.netty.channel.nio.NioEventLoopGroup"/>
|
||||
<bean id="myTimer" class="io.netty.util.HashedWheelTimer"/>
|
||||
|
||||
<redisson:redis
|
||||
id="redisClient"
|
||||
name="redisClient1,redisClient2"
|
||||
address="redis://127.0.0.1:6379"
|
||||
timer-ref="myTimer"
|
||||
executor-ref="myExecutor"
|
||||
group-ref="myEventLoopGroup"
|
||||
socket-channel-class="io.netty.channel.socket.nio.NioSocketChannel"
|
||||
connect-timeout="2000"
|
||||
command-timeout="10000"
|
||||
ssl-enable-endpoint-identification="true"
|
||||
ssl-provider="JDK"
|
||||
ssl-truststore="/tmp/truststore.p12"
|
||||
ssl-truststore-password="no_pass"
|
||||
ssl-keystore="/tmp/keystore.p12"
|
||||
ssl-keystore-password="no_pass"
|
||||
password="do_not_use_if_it_is_not_set"
|
||||
database="1"
|
||||
client-name="myClient"
|
||||
read-only="false"
|
||||
>
|
||||
<!--
|
||||
You can't have both name attribute and qualifier element at
|
||||
the same time.
|
||||
|
||||
Both id attribute and name attribute can be used as qualifier
|
||||
candidates.
|
||||
-->
|
||||
<!--<qualifier value="redisClient3"/>-->
|
||||
</redisson:redis>
|
||||
</beans>
|
Loading…
Reference in New Issue