Admin
:
New post
분류 전..
(121)
공지사항
(3)
주저리..
(26)
Ubuntu
(3)
개발관련
(36)
Web 성능..
(3)
개발노트
(23)
검색
(0)
주말스터디
(7)
Error Note
(3)
개발이야기
(6)
Language
(20)
Flex
(1)
ABAP
(18)
C#
(1)
Java Scr..
(0)
Framework
(5)
Struts2
(4)
Spring
(1)
Pattern
(2)
Core J2E..
(0)
POSA1
(0)
용어사전
(2)
DataBase
(4)
Oracle
(4)
Server
(4)
Was
(4)
Book
(9)
스터디
(0)
미디어로그
Ubuntu Netboo..
차분하게 한걸..
이럴수가 우리..
(2)
Chapter 8. S..
Dispatch
Eclipse
mylyn
oracle
STRUTS2
db connection
Head First Software Development
HFSD
자바
다짐
WebtoB
ㅋㅋㅋㅋㅋㅋㅋ
아놔 당황스러..
Bean이란놈이..
와오 포스팅..
화이팅이에용~..
«
2010/09
»
일
월
화
수
목
금
토
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
2010/09
2010/07
2010/03
2010/01
2009/12
+ dazzi님 블로그
+ kenu blog
+ OKJSP: 사는..
+ 루비나라 출입구
+ 온 오프 믹스!..
+ 은정이누나 블롯
+ 자바지기님 블..
+ 정호님 블로그
+ 존경하는회수..
+ Total : 22,770
+ Today : 4
+ Yesterday : 10
티스토리 가입하기!
Framework/Spring
_해당되는 글
1건
2010/01/05
Chapter 8. Spring 원격 서비스 (기반지식 - RMI 예제)
Chapter 8. Spring 원격 서비스 (기반지식 - RMI 예제)
+
[Framework/Spring]
| 2010/01/05 13:27
Hello Interface
import java.rmi.Remote; import java.rmi.RemoteException; public interface Hello extends Remote { String sayHello(String name) throws RemoteException; }
HelloImpl
import java.rmi.RemoteException; import java.rmi.server.UnicastRemoteObject; /** * @author one */ public class HelloImpl extends UnicastRemoteObject implements Hello { private static final long serialVersionUID = -108803614752673050L; protected HelloImpl() throws RemoteException { super(); } /* (non-Javadoc) * @see hello.Hello#sayHello(java.lang.String) */ @Override public String sayHello(String name) throws RemoteException { return name + "씨 안녕하세요?"; } }
HelloServer
import java.rmi.Naming; public class HelloServer { public static void main(String args[]){ try { Hello hello = new HelloImpl(); Naming.bind("hello", hello); System.out.println(hello+ " 이 준비되었습니다."); } catch (Exception e) { System.out.println(e); } } }
HelloClient
import java.io.BufferedReader; import java.io.InputStreamReader; import java.rmi.Naming; import java.rmi.RMISecurityManager; public class HelloClient { public static void main(String[] args) { System.setSecurityManager(new RMISecurityManager()); try { Hello hello = (Hello) Naming.lookup("rmi://jjung/hello"); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String name = in.readLine(); String message = ""; message = hello.sayHello(name); System.out.println(message); } catch (Exception e) { System.out.println(e); } } }
준비물은 이 정도!
RMI
,
rmi 예제
,
sayHello
0
0
이 글의 관련글(트랙백) 주소 ::
http://hanoori.pe.kr/trackback/139
아이디
비밀번호
홈페이지
비밀글
<<이전
|
1
|
다음>>
별책부록
's Blog is powered by
Daum