1 / 26

Jini Technology

제 1 회 한국 자바 개발자 컨퍼런스. Jini Technology. 발표자 : 강신동 Email : sindong2@chollian.net 강신동 @idosi.com Mobile : 016-201-5053 소속 : ㈜ idosi.com 대표이사 주최 : JavaCommunity.Org 발표일자 : 2000 년 4 월 9 일. 목 차. 1. Jini 개요 2. Jini site 와 개발도구 3. bytecode 이동과 instance 이동 4. Discovery 5. Join

roth-orr
Download Presentation

Jini Technology

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 제1회 한국 자바 개발자 컨퍼런스 Jini Technology 발표자 : 강신동 Email : sindong2@chollian.net 강신동@idosi.com Mobile : 016-201-5053 소속 : ㈜ idosi.com대표이사 주최 : JavaCommunity.Org 발표일자 : 2000년 4월9일

  2. 목 차 1. Jini 개요 2. Jini site와 개발도구 3. bytecode 이동과 instance 이동 4. Discovery 5. Join 6. Lookup 7. Lookup reservation 8. Lease 9. Using back-end process 10. RMI diagram 11. Jini diagram 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  3. Jini Home Network

  4. Jini Client - Server Jini의 실예 Web server chip 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  5. Jini site와 개발도구 Jini web site http://java.sun.com/jini http://www.jini.org http://artima.com/jini http://jiniworld.chonnam.ac.kr Lookup service 이용을 위한 기본도구 JDK 1.2 (Java 2) 이상 rmid : lookup daemon Jini Technology Starter Kit (jini1.1 alpha) reggie : sun’s lookup service httpd web server for downloading rmi’s stub class 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  6. bytecode 이동과 instance 이동 bytecode의 network 이동 Ex) applet client 중심개념 실행코드가 run-time상태의 client JVM으로 이동 모든 instance는 client의 JVM에서 생성된다 instance의 network 이동 Ex) Jini service 중심개념 interface 이용 실행코드와 data의 run-time시 이동 service에서 만들어진 instance가 동적으로 client의 JVM에서 즉시 이용될 수 있는 특징 network에서 이동된 instance는 client에서 만들어진 instance처럼 이용 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  7. Discovery Lookup-service Service Client Service는 자신을 등록하기 위해 network 상에서 Lookup service를 찾는다. Client는 등록된 Service를 찾기 위해 network 상에서 Lookup service를 찾는다. 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  8. Discovery protocol Discoverer Lookup Service Discoverer Lookup Service Announcement message UDP multicast Request message UDP multicast Request message TCP unicast Response message TCP unicast Response message TCP unicast Multicast request protocol Multicast announcement protocol Request message TCP unicast Response message TCP unicast Unicast discovery protocol 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  9. Discovery (receive ServiceRegistrar) Service JVM Service Lookup JVM ServiceRegistrar Lookup-service Client JVM Client ServiceRegistrar 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  10. Discovery (code) UnicastDiscovery Lookup-service의 위치를 알고있는 경우 TCP/IP Socket 이용 직접 접속 (port 4160) synchronous processing LookupLocator lookup = new LookupLocator(“jini://jini.idosi.com”); ServiceRegistrar registrar = lookup.getRegistrar(); MulticastDiscovery Lookup-service의 위치를 모르는 경우 Multicast 이용 lookup-service 응답기다림 service에서 cient로 TCP/IP Socket 이용연결 asynchronous processing LookupDiscovery discover = new LookupDiscovery(LookupDiscovery.ALL_GROUPS); discovery.addDiscoveryListener(listener); public void discovered(DiscoveryEvent evt) { ServiceRegistrar[] registrars = evt.getRegistrars(); } 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  11. ServiceItem ServiceItem Join (service copy) Service JVM Service Service Copy ServiceRegistrar Service Proxy 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  12. Join (regist service proxy) Lookup JVM Lookup-service Service JVM Service Service Copy ServiceRegistrar Service Proxy register 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  13. Join (code) ServiceRegistrar registrar = …; ServiceID id = null; // 전세계에서 유일한 id 부여 Entry entry = null; // service의 부가정보제공 MyServiceInterface proxy = createServiceInterfaceInstance(); ServiceItem item = new ServiceItem(id, proxy, entry); long leaseTime = 1 * 60 * 1000; // msec ServiceRegistration registration = registrar.register(item, leaseTime); 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  14. Lookup (receive service copy) Client Lookup JVM ServiceTemplate Lookup-service Service copy Client JVM 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  15. Lookup (code) ServiceRegistrar registrar = …; ServiceID id = null; // 전세계에서 유일한 id 부여 Entry entry = null; // service의 부가정보제공 Class[] types = { MyServiceInterface.class }; ServiceTemplate template = new ServiceTemplate(id, types, entry); Object o = registrar.lookup(template); if (o instanceof MyServiceInterface) { MyServiceInterface service = (MyServiceInterface) o; Object result = service.callMyMethod(); } 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  16. Lookup-service Lookup Reservation Client JVM Client Lookup JVM ServiceTemplate notify RemoteEventListener ServiceEvent notify ServiceItem Service Copy 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  17. Lookup Reservation (code) ServiceRegistrar registrar = …..; Entry entry = null; long leaseTime = 1 * 60 * 1000; EventRegistration evtreg = registrar.notify(template, ServiceRegistrar.TRANSITION_NOMATCH_MATCH, myRemoteEventListener, entry, leaseTime); MyRemoteEventListener extends UnicastRemoteObject implements RemoteEventListener public void notify(RemoteEvent evt) throws RemoteException, UnknownEventException { if (evt instanceof ServiceEvent) { ServiceEvent sevt = (ServiceEvent) evt; ServiceItem item = sevt.getServiceItem(); MyServiceInterface service = (MyServiceInterface) item.service; Object result = service.callMyMethod(); } } 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  18. Lookup federation topology Community of communities Stars Island Hierarchies 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  19. Lease (service side) Service JVM Lookup JVM Service register Lookup-service ServiceRegistrar ServiceRegistration Lease renew() 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  20. renew zone Lease expiration now now time line Lease (service code) ServiceRegistration registration = registrar.register(…….); public void run() { while (true) { try { Lease lease = registration.getLease(); long expiration = lease.getExpiration(); long sleepTime = computeSleepTime(); Thread.sleep(sleeptime); lease.renew( 1 * 60 * 1000); } } } 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  21. Lease (client side) Client JVM Lookup JVM Client Lookup-service ServiceRegistrar notify EventRegistration Lease renew() 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  22. Lease (client code) service renew lease ServiceRegistration servreg = registrar.register(……); Lease lease = servreg.getLease(); long expiration = lease.getExpiration(); if ( RENEW_ZONE) { lease.renew(LEASE_TIME); } client renew lease EventRegistration evtreg = registrar.notify(……); Lease lease = evtreg.getLease(); long expiration = lease.getExpiration(); if ( RENEW_ZONE) { lease.renew(LEASE_TIME); } 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  23. Lookup-service Using Back-end Process Lookup JVM Service JVM Client JVM Service Client Remote Server Service Proxy choke point RMI, Socket ... 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  24. RMI diagram lookup rmiregistry UnicastRemoteObject webserver RemoteInterface client RemoteImpl bind stubcode Skeleton Stub rmi RemoteInterface Server JVM Client JVM 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  25. Jini diagram (service copy) rmid (reggie) lookup Serializable Web server MyInterface MyInterface MyService MyService MyInterface register client Service JVM Client JVM 강신동 (sindong2@chollian.ne,t , 강신동@idosi.com)

  26. Jini diagram (service proxy) lookup rmid (reggie) MyInterface Serializable proxy MyInterface Web server RemoteProtocol client register RemoteInterrface Backend MyInterface Skeleton Stub rmi proxy Service JVM Client JVM

More Related