Admin
:
New post
분류 전체보기
(122)
공지사항
(3)
주저리 주저리
(26)
Ubuntu
(3)
개발관련
(37)
Web 성능향상 방..
(3)
개발노트
(23)
검색
(0)
주말스터디
(7)
Error Note
(3)
Maven
(0)
개발이야기
(6)
Language
(20)
Flex
(1)
ABAP
(18)
C#
(1)
Java Scrip..
(0)
Framework
(5)
Struts2
(4)
Spring
(1)
Pattern
(2)
Core J2EE ..
(0)
POSA1
(0)
용어사전
(2)
DataBase
(4)
Oracle
(4)
Server
(4)
Was
(4)
Book
(9)
스터디
(0)
미디어로그
STRUTS2
자바
Eclipse
oracle
db connection
HFSD
mylyn
ubuntu netbook remix
다짐
Head First Software Development
«
2025/04
»
일
월
화
수
목
금
토
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
+ dazzi님 블로그
+ 온 오프 믹스! (모임,세미…
+ kenu blog
+ OKJSP: 사는 얘기
+ 정호님 블로그
+ 존경하는회수형님
+ 자바지기님 블로그
+ 루비나라 출입구
+ 은정이누나 블롯
+ Total :
+ Today :
+ Yesterday :
티스토리 가입하기!
Framework/Spring
_해당되는 글
1건
2010.01.05
Chapter 8. Spring 원격 서비스 (기반지식 - RMI 예제) 2
Chapter 8. Spring 원격 서비스 (기반지식 - RMI 예제)
+
[Framework/Spring]
| 2010. 1. 5. 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); } } }
준비물은 이 정도!
공유하기
게시글 관리
대한민국 차기 대표개발자! - 별책부록
<<이전
|
1
|
다음>>
별책부록
's Blog is powered by
Daum
티스토리툴바