WTK21 – wtklib\kvem HPCC.. runClient of Lime: 해당 Process 리턴, KVMBridge has: disconnectLime, runKVM, stopKVM 프로세스 호출 관계 kvem\environment\JVM.java Kvem\environment\ChildProcess.java.

Slides:



Advertisements
Similar presentations
1 InTroToJCL Introduction to Java Class Loaders. 2 class loader l ia an object responsible for loading classes. The class ClassLoader is an abstract class.
Advertisements

NODEMANAGER WEBLOGIC SERVER. 1.Creating logical machines 2.Using nodemanager for server startup and shutdown GETTING STARTED.
Copyright © 2001 Qusay H. Mahmoud RMI – Remote Method Invocation Introduction What is RMI? RMI System Architecture How does RMI work? Distributed Garbage.
J2ME 25 July Overview  What is J2ME?  The CLDC and CDC configurations  MIDP and MIDlets  Development Tools  Demonstrations.
Writing Your First MIDlet Running JAVA on a Cell Phone Jon A. Batcheller January 27, 2004.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 10 Java for MIDs Rob Pooley
Quality Assurance and Testing of J2ME Programs for Mobiles Phones.
J2ME RMI 1 Java 2 Platform, Micro Edition Implementation of J2ME RMI Application Farooq Sheikh.
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
J2ME Prepared by: - Gaery- Ronny - Alan- Andy. Why Technology for Mobile Devices? The nature of wireless devices is changing Old devices: All the software.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
CS-341 Dick Steflik Introduction. C++ General purpose programming language A superset of C (except for minor details) provides new flexible ways for defining.
The 21th century Repairman Agenda Introduction J2EE J2ME Demonstration.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Topics on KVM Presented By Xiaozhou David Zhu. Topics covered Introduction Java2 Platform Micro Edition CLDC KVM.
J2ME Java for Mobile Environments Based on J2ME In A Nutshell, by Kim Topley, O’Reilly & Associates Inc., 2002, and Tetris by Alexei Patinov.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Enabling Advanced Net8 Features. Configuring Advanced Network Address and Connect Data Information.
Programming Languages and Paradigms Object-Oriented Programming.
Java Programming Robert Chatley William Lee
TCP/IP protocols Communication over Internet is mostly TCP/IP (Transmission Control Protocol over Internet Protocol) TCP/IP "stack" is software which allows.
INFS 752 Summer Juan Salazar Please right click the symbol in the lower right corner, and then press preview, to hear the presentation for each page.
Developed as a partial fulfillment of the requirements of ID2216 Sumanta Saha Md Sakhawat Hossen Md Safiqul Islam sumanta, hossen, BlueTTT.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 11 J2ME and MIDlets Rob Pooley
Small Devices on DBGlobe System George Samaras Chara Skouteli.
Framework and application bytecode size CLDC MIDP kXML parser Utility classes Graphics Logic (MIDlet) Application Data (XML file)
Computer Science Wi-Fi App using J2ME and MVC Architecture Advisor : Dr. Chung-E Wang Department of Computer Science Sacramento State University Date:
J2ME Presented by May Sayed & Menna Hawash. Outline Introduction “Java Technology” Introduction “What is J2ME?” J2ME Architecture J2ME Core Concepts 
Learningcomputer.com SQL Server 2008 Configuration Manager.
Java 2 Micro Edition (J2ME) and the world of java
1Basics of J2ME. 2 Objectives –Understand the different java API’s and how the mobile edition API’s fit in –Understand what a mobile configuration and.
Java Introduction to JNI Prepared by Humaira Siddiqui.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
WTK partial code description Jin Tae Kum HPCC lab Sookmyung Women ’ s University.
8-January-2003cse ProjectOverview © 2003 University of Washington1 Project Overview CSE 403, Winter 2003 Software Engineering
Networks Sockets and Streams. TCP/IP in action server ports …65535 lower port numbers ( ) are reserved port echo7 time13 ftp20 telnet23.
National Taiwan University Department of Computer Science and Information Engineering National Taiwan University Department of Computer Science and Information.
CS390- Unix Programming Environment CS 390 Unix Programming Environment Java Socket Programming.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Copyright Curt Hill Variables What are they? Why do we need them?
Configuring & Managing Web Services for Joachim Flammer Integration Team EGEE is a project funded by the European Union under contract IST
Java 2 Micro Edition The Connected, Limited Device Configuration.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
1. An Introduction A Programming Language A Technology Java Development Kit Java API One Language: Three Editions Standard Edition Enterprise Edition.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
TCP/IP Protocol Stack IP Device Drivers TCPUDP Application Sockets (Gate to network) TCP: –Establish connection –Maintain connection during the communication.
Spring 2009 Programming Fundamentals I Java Programming XuanTung Hoang Lecture No. 8.
Presentation 11: SOAP on small devices. Ingeniørhøjskolen i Århus Slide 2 af 10 Outline Which small devices? What are the limitations and what kind of.
AdaptJ Sookmyung Women’s Univ. PSLAB. 1. 목차 1. Overview 2. Collecting Trace Data using the AdaptJ Agent 2.1 Recording a Trace 3. Analyzing Trace Data.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
Nguyen Thi Thanh Nha HMCL by Roelof Kemp, Nicholas Palmer, Thilo Kielmann, and Henri Bal MOBICASE 2010, LNICST 2012 Cuckoo: A Computation Offloading Framework.
Enhanced mobile services in Java enabled phones Björn Hjelt Sonera zed ltd Supervisor: Professor Jorma Jormakka.
SESSION 1 Introduction in Java. Objectives Introduce classes and objects Starting with Java Introduce JDK Writing a simple Java program Using comments.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Object Oriented Programming in
Servlets.
Java N Amanquah.
Programming of Handheld and Mobile Devices
Sockets and Beginning Network Programming
RMI Packages Overview java.rmi java.rmi.server java.rmi.registry
MOBILE DEVICE OPERATING SYSTEM
Wireless Instant Messaging Using J2ME
By Jeff Heaton An Overview of J2ME By Jeff Heaton
null, true, and false are also reserved.
Networking.
Servlet APIs Every servlet must implement javax.servlet.Servlet interface Most servlets implement the interface by extending one of these classes javax.servlet.GenericServlet.
Sookmyung Women’s Univ. PSLAB
Defensive Programming
Presentation transcript:

