Bytecode Manipulation with a Java Agent and Byte Buddy. Koichi Sakata PONOS Corporation

Size: px
Start display at page:

Download "Bytecode Manipulation with a Java Agent and Byte Buddy. Koichi Sakata PONOS Corporation"

Transcription

1 Bytecode Manipulation with a Java Agent and Byte Buddy Koichi Sakata PONOS Corporation

2 2 About Me Koichi Sakata ( ) KanJava JUG Leader Java Champion PONOS Corporation

3 3

4 4 Intended Audience Those who want to start manipulating bytecode Not for experts

5 5 Q&A If you could, let's hold all the questions until the end

6 6 Java Bytecode.java Java Code javac.class Bytecode Gets loaded by JVM

7 7 What is bytecode manipulation? Editing bytecode in the class files Add Delete Replace

8 8 Why do we manipulate? It's fun!

9 9 Not Only Fun To change code at runtime Generate Entity objects in Hibernate Create mock objects in Mockito

10 10 Bytecode Manipulation Hard to manipulate by hand... A class file is a binary file JVM has a verification process

11 11 Bytecode Manipulation Libraries Byte Buddy Byteman Javassist cglib ASM Apache Commons BCEL

12 12 Byte Buddy Easy-to-use API Java 11 Support Duke's Choice Award 2015 Winner

13 13 Byte Buddy Usage in major libraries Hibernate Mockito Jackson etc.

14 14 Hello World in Byte Buddy Class<?> subclass = new ByteBuddy().subclass(Object.class).method(ElementMatchers.named("toString")).intercept(FixedValue.value("Hello World!")).make().load(getClass().getClassLoader()).getLoaded();

15 15 Hello World in Byte Buddy Class<?> subclass = new ByteBuddy().subclass(Object.class).method(ElementMatchers.named("toString")) 1. Create a subclass of Object 2. Choose the tostring()

16 16 Hello World in Byte Buddy.method(ElementMatchers.named("toString")).intercept(FixedValue.value("Hello World!")) 1. Intercept tostring() to return a fixed string value "Hello World"

17 17 Hello World in Byte Buddy.make().load(getClass().getClassLoader()).getLoaded(); 1. Make a new type (unloaded class) 2. Load the type 3. Get the new loaded class

18 18 Hello World in Byte Buddy Class<?> subclass = new ByteBuddy().subclass(Object.class).method(ElementMatchers.named("toString")).intercept(FixedValue.value("Hello World!")).make().load(getClass().getClassLoader()).getLoaded();

19 19 Demo 1 Run Hello World See a generated class

20 20 Demo code is available github.com/jyukutyo/samplecodeforbyt ebuddyseeesion

21 21 Usage in Mockito SubclassBytecodeGenerator mockclass()

22 22 How to use BM? 1. Directly in your application 2. At build time via Maven/Gradle 3. With Java Agent No need for changing code Detachable

23 23 Java Agent? Do espionage activities in your application Profiling Logging Changing the target application itself

24 24 Java Agent Instrument programs running on the JVM JSR 163: JavaTM Platform Profiling Architecture JVM calls Java Agent method with proper timing

25 25 Create a Java Agent Just define methods premain() Method agentmain() Method

26 26 Create a Java Agent premain() Method Gets called before main() method agentmain() Method Gets called when the agent is attached after JVM startup

27 27 With Java Agent We can run bytecode manipulation code at runtime

28 28

29 29 premain() public static void premain(string agentargs, Instrumentation inst) Provides opportunity to modify classes before loading Instrumentation class has useful methods

30 30 MANIFEST.MF Premain-Class: com.s.logging.loggingagent Boot-Class-Path: byte-buddy jar

31 31 Demo 2 Create a simple Java Agent

32 32 Another Example Add outputting logs before executing a particular method on a particular class

33 33 Example 1. Manipulate bytecode before loading Use premain() 2. Replace the class file Use ByteBuddy Not create a subclass

34 34 Target Class public class Target { public void foo() { System.out.println("foo!"); } public static void main(string[] args) { new Target().foo(); } }

35 35 Replace the class TypePool pool = TypePool.Default.ofClassPath(); return new ByteBuddy().rebase(pool.describe("c.Target").resolve(), ClassFileLocator.ForClassLoader.ofClassPath() )

36 Replace the class return new ByteBuddy().rebase(...) Replace the original implementation with new one Save the original implementation under a different method name 36

37 37 Enhance Existing Method ByteBuddy#subclass() Override the method ByteBuddy#redefine() Replace the implementation ByteBuddy#rebase() Copy&Rename the method Replace the implementation

