-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
雷威
committed
Oct 17, 2016
1 parent
d5e2871
commit 14a7b69
Showing
19 changed files
with
320 additions
and
49 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
dubbox2.8.4-spring3-dubbo/api/src/main/java/com/leolei/dubbodemo/api/ICar.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.leolei.dubbodemo.api; | ||
|
||
import java.io.Serializable; | ||
|
||
public interface ICar extends Serializable { | ||
public String start(); | ||
} |
6 changes: 6 additions & 0 deletions
6
dubbox2.8.4-spring3-dubbo/api/src/main/java/com/leolei/dubbodemo/api/ICarService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.leolei.dubbodemo.api; | ||
|
||
public interface ICarService { | ||
|
||
public String start(String name,ICar car); | ||
} |
5 changes: 5 additions & 0 deletions
5
dubbox2.8.4-spring3-dubbo/api/src/main/java/com/leolei/dubbodemo/api/IFileService2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.leolei.dubbodemo.api; | ||
|
||
public interface IFileService2 { | ||
public void upload(String destPath, byte[] bytes); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ | |
public interface IUserService { | ||
|
||
User getUser(String name); | ||
|
||
String getName(User user); | ||
} |
4 changes: 3 additions & 1 deletion
4
dubbox2.8.4-spring3-dubbo/api/src/main/java/com/leolei/dubbodemo/api/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
....4-spring3-dubbo/consumer/src/main/java/com/leolei/dubbodemo/consumer/controller/BMW.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.leolei.dubbodemo.consumer.controller; | ||
|
||
import com.leolei.dubbodemo.api.ICar; | ||
|
||
public class BMW implements ICar { | ||
|
||
private final String name = "BMW"; | ||
|
||
@Override | ||
public String start() { | ||
return starting() + "......"; | ||
} | ||
|
||
private String starting(){ | ||
StringBuffer sb = new StringBuffer(); | ||
sb.append(name).append("is starting"); | ||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...x2.8.4-spring3-dubbo/provider/src/main/java/com/leolei/dubbodemo/provider/CarService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.leolei.dubbodemo.provider; | ||
|
||
import com.leolei.dubbodemo.api.ICar; | ||
import com.leolei.dubbodemo.api.ICarService; | ||
|
||
public class CarService implements ICarService { | ||
@Override | ||
public String start(String name, ICar car) { | ||
String s = car.start(); | ||
return s + name; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
....8.4-spring3-dubbo/provider/src/main/java/com/leolei/dubbodemo/provider/FileService2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.leolei.dubbodemo.provider; | ||
|
||
import com.leolei.dubbodemo.api.IFileService2; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
|
||
public class FileService2 implements IFileService2 { | ||
@Override | ||
public void upload(String destPath, byte[] bytes) { | ||
|
||
try { | ||
int b = 0; | ||
//FileInputStream in = null; | ||
FileOutputStream out = null; | ||
try{ | ||
// 源文件路径 | ||
//in = new FileInputStream("D:\\text.txt"); | ||
// 结果文件路径 | ||
out = new FileOutputStream("/users/leiwei/baidu2.png"); | ||
|
||
for (int i =0; i < bytes.length;i++){ | ||
out.write(bytes[i]); | ||
} | ||
|
||
// while((b = stream.read()) != -1){ | ||
// out.write(b); | ||
// } | ||
//stream.close(); | ||
out.close(); | ||
}catch(FileNotFoundException e1){ | ||
System.out.println("file is not found!"); | ||
System.exit(-1); | ||
}catch(IOException e2){ | ||
System.out.println("文件复制错误!!"); | ||
System.exit(-1); | ||
} | ||
System.out.println("文件复制成功了~~!"); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
dubbox2.8.4-spring3-hessian/api/src/main/java/com/leolei/dubbodemo/api/IFileService2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.leolei.dubbodemo.api; | ||
|
||
import java.io.FileNotFoundException; | ||
import java.io.InputStream; | ||
|
||
public interface IFileService2 { | ||
public void upload(InputStream stream,String destPath) throws FileNotFoundException; | ||
} |
5 changes: 5 additions & 0 deletions
5
dubbox2.8.4-spring3-hessian/api/src/main/java/com/leolei/dubbodemo/api/IFileService3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.leolei.dubbodemo.api; | ||
|
||
public interface IFileService3 { | ||
public void upload(String destPath, byte[] bytes); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.