WTK21 – wtklib\kvem HPCC.

runClient of Lime: 해당 Process 리턴, KVMBridge has: disconnectLime, runKVM, stopKVM 프로세스 호출 관계 kvem\environment\JVM.java Kvem\environment\ChildProcess.java Kvem\KVMBridge.java Kvem\Lime.java JVM KVMBridgeLime ChildProcess J2MEWTK.property 파일 생성, 정보저장 컴파일 대상파일 실행시킴 creates runClient 호출 in runKVM

as 분석 (in lime.java)

Runclient() in Lime.java public Process runClient(String s, String as[], String as1[], File file) throws IOException { commandServer = new ServerSocket(0); eventServer = new ServerSocket(0); int i = commandServer.getLocalPort(); int j = eventServer.getLocalPort(); String as2[] = { "LIME_TRACE=" + (debug ? 1 : 0), "COMMAND_PORT=" + i, "EVENT_PORT=" + j, "--" }; int k = as1 != null ? as1.length : 0; String as3[] = new String[1 + k + as2.length + as.length]; as3[0] = s; if(as1 != null) System.arraycopy(as1, 0, as3, 1, k); System.arraycopy(as2, 0, as3, 1 + k, as2.length); System.arraycopy(as, 0, as3, 1 + k + as2.length, as.length); if(debug) { for(int l = 0; l < as3.length; l++) System.out.println("argv[" + l + "] = " + as3[l]); System.out.flush(); } Server server = new Server(); connected = true; (new Thread(server)).start(); String s1 = System.getProperty("kvm.use_library", "false"); if(s1.compareToIgnoreCase("true") == 0) return new FakeProcess(as3); else return Runtime.getRuntime().exec(as3, null, file); }

