锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲av无码成人精品区在线播放 ,久久综合亚洲色一区二区三区,亚洲午夜久久久久久久久久http://blogjava.net/fanjs2000/category/50493.htmlzh-cnSat, 21 May 2016 07:00:03 GMTSat, 21 May 2016 07:00:03 GMT60dubbohttp://www.tkk7.com/fanjs2000/archive/2016/05/04/430339.html鐚溂鐫?/dc:creator>鐚溂鐫?/author>Wed, 04 May 2016 09:03:00 GMThttp://www.tkk7.com/fanjs2000/archive/2016/05/04/430339.htmldubbo鏄樋閲屽反宸寸殑妗嗘灦錛屼富瑕佹湁4閮ㄥ垎緇勬垚錛? 鏈嶅姟鍙版彁渚涙柟錛?2 鏈嶅姟娉ㄥ唽鏂?3 鏈嶅姟娑堣垂鍒?4 鐩戞帶閮ㄥ垎

1. 娉ㄥ唽鏂逛竴鑸敤zookeeper, 鍏堜笅杞藉畨瑁咃紝鍚姩zkservece.cmd 浼氭姤閿欙紝闇瑕佷慨鏀歸厤緗枃浠?zoo.cfg. 璺緞涓璫onf/涓嬶紝錛屾病鏈夎嚜宸卞姞涓涓?br />姝e父鍚姩

2. 緙栧啓涓涓湇鍔″櫒绔? 鍒涘緩maven欏圭洰

pom.xml鏂囦歡

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>DubboService</groupId>
  <artifactId>DubboService</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build/>
          <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1.1</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>dubbo</artifactId>
                <version>2.5.3</version>
            </dependency>
            <dependency>
                <groupId>org.javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.18.1-GA</version>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.15</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.sun.jdmk</groupId>
                        <artifactId>jmxtools</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.sun.jmx</groupId>
                        <artifactId>jmxri</artifactId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jms</artifactId>
                        <groupId>javax.jms</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>mail</artifactId>
                        <groupId>javax.mail</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
                <version>2.5.6.SEC03</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.6</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.6.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>3.4.5</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>com.101tec</groupId>
                <artifactId>zkclient</artifactId>
                <version>0.4</version>
            </dependency>
        </dependencies>
      <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/libs-snapshot</url>
        </repository>
    </repositories>   
    
</project>

config/applicationProvider.xml  閰嶇疆鏂囦歡錛岄噷闈㈠畾涔変簡娉ㄥ唽鐨刡ean, 鍜寊ookeeper鐨勫湴鍧
<?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:dubbo="http://code.alibabatech.com/schema/dubbo"    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
    <dubbo:application name="hello-world" />
    <!-- 娉ㄥ唽鍦板潃 -->
     <dubbo:registry address="zookeeper://localhost:2181" />
     <dubbo:protocol name="dubbo" port="20880" />
        <!-- Service interface Concurrent Control -->
        <dubbo:service interface="cn.zto.service.IProcessData"    ref="demoService" executes="10" />
        <!-- designate implementation -->
        <bean id="demoService" class="cn.zto.service.impl.ProcessDataImpl" />
    </beans>
IProcessData瀹氫箟鎺ュ彛鍙婂疄鐜扮被
package cn.zto.service.impl;

import cn.zto.service.IProcessData;
public class ProcessDataImpl implements IProcessData {
public String hello(String name) {
    System.out.println(name);
    return "hello : " + name;
}}

package cn.zto.service;

public interface IProcessData {
    public String hello(String name);
}
鍚姩鏈嶅姟
package cn.zto.app;

import org.springframework.context.support.ClassPathXmlApplicationContext;
public class Main {
public static void main(String[] args) throws Exception {
     ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(    new String[] {
"config/applicationProvider.xml"
});
context.start();
System.out.println("鎸変換鎰忛敭閫鍑?);
System.in.read();
}}
榪愯璧鋒潵銆傚涓?/span>
log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
鎸変換鎰忛敭閫鍑?/div>


涓嬮潰鍐嶅緩涓涓猚lient紼嬪簭
pom.xml
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>DubboClient</groupId>
  <artifactId>DubboClient</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build/>
 