38 38 Replace the class TypePool pool = TypePool.Default.ofClassPath(); return new ByteBuddy().rebase(pool.describe("c.Target").resolve(), Can't use a class literal JVM loads class before changing the class Use the TypePool class and describe()

39 39 Replace the class.rebase(pool.describe(...).resolve(), ClassFileLocator.ForClassLoader.ofClassPath() ) Allow to locate a class file ofclasspath() - Scan the running application's class path

40 40 Intercept the method return new ByteBuddy()....method(ElementMatchers.named("foo")).intercept( ) MethodDelegation.to(LoggingInterceptor.class).andThen(SuperMethodCall.INSTANCE)

41 41 Delegation MethodDelegation.to() Specify a Class to delegate A best match method is used

42 42 Intercept the method return new ByteBuddy()....method(ElementMatchers.named("foo")).intercept( ) MethodDelegation.to(LoggingInterceptor.class).andThen(SuperMethodCall.INSTANCE)

43 43 Interceptor Class public static class LoggingInterceptor { public static void Method m) {...println("call " + m.getname()...); } }

44 44 Delegated Method Annotations for Reference to the method/constructor

45 45 Delegated Method Annotations for Parameter Dynamic/Super @SuperCall Callable/Runnable instance of the super's implementation of the method

46 46 premain() public static void premain(string args, Instrumentation inst) { inst.addtransformer( new ClassFileTransformer() public byte[] transform(...) {

47 47 transform() public byte[] transform(classloader loader, String classname, Class<?> classbeingredefined, ProtectionDomain protectiondomain, byte[] classfilebuffer) { } // Call ByteBuddy

48 48 transform() public byte[] transform(classloader loader, String classname, Class<?> classbeingredefined, ProtectionDomain protectiondomain, byte[] classfilebuffer) classname Class name to be loaded classfilebuffer Class file content

49 49 transform() public byte[] transform(classloader loader, String classname, Class<?> classbeingredefined, ProtectionDomain protectiondomain, byte[] classfilebuffer) Return the class file content

50 50 Demo 3 Add outputting logs before executing a method

51 51

52 52 Features in ByteBuddy Add fields/methods Manipulate stack Generate CONDY bytecode Constant Dynamic JEP 309 Simplify Java Agent with AgentBuilder lots of other features

53 53 Byte Buddy's AgentBuilder Simplify the Java Agent implementation

54 54 AgentBuilder new AgentBuilder.Default().type(ElementMatchers.named("com.sakatakoic hi.logging.target")).transform(new AgentBuilder.Transformer() {... }).installon(inst);

55 55 AgentBuilder 1. Use AgentBuilder instead of ByteBuddy class 2. Use AgentBuilder.Transformer instead of ClassFileTransformer 3. Call installon()

56 Transformer.transform(new AgentBuilder.Transformer() { public DynamicType.Builder<?> transform( DynamicType.Builder<?> builder, TypeDescription typedescription, ClassLoader classloader, JavaModule javamodule) { return builder.method(elementmatch...named("foo")).intercept(...); } }) 56

57 57 Without -javaagent -javaagent option can be removed Call ByteBuddyAgent.install() Call AgentBuilder#installOnByteBuddyAgent() instead of installon() Need to add byte-buddy-agent.jar

58 58 Without -javaagent ByteBuddyAgent.install(); new AgentBuilder.Default().type(ElementMatchers.named("com.sakatakoic hi.logging.target")).transform(new AgentBuilder.Transformer() {... }).installonbytebuddyagent();

59 59 Demo 4 Add outputting logs without -javaagent option

60 60 Wrap Up BM is fun and close to us! Many libraries are using Application Examples Hot Swap Advanced Dynamic Proxy

61 61 Q&A

The Dark Sides of Integration. Anton Arhipov JRebel,

The Dark Sides of Integration. Anton Arhipov JRebel, The Dark Sides of Integration Anton Arhipov JRebel, ZeroTurnaround @antonarhipov Observe results Make a change Build, deploy, wait Where the time goes? Where the time goes? Build Container start Just don

More information

Living in the Matrix with Bytecode Manipulation

Living in the Matrix with Bytecode Manipulation Living in the Matrix with Bytecode Manipulation QCon NY 2014 Ashley Puls Senior Software Engineer New Relic, Inc. Follow Along http://slidesha.re/1kzwcxr Outline What is bytecode? Why manipulate bytecode?

More information

Making Java more dynamic: runtime code generation for the JVM

Making Java more dynamic: runtime code generation for the JVM Making Java more dynamic: runtime code generation for the JVM The talk was way too high-level. I wish the speaker would have explained more technical details! This was way too low-level. I did not understand

More information

Compiling Techniques

Compiling Techniques Lecture 10: Introduction to 10 November 2015 Coursework: Block and Procedure Table of contents Introduction 1 Introduction Overview Java Virtual Machine Frames and Function Call 2 JVM Types and Mnemonics

More information

LINGI2252 PROF. KIM MENS REFLECTION (IN JAVA)*

LINGI2252 PROF. KIM MENS REFLECTION (IN JAVA)* LINGI2252 PROF. KIM MENS REFLECTION (IN JAVA)* * These slides are part of the course LINGI2252 Software Maintenance and Evolution, given by Prof. Kim Mens at UCL, Belgium Lecture 10 a Basics of Reflection

More information

1 Introduction. 2 Motivation PROJECT INITIUM AND THE MINIMAL CONFIGURATION PROBLEM. Douglas A. Lyon. Fairfield University, Fairfield, USA

1 Introduction. 2 Motivation PROJECT INITIUM AND THE MINIMAL CONFIGURATION PROBLEM. Douglas A. Lyon. Fairfield University, Fairfield, USA Journal of Modern Technology and Engineering Vol.3, No.3, 2018, pp.197-204 PROJECT INITIUM AND THE MINIMAL CONFIGURATION PROBLEM Douglas A. Lyon Fairfield University, Fairfield, USA Abstract. We are given

More information

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1 CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines

More information

Java Programming Language Mr.Rungrote Phonkam

Java Programming Language Mr.Rungrote Phonkam 2 Java Programming Language Mr.Rungrote Phonkam rungrote@it.kmitl.ac.th Contents 1. Intro to Java. 2. Java Platform 3. Java Language 4. JDK 5. Programming Steps 6. Visual Programming 7. Basic Programming

More information

JPA Enhancement Guide (v5.1)

JPA Enhancement Guide (v5.1) JPA Enhancement Guide (v5.1) Table of Contents Maven..................................................................................... 3 Ant........................................................................................

More information

Java Code Coverage Mechanics. by Evgeny Mandrikov at EclipseCon Europe 2017

Java Code Coverage Mechanics. by Evgeny Mandrikov at EclipseCon Europe 2017 Java Code Coverage Mechanics by Evgeny Mandrikov at EclipseCon Europe 2017 Evgeny Mandrikov @_Godin_ Godin Marc Hoffmann @marcandsweep marchof JaCoCo and Eclipse EclEmma Project Leads /* TODO Don't forget

More information

Emulating the Java ME Platform on Java SE

Emulating the Java ME Platform on Java SE Emulating the Java ME Platform on Java SE Kenneth Russell Tony Wyant Sun Microsystems, Inc. Session TS-2515 2007 JavaOne SM Conference Session TS-2515 Goal of This Talk Learn advanced uses of Java bytecode

More information

Java Code Coverage Mechanics Evgeny Mandrikov Marc Hoffmann #JokerConf 2017, Saint-Petersburg

Java Code Coverage Mechanics Evgeny Mandrikov Marc Hoffmann #JokerConf 2017, Saint-Petersburg Java Code Coverage Mechanics Evgeny Mandrikov Marc Hoffmann #JokerConf 2017, Saint-Petersburg Evgeny Mandrikov @_Godin_ Godin Marc Hoffmann @marcandsweep marchof JaCoCo and Eclipse EclEmma Project Leads

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

Java Instrumentation for Dynamic Analysis

Java Instrumentation for Dynamic Analysis Java Instrumentation for Dynamic Analysis and Michael Ernst MIT CSAIL Page 1 Java Instrumentation Approaches Instrument source files Java Debug Interface (JDI) Instrument class files Page 2 Advantages

More information

The Future of Code Coverage for Eclipse

The Future of Code Coverage for Eclipse Marc R. Hoffmann EclipseCon 2010 2010-03-25 2010 by Marc R. Hoffmann made available under the EPL v1.0 2010-03-25 Outline Code Coverage EclEmma EMMA JaCoCo Sorry, no robots Code Coverage Legacy Code is

More information

Fun with EJB and OpenEJB. David #OpenEJB

Fun with EJB and OpenEJB. David #OpenEJB Fun with EJB and OpenEJB David Blevins @dblevins #OpenEJB The Basics - History Timeline 1999 - Founded in Exoffice - EJB 1.1 level 2001 - Integrated in Apple s WebObjects 2002 - Moved to SourceForge 2003

More information

Java Security. Compiler. Compiler. Hardware. Interpreter. The virtual machine principle: Abstract Machine Code. Source Code

Java Security. Compiler. Compiler. Hardware. Interpreter. The virtual machine principle: Abstract Machine Code. Source Code Java Security The virtual machine principle: Source Code Compiler Abstract Machine Code Abstract Machine Code Compiler Concrete Machine Code Input Hardware Input Interpreter Output 236 Java programs: definitions

More information

Under the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008

Under the Hood: The Java Virtual Machine. Lecture 23 CS2110 Fall 2008 Under the Hood: The Java Virtual Machine Lecture 23 CS2110 Fall 2008 Compiling for Different Platforms Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized

More information

CS 11 java track: lecture 1

CS 11 java track: lecture 1 CS 11 java track: lecture 1 Administrivia need a CS cluster account http://www.cs.caltech.edu/ cgi-bin/sysadmin/account_request.cgi need to know UNIX www.its.caltech.edu/its/facilities/labsclusters/ unix/unixtutorial.shtml

More information

Reconstructing DALVIK. Applications. Marc Schönefeld CANSECWEST 2009, MAR18

Reconstructing DALVIK. Applications. Marc Schönefeld CANSECWEST 2009, MAR18 Reconstructing DALVIK Applications Marc Schönefeld CANSECWEST 2009, MAR18 Motivation As a reverse engineer I have the tendency to look in the code that is running on my mobile device Coming from a JVM

More information

Java Code Coverage Mechanics

Java Code Coverage Mechanics at by Evgeny Mandrikov Java Code Coverage Mechanics #DevoxxFR Evgeny Mandrikov @_Godin_.com/Godin one of JaCoCo and Eclipse EclEmma Project Leads Disclaimer /* TODO don't forget to add huge disclaimer

More information

Getting Started with Java. Atul Prakash

Getting Started with Java. Atul Prakash Getting Started with Java Atul Prakash Running Programs C++, Fortran, Pascal Python, PHP, Ruby, Perl Java is compiled into device-independent code and then interpreted Source code (.java) is compiled into

More information

JSR 292 backport. (Rémi Forax) University Paris East

JSR 292 backport. (Rémi Forax) University Paris East JSR 292 backport (Rémi Forax) University Paris East Interactive talk Ask your question when you want Just remember : Use only verbs understandable by a 4 year old kid Use any technical words you want A

More information

Lecture 9 : Basics of Reflection in Java

Lecture 9 : Basics of Reflection in Java Lecture 9 : Basics of Reflection in Java LSINF 2335 Programming Paradigms Prof. Kim Mens UCL / EPL / INGI (Slides partly based on the book Java Reflection in Action, on The Java Tutorials, and on slides

More information

Frequently Asked Questions about POJO Cache

Frequently Asked Questions about POJO Cache Frequently Asked Questions about POJO Cache Ben Wang Scott Marlow Jason Greene Release 3.0.0 November 2008 These are frequently asked questions regarding POJO Cache. General Information Q: What is POJO

More information

JAVA MOCK TEST JAVA MOCK TEST III

JAVA MOCK TEST JAVA MOCK TEST III http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

C02: Overview of Software Development and Java

C02: Overview of Software Development and Java CISC 3120 C02: Overview of Software Development and Java Hui Chen Department of Computer & Information Science CUNY Brooklyn College 08/31/2017 CUNY Brooklyn College 1 Outline Recap and issues Brief introduction

More information

PARAMETERS Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below.

PARAMETERS Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below. NAME java Java interpreter SYNOPSIS java [ options ] class [ argument... ] java [ options ] jar file.jar [ argument... ] PARAMETERS Options may be in any order. For a discussion of parameters which apply

More information

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction OGIES 6/7 A- Core Java The Core Java segment deals with the basics of Java. It is designed keeping in mind the basics of Java Programming Language that will help new students to understand the Java language,

More information

JAVA Training Overview (For Demo Classes Call Us )

JAVA Training Overview (For Demo Classes Call Us ) JAVA Training Overview (For Demo Classes Call Us +91 9990173465) IT SPARK - is one of the well-known and best institutes that provide Java training courses. Working professionals from MNC's associated

More information

Packaging and Deploying Java Based Solutions to WebSphere Message Broker V7

Packaging and Deploying Java Based Solutions to WebSphere Message Broker V7 IBM Software Group Packaging and Deploying Java Based Solutions to WebSphere Message Broker V7 Jeff Lowrey (jlowrey@us.ibm.com) WebSphere Message Broker L2 Support 15 September 2010 WebSphere Support Technical

More information

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Atelier Java - J1. Marwan Burelle.  EPITA Première Année Cycle Ingénieur. marwan.burelle@lse.epita.fr http://wiki-prog.kh405.net Plan 1 2 Plan 3 4 Plan 1 2 3 4 A Bit of History JAVA was created in 1991 by James Gosling of SUN. The first public implementation (v1.0) in 1995.

More information

Run-time Performance Testing in Java

Run-time Performance Testing in Java Charles University in Prague Faculty of Mathematics and Physics MASTER THESIS Jaroslav Kotrč Run-time Performance Testing in Java Department of Distributed and Dependable Systems Supervisor of the master

More information

About me. Jesper Pedersen. Project lead for. Chairman for Boston JBoss User Group. Core developer, JBoss by Red Hat

About me. Jesper Pedersen. Project lead for. Chairman for Boston JBoss User Group. Core developer, JBoss by Red Hat About me Jesper Pedersen Core developer, JBoss by Red Hat Project lead for IronJacamar JCA container Tattletale software quality tool JBoss Profiler 2 profiler suite Papaki high-performance annotation

More information

(A Woefully Incomplete) Introduction To Java. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 11 10/02/2012

(A Woefully Incomplete) Introduction To Java. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 11 10/02/2012 (A Woefully Incomplete) Introduction To Java CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 11 10/02/2012 1 Goals of the Lecture Present an introduction to the Java programming language Coverage

More information

Chair of Software Engineering. Java and C# in depth. Carlo A. Furia, Marco Piccioni, Bertrand Meyer. Java: reflection

Chair of Software Engineering. Java and C# in depth. Carlo A. Furia, Marco Piccioni, Bertrand Meyer. Java: reflection Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Java: reflection Outline Introductory detour: quines Basic reflection Built-in features Introspection Reflective method invocation

More information

Page 1

Page 1 Java 1. Core java a. Core Java Programming Introduction of Java Introduction to Java; features of Java Comparison with C and C++ Download and install JDK/JRE (Environment variables set up) The JDK Directory

More information

JBossCache: an In-Memory Replicated Transactional Cache

JBossCache: an In-Memory Replicated Transactional Cache JBossCache: an In-Memory Replicated Transactional Cache Bela Ban (bela@jboss.org) - Lead JGroups / JBossCache Ben Wang (bwang@jboss.org) - Lead JBossCacheAOP JBoss Inc http://www.jboss.org 09/22/04 1 Goal

More information

GlassFish V3. Jerome Dochez. Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net. Session ID YOUR LOGO HERE

GlassFish V3. Jerome Dochez. Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net. Session ID YOUR LOGO HERE YOUR LOGO HERE GlassFish V3 Jerome Dochez Sun Microsystems, Inc. hk2.dev.java.net, glassfish.dev.java.net Session ID 1 Goal of Your Talk What Your Audience Will Gain Learn how the GlassFish V3 groundbreaking

More information

Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St.

Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St. Why GC is eating all my CPU? Aprof - Java Memory Allocation Profiler Roman Elizarov, Devexperts Joker Conference, St. Petersburg, 2014 Java Memory Allocation Profiler Why it is needed? When to use it?

More information

High-Level Language VMs

High-Level Language VMs High-Level Language VMs Outline Motivation What is the need for HLL VMs? How are these different from System or Process VMs? Approach to HLL VMs Evolutionary history Pascal P-code Object oriented HLL VMs

More information

IP Protection in Java Based Software

IP Protection in Java Based Software IP Protection in Java Based Software By Drona Wilddiary.com Java - The preferred choice A simple Object Oriented Language VM approach, Platform independent Omnipresent - Presence on Desktop, Web browsers

More information

Javac and Eclipse tutorial

Javac and Eclipse tutorial Javac and Eclipse tutorial Author: Balázs Simon, BME IIT, 2013. Contents 1 Introduction... 2 2 JRE and JDK... 2 3 Java and Javac... 2 4 Environment variables... 3 4.1 Setting the environment variables

More information

Introduction. Lecture 1 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz

Introduction. Lecture 1 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Introduction Lecture 1 MIT 12043, Fundamentals of Programming By: Programming Languages There are hundreds of programming languages. Very broadly these languages are categorized as o Low Level Languages

More information

301AA - Advanced Programming [AP-2017]

301AA - Advanced Programming [AP-2017] 301AA - Advanced Programming [AP-2017] Lecturer: Andrea Corradini andrea@di.unipi.it Tutor: Lillo GalleBa galleba@di.unipi.it Department of Computer Science, Pisa Academic Year 2017/18 AP-2017-05: The

More information

metaxa and the Future of Reflection

metaxa and the Future of Reflection metaxa and the Future of Reflection Michael Golm, Jürgen Kleinöder University of Erlangen-Nürnberg Dept. of Computer Science 4 (Operating Systems) Martensstr. 1, D-91058 Erlangen, Germany {golm, kleinoeder}@informatik.uni-erlangen.de

More information

Wednesday, June 23, JBoss Users & Developers Conference. Boston:2010

Wednesday, June 23, JBoss Users & Developers Conference. Boston:2010 JBoss Users & Developers Conference Boston:2010 Zen of Class Loading Jason T. Greene EAP Architect, Red Hat June 2010 What is the Class class? Represents a class, enum, interface, annotation, or primitive

More information

1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these. Answer: B

1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these. Answer: B 1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these 2. How many primitive data types are there in Java? A. 5 B. 6 C. 7 D. 8 3. In Java byte, short, int and long

More information

THE TROUBLE WITH MEMORY

THE TROUBLE WITH MEMORY THE TROUBLE WITH MEMORY OUR MARKETING SLIDE Kirk Pepperdine Authors of jpdm, a performance diagnostic model Co-founded Building the smart generation of performance diagnostic tooling Bring predictability

More information

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented Table of Contents L01 - Introduction L02 - Strings Some Examples Reserved Characters Operations Immutability Equality Wrappers and Primitives Boxing/Unboxing Boxing Unboxing Formatting L03 - Input and

More information

What is Groovy? Almost as cool as me!

What is Groovy? Almost as cool as me! What is Groovy? Groovy is like a super version of Java. It can leverage Java's enterprise capabilities but also has cool productivity features like closures, builders and dynamic typing. From http://groovy.codehaus.org/

More information

Problem: Too Many Platforms!

Problem: Too Many Platforms! Compiling for Different Platforms 2 Program written in some high-level language (C, Fortran, ML,...) Compiled to intermediate form Optimized UNDE THE HOOD: THE JAVA VITUAL MACHINE Code generated for various

More information

Understanding ClassLoaders WebSphere 5.1, 6.0 and 6.1

Understanding ClassLoaders WebSphere 5.1, 6.0 and 6.1 IBM Software Group Understanding ClassLoaders WebSphere 5.1, 6.0 and 6.1 Speaker: Paul Van Norman WebSphere Support Technical Exchange Agenda Classloader overview Classloader delegation mode & policies

More information

Under the Hood: The Java Virtual Machine. Problem: Too Many Platforms! Compiling for Different Platforms. Compiling for Different Platforms

Under the Hood: The Java Virtual Machine. Problem: Too Many Platforms! Compiling for Different Platforms. Compiling for Different Platforms Compiling for Different Platforms Under the Hood: The Java Virtual Machine Program written in some high-level language (C, Fortran, ML, ) Compiled to intermediate form Optimized Code generated for various

More information

Overview of Java s Support for Polymorphism

Overview of Java s Support for Polymorphism Overview of Java s Support for Polymorphism Douglas C. Schmidt d.schmidt@vanderbilt.edu www.dre.vanderbilt.edu/~schmidt Professor of Computer Science Institute for Software Integrated Systems Vanderbilt

More information

엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED

엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED 엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED Outline - Questionnaire Results - Java Overview - Java Examples

More information

Today. Instance Method Dispatch. Instance Method Dispatch. Instance Method Dispatch 11/29/11. today. last time

Today. Instance Method Dispatch. Instance Method Dispatch. Instance Method Dispatch 11/29/11. today. last time CS2110 Fall 2011 Lecture 25 Java program last time Java compiler Java bytecode (.class files) Compile for platform with JIT Interpret with JVM Under the Hood: The Java Virtual Machine, Part II 1 run native

More information

Metamodelling & Metaprogramming. Lena Buffoni

Metamodelling & Metaprogramming. Lena Buffoni Metamodelling & Metaprogramming Lena Buffoni lena.buffoni@liu.se What is a model? A representation of a concept, phenomenon, relationship, structure, system from the real world Used to communicate, test

More information

CSc 372 Comparative Programming Languages. Getting started... Getting started. B: Java Bytecode BCEL

CSc 372 Comparative Programming Languages. Getting started... Getting started. B: Java Bytecode BCEL BCEL CSc 372 Comparative Programming Languages B: Java Bytecode BCEL BCEL (formerly JavaClass) allows you to load a class, iterate through the methods and fields, change methods, add new methods and fields,

More information

<Insert Picture Here> Hudson Web Architecture. Winston Prakash. Click to edit Master subtitle style

<Insert Picture Here> Hudson Web Architecture. Winston Prakash. Click to edit Master subtitle style Hudson Web Architecture Click to edit Master subtitle style Winston Prakash Hudson Plugin Architecture Hudson is an extendable Web Application. The basic platform is extended via

More information

Composing Transformations of Compiled Java Programs with Jabyce

Composing Transformations of Compiled Java Programs with Jabyce UDC 681.3.064 Composing Transformations of Compiled Java Programs with Jabyce Romain Lenglet, Thierry Coupaye, and Eric Bruneton France Telecom R&D Division 28 chemin du Vieux Chêne, 38243 Meylan, France

More information

International Journal of Advance Research in Engineering, Science & Technology HIBERNATE FRAMEWORK FOR ENTERPRISE APPLICATION

International Journal of Advance Research in Engineering, Science & Technology HIBERNATE FRAMEWORK FOR ENTERPRISE APPLICATION Impact Factor (SJIF): 3.632 International Journal of Advance Research in Engineering, Science & Technology e-issn: 2393-9877, p-issn: 2394-2444 Volume 4, Issue 3, March-2017 HIBERNATE FRAMEWORK FOR ENTERPRISE

More information

Scala Benchmark: Invariant Verifier

Scala Benchmark: Invariant Verifier Scala Benchmark: Invariant Verifier Optional Semester Project Pamela Delgado ***** Supervisor: Aleksandar Prokopec Professor: Martin Odersky Programming Methods Laboratory LAMP, EPFL Lausanne, Switzerland

More information

JSR 292 and companions Rémi Forax FOSDEM'09

JSR 292 and companions Rémi Forax FOSDEM'09 JSR 292 and companions Rémi Forax FOSDEM'09 Da Vinci Mission Prototype (J)VM extensions to run non-java languages efficiently Complete the existing architecture with general purpose extensions New languages

More information

JVA-563. Developing RESTful Services in Java

JVA-563. Developing RESTful Services in Java JVA-563. Developing RESTful Services in Java Version 2.0.1 This course shows experienced Java programmers how to build RESTful web services using the Java API for RESTful Web Services, or JAX-RS. We develop

More information

Interpreting Languages for the Java Platform

Interpreting Languages for the Java Platform Interpreting Languages for the Java Platform http://www2.hursley.ibm.com/netrexx/ Mike Cowlishaw IBM Fellow mfc@uk.ibm.com netrexxi Overview A (very) brief introduction to NetRexx Demonstration -- compiling

More information

Reflection (in fact, Java introspection)

Reflection (in fact, Java introspection) Reflection (in fact, Java introspection) Prof. Dr. Ralf Lämmel Universität Koblenz-Landau Software Languages Team Elevator speech So programs are programs and data is data. However, programs can be represented

More information

Programming Dynamic Features and Monitoring Distributed Software Systems

Programming Dynamic Features and Monitoring Distributed Software Systems DST Summer 2018, Lecture 3 Programming Dynamic Features and Monitoring Distributed Software Systems Hong-Linh Truong Faculty of Informatics, TU Wien hong-linh.truong@tuwien.ac.at http://www.infosys.tuwien.ac.at/staff/truong

More information

The JVM is not observable enough (and what to do about it)

The JVM is not observable enough (and what to do about it) The JVM is not observable enough (and what to do about it) Stephen Kell stephen.kell@usi.ch University of Lugano joint work with: Danilo Ansaloni, Walter Binder, Lukáš Marek The JVM is... p.1/20 0xcafebabe

More information

5 Distributed Objects: The Java Approach

5 Distributed Objects: The Java Approach 5 Distributed Objects: The Java Approach Main Points Why distributed objects Distributed Object design points Java RMI Dynamic Code Loading 5.1 What s an Object? An Object is an autonomous entity having

More information

Computer Programming, I. Laboratory Manual. Final Exam Solution

Computer Programming, I. Laboratory Manual. Final Exam Solution Think Twice Code Once The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2005 Khaleel I. Shaheen Computer Programming, I Laboratory Manual Final Exam Solution

More information

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java Learning objectives The Java Environment Understand the basic features of Java What are portability and robustness? Understand the concepts of bytecode and interpreter What is the JVM? Learn few coding

More information

Java Class Loading and Bytecode Verification

Java Class Loading and Bytecode Verification Java Class Loading and Bytecode Verification Every object is a member of some class. The Class class: its members are the (definitions of) various classes that the JVM knows about. The classes can be dynamically

More information

CSc 620 Debugging, Profiling, Tracing, and Visualizing Programs. Getting started... Getting started. 2 : Java Bytecode BCEL

CSc 620 Debugging, Profiling, Tracing, and Visualizing Programs. Getting started... Getting started. 2 : Java Bytecode BCEL BCEL CSc 620 Debugging, Profiling, Tracing, and Visualizing Programs 2 : Java Bytecode BCEL BCEL (formerly JavaClass) allows you to load a class, iterate through the methods and fields, change methods,

More information

Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine

Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine Bytecode Manipulation Techniques for Dynamic Applications for the Java Virtual Machine Eugene Kuleshov, Terracotta Tim Eck, Terracotta Tom Ware, Oracle Corporation Charles Nutter, Sun Microsystems, Inc.

More information

Introduction to Java Programming

Introduction to Java Programming Boaz Kantor Introduction to Computer Science, Fall semester 2009-2010 IDC Herzliya Welcome, geeks! Introduction to Java Programming Plan for today: 1. Before we begin.. 2. What is Java? 3. How to program?

More information

CSc 620 Debugging, Profiling, Tracing, and Visualizing Programs

CSc 620 Debugging, Profiling, Tracing, and Visualizing Programs CSc 620 Debugging, Profiling, Tracing, and Visualizing Programs 2 : Java Bytecode BCEL Christian Collberg Department of Computer Science University of Arizona collberg+620@gmail.com Copyright c 2005Christian

More information

EECS 1001 and EECS 1030M, lab 01 conflict

EECS 1001 and EECS 1030M, lab 01 conflict EECS 1001 and EECS 1030M, lab 01 conflict Those students who are taking EECS 1001 and who are enrolled in lab 01 of EECS 1030M should switch to lab 02. If you need my help with switching lab sections,

More information

Program Transformation with Reflective and Aspect-Oriented Programming

Program Transformation with Reflective and Aspect-Oriented Programming Program Transformation with Reflective and Aspect-Oriented Programming Shigeru Chiba Dept. of Mathematical and Computing Sciences Tokyo Institute of Technology, Japan Abstract. A meta-programming technique

More information

CO Java SE 8: Fundamentals

CO Java SE 8: Fundamentals CO-83527 Java SE 8: Fundamentals Summary Duration 5 Days Audience Application Developer, Developer, Project Manager, Systems Administrator, Technical Administrator, Technical Consultant and Web Administrator

More information

Introduction to Spring Framework: Hibernate, Web MVC & REST

Introduction to Spring Framework: Hibernate, Web MVC & REST Introduction to Spring Framework: Hibernate, Web MVC & REST Course domain: Software Engineering Number of modules: 1 Duration of the course: 50 hours Sofia, 2017 Copyright 2003-2017 IPT Intellectual Products

More information

<Insert Picture Here> Symmetric multilanguage VM architecture: Running Java and JavaScript in Shared Environment on a Mobile Phone

<Insert Picture Here> Symmetric multilanguage VM architecture: Running Java and JavaScript in Shared Environment on a Mobile Phone Symmetric multilanguage VM architecture: Running Java and JavaScript in Shared Environment on a Mobile Phone Oleg Pliss Pavel Petroshenko Agenda Introduction to Monty JVM Motivation

More information

The new Java 1.5. murphee (Werner Schuster)

The new Java 1.5. murphee (Werner Schuster) The new Java 1.5 murphee (Werner Schuster) http://jroller.com/page/murphee Overview Language features in 1.5 Short introduction Use/Don't use? Standard API changes Monitoring and Management Concurrent

More information

Program Fundamentals

Program Fundamentals Program Fundamentals /* HelloWorld.java * The classic Hello, world! program */ class HelloWorld { public static void main (String[ ] args) { System.out.println( Hello, world! ); } } /* HelloWorld.java

More information

JSR 365 (CDI 2.0) Review

JSR 365 (CDI 2.0) Review JSR 365 (CDI 2.0) Review June 16 2015 Antoine Sabot-Durand Agenda History & Background Goals CDI survey Expert Group and working method CDI 2.0 Early Draft 1 Work done on RI and TCK Next steps Q&A 2 History

More information

Running Mistyped Code. Lecture 19: Java Security. Running Mistyped Code. Java Security Architecture. JavaVM. Reference Monitors

Running Mistyped Code. Lecture 19: Java Security. Running Mistyped Code. Java Security Architecture. JavaVM. Reference Monitors CS16: Program and Data Representation University of Virginia Computer Science Spring 006 David Evans Lecture 19: Java Security PS6 Submission: Only to be eligible for the Byte Code Wizard awards. If the

More information

Class, Variable, Constructor, Object, Method Questions

Class, Variable, Constructor, Object, Method Questions Class, Variable, Constructor, Object, Method Questions http://www.wideskills.com/java-interview-questions/java-classes-andobjects-interview-questions https://www.careerride.com/java-objects-classes-methods.aspx

More information

JAVA. Duration: 2 Months

JAVA. Duration: 2 Months JAVA Introduction to JAVA History of Java Working of Java Features of Java Download and install JDK JDK tools- javac, java, appletviewer Set path and how to run Java Program in Command Prompt JVM Byte

More information

Java TM Introduction. Renaud Florquin Isabelle Leclercq. FloConsult SPRL.

Java TM Introduction. Renaud Florquin Isabelle Leclercq. FloConsult SPRL. Java TM Introduction Renaud Florquin Isabelle Leclercq FloConsult SPRL http://www.floconsult.be mailto:info@floconsult.be Java Technical Virtues Write once, run anywhere Get started quickly Write less

More information

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science

Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science Marcin Luckner Warsaw University of Technology Faculty of Mathematics and Information Science mluckner@mini.pw.edu.pl http://www.mini.pw.edu.pl/~lucknerm } Annotations do not directly affect program semantics.

More information

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java Chapter 1 Introduction to Computers, Programs, and Java 1.1 What are hardware and software? 1. A computer is an electronic device that stores and processes data. A computer includes both hardware and software.

More information

Metamodelling & Metaprogramming. Lena Buffoni

Metamodelling & Metaprogramming. Lena Buffoni Metamodelling & Metaprogramming Lena Buffoni lena.buffoni@liu.se What is a model? A representation of a concept, phenomenon, relationship, structure, system from the real world Used to communicate, test

More information

Index COPYRIGHTED MATERIAL

Index COPYRIGHTED MATERIAL Index COPYRIGHTED MATERIAL Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic. Italicized page numbers indicate illustrations. A abstract classes

More information

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. OS and Computer Architecture Last class: OS and Architecture OS and Computer Architecture OS Service Protection Interrupts System Calls IO Scheduling Synchronization Virtual Memory Hardware Support Kernel/User Mode Protected Instructions

More information

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components Last class: OS and Architecture Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation

More information

Java 1.6 Annotations ACCU Tony Barrett-Powell

Java 1.6 Annotations ACCU Tony Barrett-Powell Java 1.6 Annotations ACCU 2007 Tony Barrett-Powell tony.barrett-powell@oracle.com Introduction An exploration of Java annotations Concepts what are annotations? Java 1.6 changes related to annotations

More information

Introduction to Java. Nihar Ranjan Roy. https://sites.google.com/site/niharranjanroy/

Introduction to Java. Nihar Ranjan Roy. https://sites.google.com/site/niharranjanroy/ Introduction to Java https://sites.google.com/site/niharranjanroy/ 1 The Java Programming Language According to sun Microsystems java is a 1. Simple 2. Object Oriented 3. Distributed 4. Multithreaded 5.

More information

LOAN IQ DIAGNOSTIC TOOLS Topic of the Month FusionBanking Loan IQ

LOAN IQ DIAGNOSTIC TOOLS Topic of the Month FusionBanking Loan IQ LOAN IQ DIAGNOSTIC TOOLS Topic of the Month FusionBanking Loan IQ Lorenzo Cerutti SAG Specialist Patricia Malin ESG Manager Lochlann O Donnell ESG Expert Engineer November 2017 Finastra WELCOME TO THE

More information

Equinox Framework: How to get Hooked

Equinox Framework: How to get Hooked Equinox Framework: How to get Hooked Thomas Watson, IBM Lotus Equinox Project co-lead Equinox Framework lead developer 2008 by IBM Corp; made available under the EPL v1.0 March 2008 Tutorial Agenda Equinox

More information

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA 1. JIT meaning a. java in time b. just in time c. join in time d. none of above CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA 2. After the compilation of the java source code, which file is created

More information