Lime.java Process runClient (String s, String as[], String as1[], File file) { …… Runtime.getRuntime().exec(as3, null, file); }

Runtime.exec(String[] cmdarray, String[] envp, File dir) cmdarray : call 하는데, 필요한 argument/ 층 envp : 환경변수 setting ( null 이면, sub_process 에서 상속 받는다. ) file dir : working directory >> return : sub_process manage 위한 process obj

C:\WTK21\bin\zayit LIME_TRACE=0 COMMAND_PORT=1137 EVENT_PORT= Dcom.sun.midp.lcdui.eventHandler=com.sun.midp.lcdui.EmulEventHandler -Dcom.sun.midp.lcdui.inputMethodHandler=com.sun.midp.lcdui.DefaultInputMethodHandler -Dcom.sun.midp.io.http.use_chunks=true -Dcom.sun.midp.io.http.force_non_persistent=false -monitormemory -jprof C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\jprof19006.prf -Dsystem.storage_root=DefaultColorPhone -Dmicroedition.locale=ko-KR -Dmicroedition.encoding=MS949 -Dmmapi_enabled=true -domain untrusted -Dsupports.video.capture=false -Daudio.encodings=encoding=pcm -Dvideo.snapshot.encodings=encoding=jpeg&encoding=png -Dsupports.mixing=true -Dsupports.audio.capture=true -Dsupports.recording=true -Dwireless.messaging.sms.smsc= classpath C:\WTK21\apps\demos\classes;C:\WTK21\apps\demos\res -descriptor C:\WTK21\apps\demos\bin\demos.jad as3 as3 구성 (‘Open Project’  ‘demo’ 실행 ) S S as2 as

as3 구성 as3 s 첫번째 argv C:\WTK21\bin\zayit as1 계속해서 null 값이 찍힘. as2 Lime_Trace, COMMAND_PORT, EVENT_PORT 등을 나타냄. as Preference, Settings 에서 enable, disable 해줬던 부분이 parameter 처럼 들어옴.

C:\WTK21\bin\zayitLIME_TRACE=0COMMAND_PORT=1137EVENT_PORT= Dcom.sun.midp.lcdui.eventHandler=com.sun.midp.lcdui.EmulEventHandler -Dcom.sun.midp.lcdui.inputMethodHandler=com.sun.midp.lcdui.DefaultInputMethodHandler -Dcom.sun.midp.io.http.use_chunks=true -Dcom.sun.midp.io.http.force_non_persistent=false -monitormemory -jprof C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\jprof19006.prf -Dsystem.storage_root=DefaultColorPhone -Dmicroedition.locale=ko-KR -Dmicroedition.encoding=MS949 -Dmmapi_enabled=true -domain untrusted -Dsupports.video.capture=false -Daudio.encodings=encoding=pcm -Dvideo.snapshot.encodings=encoding=jpeg&encoding=png -Dsupports.mixing=true -Dsupports.audio.capture=true -Dsupports.recording=true -Dwireless.messaging.sms.smsc= classpath C:\WTK21\apps\demos\classes;C:\WTK21\apps\demos\res -descriptor C:\WTK21\apps\demos\bin\demos.jad as3 as2 - 1 S S as2 as

as2 - 2 Lime_Trace : 항상 value = 0 COMMAND_PORT : lime.java 에서 command_port 설정. 다른 응용 프로그램일 경우, 값이 바뀜. EVENT_PORT : lime.java 에서 event_port 설정. 다른 응용 프로그램일 경우, 값이 바뀜.