          <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.1.1</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>dubbo</artifactId>
                <version>2.5.3</version>
            </dependency>
            <dependency>
                <groupId>org.javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.18.1-GA</version>
            </dependency>
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.15</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.sun.jdmk</groupId>
                        <artifactId>jmxtools</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.sun.jmx</groupId>
                        <artifactId>jmxri</artifactId>
                    </exclusion>
                    <exclusion>
                        <artifactId>jms</artifactId>
                        <groupId>javax.jms</groupId>
                    </exclusion>
                    <exclusion>
                        <artifactId>mail</artifactId>
                        <groupId>javax.mail</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
                <version>2.5.6.SEC03</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.6</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.6.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>3.4.5</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>com.101tec</groupId>
                <artifactId>zkclient</artifactId>
                <version>0.4</version>
            </dependency>
        </dependencies>
 
 
      <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/libs-snapshot</url>
        </repository>
    </repositories>   
    
</project>


娉ㄥ唽鐨勬帴鍙g被錛屽拰瑕佹湇鍔″櫒绔殑鍖呰礬寰勪竴鑷?br />
package cn.zto.service;

public interface IProcessData {
    public String hello(String name);
}

瀹㈡埛绔殑閰嶇疆鏂囦歡錛屾帴鍙e畾涔夊強zookeeper鐨勫湴鍧
<?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:dubbo="http://code.alibabatech.com/schema/dubbo"    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd ">
    <dubbo:application name="consumer-of-helloworld-app" />
    <!-- 娉ㄥ唽鍦板潃 -->
     <dubbo:registry address="zookeeper://localhost:2181"/>
     <dubbo:consumer timeout="5000" />
     <dubbo:reference id="demoService" interface="cn.zto.service.IProcessData"/>
</beans>

瀹㈡埛绔惎鍔?br />
package cn.zto.consumer;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.zto.service.IProcessData;

public class ConsumerThd{
    
    
    
public void sayHello(){
ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext(    
new String[] {"config/applicationProvider.xml"});
context.start();
IProcessData demoService=(IProcessData) context.getBean("demoService");
System.out.println(demoService.hello("world"));
}


public static void main(String args[]){
    new ConsumerThd().sayHello();
}



}


榪愯緇撴灉濡備笅

log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
log4j:WARN Please initialize the log4j system properly.
hello : world


榪欐牱灝卞熀鏈疄鐜頒簡dubbo鐨勬鏋訛紝寰堢畝鍗曞惂






]]>spring boothttp://www.tkk7.com/fanjs2000/archive/2016/05/04/430337.html鐚溂鐫?/dc:creator>鐚溂鐫?/author>Wed, 04 May 2016 07:39:00 GMThttp://www.tkk7.com/fanjs2000/archive/2016/05/04/430337.html
1. pom 鏂囦歡錛?涓昏鍐欎緷璧栧叧緋伙紝
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.example</groupId>
    <artifactId>spring-boot</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-boot-example</name>
    
    <parent>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-parent</artifactId>
       <version>1.3.3.RELEASE</version>
    </parent>
    
    <!-- Add typical dependencies for a web application -->
    
    <dependencies>
        <dependency>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        
        
        
    </dependencies>

    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/libs-snapshot</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <url>http://repo.spring.io/libs-snapshot</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

2. 鐒跺悗灝辨槸鎻愪緵鐨勬帴鍙g被UserController錛?瀹炰綋綾籙ser錛?涓昏鏄嚑涓敞瑙?/span>
@RestController   l綾誨悓spring mvc 鐨凘Controller
@RequestMapping   綾誨悓spring mvc

package two;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")

public class UserController {

    @RequestMapping("/hello")
    public User view(){
        
        User user=new User();
        user.setId((long)100);
        user.setName("fanjs");
        return user;
        
        
    }

package two;

public class User {
private Long id;
private String name;
public Long getId() {
    return id;
}
public void setId(Long id) {
    this.id = id;
}
public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}


3.  鐒跺悗灝辨槸紼嬪簭鍚姩錛岃繖閲屼笉闇瑕乻pring xml鏂囦歡錛屽畬鍏ㄤ緷璧栨敞瑙c?/span>
@EnableAutoConfiguration
@Configuration
@ComponentScan

package two;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan
@EnableAutoConfiguration


public class RunMain {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        SpringApplication.run(RunMain.class, args);
    }

}

4.  嫻嬭瘯璺緞

http://localhost:8080/user/hello

{"id":100,"name":"fanjs"}








]]>
spring integrationhttp://www.tkk7.com/fanjs2000/archive/2013/11/28/406949.html鐚溂鐫?/dc:creator>鐚溂鐫?/author>Thu, 28 Nov 2013 08:15:00 GMThttp://www.tkk7.com/fanjs2000/archive/2013/11/28/406949.html


綆鍗曠殑閰嶇疆鏂囦歡
<beans:beans xmlns="http://www.springframework.org/schema/integration"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans
="http://www.springframework.org/schema/beans"
    xmlns:context
="http://www.springframework.org/schema/context"
    xsi:schemaLocation
="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/integration
        http://www.springframework.org/schema/integration/spring-integration-1.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-2.5.xsd"
>

    
<!-- 鍚姩Message bus 娑堟伅鏈嶅姟鎬葷嚎 鏀寔鍥涗釜灞炴?nbsp;
            auto-startup[boolean鏄惁鑷姩鍚姩 default=true]濡傛灉璁劇疆false錛屽垯闇瑕佹墜鍔ㄨ皟鐢╝pplicationContext.start()鏂規硶
            auto-create-channels[boolean鏄惁鑷姩娉ㄥ唽MessageChannel default=false]錛屽鏋滀嬌鐢ㄧ殑MessagChannle涓嶅瓨鍦?br />            error-channel 璁劇疆閿欒鏃朵俊鎭彂閫佺殑MessageChannle,濡傛灉涓嶈緗紝鍒欎嬌鐢―efaultErrorChannel
            dispatcher-pool-size 浣跨敤鐨勫惎鍔ㄧ嚎紼嬫暟錛岄粯璁や負10