C:\WTK21\bin\zayit LIME_TRACE=0 COMMAND_PORT=1137 EVENT_PORT= Dcom.sun.midp.lcdui.eventHandler=com.sun.midp.lcdui.EmulEventHandler -Dcom.sun.midp.lcdui.inputMethodHandler=com.sun.midp.lcdui.DefaultInputMethodHandler -Dcom.sun.midp.io.http.use_chunks=true -Dcom.sun.midp.io.http.force_non_persistent=false -monitormemory -jprof C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\jprof19006.prf -Dsystem.storage_root=DefaultColorPhone -Dmicroedition.locale=ko-KR -Dmicroedition.encoding=MS949 -Dmmapi_enabled=true -domain untrusted -Dsupports.video.capture=false -Daudio.encodings=encoding=pcm -Dvideo.snapshot.encodings=encoding=jpeg&encoding=png -Dsupports.mixing=true -Dsupports.audio.capture=true -Dsupports.recording=true -Dwireless.messaging.sms.smsc= classpath C:\WTK21\apps\demos\classes;C:\WTK21\apps\demos\res -descriptor C:\WTK21\apps\demos\bin\demos.jad as3 as - 1 S S as2 as

as - 2 선택 사항에 따라서 parameter 로 넘어감. : Ktoolbar 의 menu 중에서 Preference, settings 에서 선택하는 것에 따라서 값이 나타남. 예를 들어 … -monitermemory : preference 에서 memorymonitor 를 disable 시키면 없어짐. -Dsupports.mixing=true or -supports.audio.capture=true or Dsupports.recording=true 과 같은 argv : preferences  Mmedia optional feature 에 있는 부분을 enable / disable 시켜줌에 따라서 true/ false 값으로 변화.

Lime.runClient (wtklib\lime\com\sun\kvem) KVMBridge.runKVM (wtklib\kvem\com\sun\kvem) Lime.runClient ← ‥‥ ← Main : call 관계 KVMBridge.runKVM (wtklib\kvem\com\sun\kvem) MIDP.run (wtklib\kvem\com\sun\kvem\midp) EmulatorInvoker.runEmulatorImpl (wtklib\kenv\com\sun\kvem\environment)

Lime.runClient ← ‥‥ ← Main : call 관계 EmulatorInvoker.runEmulatorSameVM (wtklib\kenv\com\sun\kvem\environment) EmulatorInvoker.runEmulator (wtklib\kenv\com\sun\kvem\environment) ProfileEnvironment.KVMThread.runEmulator (wtklib\kenv\com\sun\kvem\environment)

Lime.runClient ← ‥‥ ← Main : call 관계 ProfileEnvironment.KVMThread.run (wtklib\kenv\com\sun\kvem\environment) MainWindow.CompilerThread.run (wtklib\ktools\com\sun\kvem\toolbar) MainWindow.MainWindow (wtklib\ktools\com\sun\kvem\toolbar)

Lime.runClient ← ‥‥ ← Main : call 관계 EmulatorWrapper.run (wtklib\kenv\com\sun\kvem\environment) EmulatorWrapper.main (wtklib\kenv\com\sun\kvem\environment)

Lime.runClient ← ‥‥ ← Main : call 관계 Main.run (wtklib\ktools\com\sun\kvem\toolbar) Main.main (wtklib\ktools\com\sun\kvem\toolbar) Main.main (wtklib\ktools\com\sun\kvem\ktools)...