-->
    
<message-bus/>
    
<!-- 鍚姩鏀寔鍏冩暟鎹爣璁?nbsp;-->
    
<annotation-driven/>
    
<!-- 璁劇疆 @Component鏍囪瘑鐨勫厓鏁版嵁鎵弿鍖?package) -->
    
<context:component-scan base-package="org.springframework.integration.samples.cafe"/>

        
<!-- 涓嬮潰鍚姩浜嗗洓涓?nbsp;MessageChannel鏈嶅姟 澶勭悊鎺ユ敹鍙戦佺鍙戣繃鏉ョ殑娑堟伅鍜屾妸娑堟伅嫻佽漿鍒版秷鎭殑娑堣垂绔?nbsp;-->
        
<!-- 灞炴ц鏄庯細 capacity 娑堟伅鏈澶у閲忛粯璁や負100 publish-subscribe鏄惁鏄彂甯冭闃呮ā寮忥紝榛樿涓哄惁
                                        id bean鐨刬d鍚嶇О datatype 錛?nbsp;
-->
    
<channel id="orders"/> <!-- 璁㈠崟Channel -->
    
<channel id="drinks"/> <!-- 楗枡璁㈠崟Channel錛屽鐞嗛ギ鏂欑殑綾誨埆 -->
    
<channel id="coldDrinks"/> <!-- 鐑ギ鐢熶駭Channel -->
    
<channel id="hotDrinks"/> <!-- 鍐烽ギ鐢熶駭Channel -->

        
<!-- 娑堟伅澶勭悊緇堢 鎺ユ敹 channel coldDrinks鐨勬秷鎭悗錛屾墽琛宐arista.prepareColdDrink鏂規硶 鐢熶駭鍐烽ギ -->
        
<!-- 灞炴ц鏄庯細 input-channel 鎺ユ敹娑堟伅鐨凜hannel蹇呴』 default-output-channel璁劇疆榛樿鍥炲娑堟伅Channel
                                        handler-ref 寮曠敤bean鐨刬d鍚嶇О handler-method Handler澶勭悊鏂規硶鍚?鍙傛暟綾誨瀷蹇呴』涓庡彂閫佹秷鎭殑payLoad浣跨敤鐨勪竴鑷?
                                        error-handler璁劇疆閿欒鏃朵俊鎭彂閫佺殑MessageChannle   reply-handler 娑堟伅鍥炲鐨凜hannel 
-->
    
<endpoint input-channel="coldDrinks" handler-ref="barista"
                                         handler-method
="prepareColdDrink"/>

        
<!-- 娑堟伅澶勭悊緇堢 鎺ユ敹 channel hotDrinks鐨勬秷鎭悗錛屾墽琛宐arista.prepareHotDrink鏂規硶 鐢熶駭鐑ギ -->
    
<endpoint input-channel="hotDrinks" handler-ref="barista"
                                        handler-method
="prepareHotDrink"/>

        
<!-- 瀹氫箟涓涓惎鍔ㄤ笅瀹氬崟鎿嶄綔鐨刡ean錛屽畠閫氳繃 channel orders涓嬪畾鍗?nbsp;-->
    
<beans:bean id="cafe" class="org.springframework.integration.samples.cafe.Cafe">
        
<beans:property name="orderChannel" ref="orders"/>
    
</beans:bean>
</beans:beans>


]]>
主站蜘蛛池模板: 亚洲日本在线免费观看| 可以免费观看的毛片| 五月亭亭免费高清在线| 久久精品国产精品亚洲毛片| 日本在线看片免费| 亚洲专区在线视频| 2021国产精品成人免费视频| 亚洲欧洲日本精品| 在线免费观看a级片| 亚洲av乱码中文一区二区三区| 免费涩涩在线视频网| 国产亚洲视频在线| 亚洲日本韩国在线| 永久免费A∨片在线观看| 亚洲AV人无码激艳猛片| 亚洲大片免费观看| 亚洲色成人WWW永久在线观看| 免费看a级黄色片| 一个人免费观看视频在线中文| 国产亚洲AV夜间福利香蕉149| 99在线视频免费观看| 一级做a爰全过程免费视频毛片| 亚洲福利精品电影在线观看| aa级女人大片喷水视频免费| 久久亚洲伊人中字综合精品| 日韩欧毛片免费视频| 美女羞羞视频免费网站| 亚洲AV午夜福利精品一区二区| 91成人在线免费视频| 亚洲av永久无码天堂网| 久久免费视频99| 亚洲精品午夜国产va久久| 五月婷婷亚洲综合| 无码成A毛片免费| 亚洲欧美国产欧美色欲| 亚洲愉拍99热成人精品热久久| 91禁漫免费进入| 九九全国免费视频| 亚洲人成在线中文字幕| 国产亚洲?V无码?V男人的天堂 | 亚洲高清在线视频|