PofileConfiguration :Set of Property objects (Trace 관련 옵션 포함 ) Property object: each entry in emulator.poperties TracingOptions : invoke profileconfiguration By (method.invoke(profileconfiguration, aobj) ProfileConfiguration 에 따라 trace 활성화 EmulatorWrapper : receives args(opt) from prompt initiate Calls to set

Lime 데이터 핸들링 Output 스트림 생성, profiler 생성, 기록 서버와 클라이언트 연결 ( 로컬 (?) 네트워 크 )

runClient in Lime uses zayit.dll As3 값 : Zayit.exe 외 String s1 = System.getProperty("kvm.use_library", "false"); if(s1.compareToIgnoreCase("true") == 0) return new FakeProcess(as3); else return Runtime.getRuntime().exec(as3, null, file);

C:\WTK21\bin\zayit LIME_TRACE=0 COMMAND_PORT=1137 EVENT_PORT= Dcom.sun.midp.lcdui.eventHandler=com.sun.midp.lcdui.EmulEventHandler -Dcom.sun.midp.lcdui.inputMethodHandler=com.sun.midp.lcdui.DefaultInputMethodHandler -Dcom.sun.midp.io.http.use_chunks=true -Dcom.sun.midp.io.http.force_non_persistent=false -monitormemory -jprof C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\jprof19006.prf -Dsystem.storage_root=DefaultColorPhone -Dmicroedition.locale=ko-KR -Dmicroedition.encoding=MS949 -Dmmapi_enabled=true -domain untrusted -Dsupports.video.capture=false -Daudio.encodings=encoding=pcm -Dvideo.snapshot.encodings=encoding=jpeg&encoding=png -Dsupports.mixing=true -Dsupports.audio.capture=true -Dsupports.recording=true -Dwireless.messaging.sms.smsc= classpath C:\WTK21\apps\demos\classes;C:\WTK21\apps\demos\res -descriptor C:\WTK21\apps\demos\bin\demos.jad as3 C:\WTK21 file ‘Open Project’ 에서 ‘demo’ 실행

Zayit.exe Sever program 과 client program 사이의 미들웨어 Dummy 인지 기능이 있는지 아직 알 수 없었음 Emulator 의 실행을 위해 필요한 파일 ( 작은 size 라는 장 점으로 인해 ) Guess 1 - 방화벽을 on 하면 에러,off 하면 컴파일성공, by Java Technology Forums in java.sun.com Guess 2 - 네트웍 관련 (TCP/IP based 추정, 그러나 trace 못함 ) by Java Technology Forums in java.sun.com KVM Strategy for small size

Appendix. Configuration file in wtk directory

# Properties visible from System.getProperty() microedition.jtwi.version: 1.0 microedition.configuration: CLDC-1.1 microedition.profiles: MIDP-2.0 microedition.locale: en-US microedition.platform: j2me # microedition.encoding: ISO8859_1 microedition.commports: 0,1 # # I18N aliases for common character encodings SHIFT_JIS_InternalEncodingName: SJIS X_SJIS_InternalEncodingName: SJIS # # CLDC implementation parameters # use MIDP protocol implementations javax.microedition.io.Connector.protocolpath: com.sun.kvem.io # java.lang.Character.caseConverter: com.sun.cldc.i18n.uclc.DefaultCaseConverter # com.sun.cldc.i18n.Helper.i18npath: com.sun.cldc.i18n.j2me # microedition.implpath: com.sun.cldc # com.sun.cldc.util.j2me.TimeZoneImpl.timezone: UTC # WMA wireless.messaging.sms.smsc : # MMAPI public properties microedition.media.version: 1.1 supports.audio.capture: true audio.encodings: encoding=pcm streamable.contents: audio/x-wav wtk21/lib/System.config

# Visible from com.sun.midp.Configuration.getProperty(key) # # System tunable parameters (system prefix indicates native only access) # system.jam_space: system.display.double_buffered:true system.display.screen_depth: 8 system.i18n.lang: en system.i18n.encoding: ISO8859_1 # system.display.debug_screen: # system.display.visual_type: TrueColor # system.display.kh_skins: TrueColor # com.sun.midp.io.j2me.comm.buffersize: 256 # com.sun.midp.io.j2me.socket.buffersize: 256 # com.sun.midp.midlet.scheduler: com.sun.midp.midlet.Scheduler # com.sun.midp.lcdui.eventHandler: com.sun.midp.lcdui.DefaultEventHandler # For J2SE # com.sun.midp.lcdui.eventHandler: com.sun.midp.lcdui.AWTEventHandler # com.sun.midp.lcdui.inputHandler: com.sun.midp.lcdui.DefaultInputMethodHandler # com.sun.midp.midletsuite.installer: com.sun.midp.midletsuite.Installer # com.sun.midp.midletsuite.installer: com.sun.midp.midletsuite.SecureInstaller # com.sun.midp.graphicalmanager: com.sun.midp.dev.Manager # com.sun.midp.lcdui.skin: classes/icons/skin.gif #com.sun.midp.io.http.proxy: webcache:8080 #com.sun.midp.io.http.force_non_persistent: false #com.sun.midp.io.http.persistent_connection_linger_time: #com.sun.midp.io.http.input_buffer_size: 256 #com.sun.midp.io.http.output_buffer_size: 2048 wtk21/lib/internal.config

com.sun.midp.io.http.max_persistent_connections: 4 ### # Default values for SMS internal implementation. com.sun.midp.io.j2me.sms.DatagramHost: localhost # # Alternate SMS port for CBS emulation com.sun.midp.io.j2me.sms.CBSPort: # Sender's phone number com.sun.midp.io.j2me.sms.PhoneNumber= # Default SMS Sercice Center address wireless.messaging.sms.smsc: # This file is appended at the end of the MIDP internal.config file. com.sun.midp.io.enable_extra_protocols: true com.sun.midp.io.http.use_chunks: true wtk21/lib/internal.config

file.extension: jad heap.size: http.proxyHost: http.proxyPort: http.version: HTTP/1.1 https.proxyHost: https.proxyPort: jammode: kvem.api.exclude: kvem.device: DefaultColorPhone kvem.memory.monitor.enable: true kvem.netmon.autoclose: false kvem.netmon.enable: false kvem.netmon.filter_file_name: netmon_filter.dat kvem.netmon.fixed_font_name: Courier New kvem.netmon.fixed_font_size: 12 kvem.profiler.enable: false kvem.profiler.outfile: kvem.profiler.showsystem: false kvem.trace.all: false kvem.trace.allocation: false kvem.trace.bytecodes: false kvem.trace.calls: false kvem.trace.calls.verbose: false kvem.trace.class: false kvem.trace.class.verbose: false kvem.trace.events: false kvem.trace.exceptions: false kvem.trace.frames: false kvem.trace.gc: false kvem.trace.gc.verbose: false kvem.trace.monitors: false kvem.trace.networking: false kvem.trace.stackchunks: false kvem.trace.stackmaps: false kvem.trace.threading: false kvem.trace.verifier: false mm.control.capture: true mm.control.midi: true mm.control.mixing: true mm.control.record: true mm.control.volume: true mm.format.midi: true mm.format.video: true mm.format.wav: true netspeed.bitpersecond: 1200 netspeed.enableSpeedEmulation: false prng.secure: false screen.graphicsLatency: 0 screen.refresh.mode: screen.refresh.rate: 30 security.domain: untrusted storage.root: storage.size: vmspeed.bytecodespermilli: 10 vmspeed.enableEmulation: false wma.client.phoneNumber: wma.server.deliveryDelayMS: wma.server.firstAssignedPhoneNumber: wma.server.percentFragmentLoss: 0 wma.smsc.phoneNumber: wtk21/wtklib/ Emulator. properties

03/08/07 kjava.preverifier.command: bin\\preverify.exe kjava.class.path: lib\\midpapi20.zip;lib\\cldcapi10.zip file.extension: jad obfuscator.runner.class.name: com.sun.kvem.ktools.RunPro obfuscator.runner.classpath: wtklib\\ktools.zip obfuscate.script.name: wtk21/wtklib/Windows /ktools.properties

KVM strategy, JNI into KVM The KVM design team tried to enable the partitioning of virtual machine capabilities. The team also architected the byte code interpreter and garbage collector to minimize dynamic memory usage, and carefully implemented the virtual machine and libraries to minimize their size (e.g. by rolling Java Native Interface calls into the VM itself). - In KVM Document