SlideShare uma empresa Scribd logo
1 de 47
Back to the Future
with Java 7
Martijn Verburg
(@karianna, @java7developer)

http://www.java7developer.com

                                Slide Design by http://www.kerrykenneally.com
                                                           1
Who is this guy anyway?




                          2
Who is this guy anyway?
http://www.meetup.com/Londonjavacommunity/




                                             3
Who is this guy anyway?




                          4
How this talk is gonna work

• This is a fact!
    – This is an opinion


• Where’s Marty McFly?
    – Tough luck.


• I will not make jokes about Estonia, Skype or the recent football
  results

• This talk may be a little different to advertised...
    – Due to time constraints, other talks and beer




                                                               5
Java’s not dead, it’s just been resting!

• It’s quite true that Java (the language) has been a bit quiet
    – But that’s a lot to do with the “big company” stuff that we’ve heard about


• Java 6 had some significant improvements
    – Performance is a key benefit


• Java 7 sometimes seemed to be lost in the wilderness
    –   Some of the features were released as updates to SE 6
    –   *Big* arguments about some features....
    –   JCP troubles




                                                                      6
How did we get here?
          Where are my shoes?

• The community and the platform have not been quiet
   –   You’re a noisy bunch, that’s for sure!
   –   Conference attendances are _way_ up and growing
   –   Oracle marketing estimates 9-10 million developers
   –   Dozens of new JVM languages


• We’re moving again
   – OpenJDK is liberated (GPL)
   – Like any good democracy, we need to be vigilant of our freedoms
   – JCP deadlock needed to be broken




                                                            7
Along came Larry...




                      8
                      9
Parting of ways / new joiners




                                                9
                                Original Image by Acaben
OpenJDK - Plan B

• 20 Sep 2010 - Mark Reinhold announces Plan B
   – Splits OpenJDK effort into Java 7 (July 2011) and Java 8 (2012)
   – Popular choice with the community

• Some JRockit features to be added to OpenJDK
   – Enhanced mgmt of the JVM
   – Exact roadmap not yet clear


• Changes to the memory model
   – Bye-bye Permgen - *almost*


• Some new features to be delayed until JDK 8
   – Closures Lambdas SAM literals
   – Modularisation (aka Jigsaw)

                                                                  10
Project Coin

• “Small” changes

• Language Level, not VM

• Stay away from the type system

• Developed in a very OSS manner
   –   From idea inception through to development
   –   Initial ideas must come with a strawman prototype
   –   Was an ‘interesting’ experience for all involved
   –   Looks likely to be repeated for JDK 8 small features




                                                              11
Project Coin - Highlights

• Strings in switch

• try-with-resources (aka ARM or TWR)

• Enhanced syntax for numeric literals

• Diamond Syntax




                                         12
Strings in switch

public void printDay(String dayOfWeek) {
  switch (dayOfWeek) {
    case "Sunday": System.out.println("Dimanche"); break;
    case "Monday": System.out.println("Lundi"); break;
    case "Tuesday": System.out.println("Mardi"); break;
    case "Wednesday": System.out.println("Mercredi"); break;
    case "Thursday": System.out.println("Jeudi"); break;
    case "Friday": System.out.println("Vendredi"); break;
    case "Saturday": System.out.println("Samedi"); break;
    default:
      System.out.println("Error: [" + dayOfWeek + "] is not a day
      of the week");
      break;
  }
}




                                                          13
try-with-resources

// Some exception handling omitted,
// bonus points for guessing the right one!
URL url =
  new URL("http://www.java7developer.com/blog/?page_id=97");
try (InputStream in = url.openStream())
{
  Files.copy(in, Paths.get("output.txt"));
}
catch(IOException ex)
{
  ex.printStackTrace();
}




                                                          14
Enhanced numeric literals

int x = 0b1100110;


byte allOnes = 255y; // (byte)0xFF or -1 in Java 6

long anotherLong = 2_147_483_648L;


// Help for bit-twiddlers
int bitPattern = 0b0001_1100__0011_0111__0010_1011__1010_0011;




                                                          15
Diamond syntax

Map<Integer, Map<String, String>> usersLists =
  new HashMap<Integer, Map<String, String>>();


// Wouldn't it be better if we could just write something like:
Map<Integer, Map<String, String>> usersLists = new HashMap<>();



// This is actually true type inference, not string substitution

/*
 * .NET and Scala type infer on variables
 * Java’s diamond syntax type infers on values
 */




                                                          16
NIO.2 - New I/O version 2

• Is aimed at simplifying I/O in Java

• A new file system and path abstraction
   – Based on Path
   – Bulk access to file attributes
   – File system specific support (e.g. Symbolic links)

• Asynchronous (non-blocking) I/O
   – For sockets and files
   – Mainly utilises java.util.concurrent.Future

• Socket/Channel construct
   – Binding, options and multicast


                                                          13
URLStream to file - Java 6 style

URL url =
  new URL("http://www.java7developer.com/blog/?page_id=97");
try (
  FileOutputStream fos =
    new FileOutputStream(new File("output.txt"));
  InputStream is = url.openStream() )
{
  byte[] buf = new byte[4096];
  int len;
  while ((len = is.read(buf)) > 0)
  {
    fos.write(buf, 0, len);
  }
} catch (IOException e)
{
  e.printStackTrace();
}
                                                          18
URL stream to file in Java 7


URL url =
  new URL("http://www.java7developer.com/blog/?page_id=97");
try (InputStream in = url.openStream())
{
  Files.copy(in, Paths.get("output.txt"));
}
catch(IOException ex)
{
  ex.printStackTrace();
}




                                                          19
NIO.2 - Future base file I/O

try
{
  Path file = Paths.get("/usr/karianna/foobar.txt");
  AsynchronousFileChannel channel =
    AsynchronousFileChannel.open(file);
  ByteBuffer buffer = ByteBuffer.allocate(100_000);
  Future<Integer> result = channel.read(buffer, 0);
  while(!result.isDone())
  {
    System.out.println("Pretend Business Process");
  }
  Integer bytesRead = result.get();
}
catch (IOException | ExecutionException | InterruptedException e)
{
  e.printStackTrace();
}
                                                          20
NIO.2 - New I/O version 2

• Come in as part of invokedynamic

• Runtime Currently we have observation with Reflection API
   – See interfaces/classes/methods and fields at runtime
       • Without knowing their names at compile time


• JDK 7 introduces a new way to inspect at runtime

• Method Handles
   – Implement a subclass of java.lang.invoke.MethodHandle
   – Are objects that represent the ability to call a method
       • More powerful than Callables


• May the presenter gods be kind....

                                                               13
Example - ThreadPoolManager

private final ScheduledExecutorService stpe =
  Executors.newScheduledThreadPool(2);


private final BlockingQueue<WorkUnit<String>> lbq;

public ScheduledFuture<?> run(QueueReaderTask msgReader) {
  msgReader.setQueue(lbq);
  return stpe.scheduleAtFixedRate(msgReader, 10, 10,
    TimeUnit.MILLISECONDS);
}

private void cancel(final ScheduledFuture<?> handle) {
  stpe.schedule(new Runnable() {
    public void run() { handle.cancel(true); }
  }, 10, TimeUnit.MILLISECONDS);
}


                                                             22
Cancelling using Reflection

// .... in ThreadPoolManager
public Method makeMethod() {
  Method method = null;
  try {
    Class<?>[] argTypes = new Class[] { ScheduledFuture.class };
    method = ThreadPoolManager.class.getDeclaredMethod("cancel",
      argTypes);
    method.setAccessible(true);
  } catch (IllegalArgumentException |
           NoSuchMethodException |
           SecurityException e) {
    e.printStackTrace();
  }
  return meth;
}




                                                          23
Cancelling using a Proxy

// .... in ThreadPoolManager
public static class CancelProxy {

    private CancelProxy() { }

    public void invoke(ThreadPoolManager manager,
                       ScheduledFuture<?> handle)
    {
      manager.cancel(handle);
    }
}


public CancelProxy makeProxy() {
  return new CancelProxy();
}




                                                    24
Cancelling using MethodHandle

// .... in ThreadPoolManager
public MethodHandle makeMh() {
  MethodHandle methodHandle;

    // MethodType.methodType encodes return type & args
    MethodType methodType = MethodType.methodType(void.class,
      ScheduledFuture.class);
    try
    {
      methodHandle = MethodHandles.lookup().findVirtual
        (ThreadPoolManager.class, "cancel", methodType);
    }
    catch (NoAccessException e)
    {
      throw (AssertionError)new AssertionError().initCause(e);
    }
    return methodHandle;
}
                                                            25
MethodHandle Contrasted

              Reflection             Proxies                  MethodHandle


Access        Must use               Inner classes can        Full access to all
              setAccessible().       access restricted        methods allowed from
Control                              methods.                 context. No issue with
              Can be disallowed by
              security manager.                               security managers.


Type          None. Ugly exception   Static. Can be too       Typesafe at run-time.
              on mismatch.           strict. May need a lot   Does not consume
Discipline                           of permgen for all       permgen.
                                     proxies.

Performance   Slow compared to       Fast as any other        Aiming to be as fast
              alternatives.          method call.             as other method calls.




                                                                             26
InvokeDynamic

• invokedynamic is a key new JVM feature
    – It’s the first new bytecode since Java 1.0
    – Joins invokevirtual, invokestatic, invokeinterface and
      invokespecial


• It removes a key part of the static typing system
    – Method names / signatures will not need to be known at compile time
    – User code can determine dispatch at runtime (uses MethodHandle)

• Aims to be as fast as invokevirtual

• No Java syntax for handling it in Java 7 - but maybe for 8



                                                                  27
A friend to dynamic languages

• Free, open JVM languages such as JRuby, Jython, Groovy, Clojure
  et al all stand to benefit from invokedynamic
    – These gains will vary, JRuby gains a lot, Clojure not so much
    – They’re even bringing it to Scala!

• Groovy is already well established as Java’s flexible friend
    – Increasing its performance keeps it at the forefront

• JRuby has been working closely with the JSR-292 team
    – Big potential wins
    – Makes JRuby enticing to Ruby developers




                                                                      28
And now for something
          completely different - Concurrency

• Threads are like Otters!

• Collaborative

• Competitive

• Sneaky

• Hare off in different directions

• Can wreak havoc if not contained




                                               29
Concurrency matters again
Fork/Join

• Java 7 gets in on the concurrency party with F/J
   – similar to MapReduce
   – useful for a certain class of problems
   – fork and join executions are not necessarily threads

• In our example, we subclass RecursiveAction


• Need to override compute() method

• Framework provides
   – an invokeAll() to hand off more tasks
   – Dynamic thread pool
   – Work Queues, inc. Work stealing


                                                            31
Fork/Join - compute

@Override
protected void compute() {
  if (size() < SMALL_ENOUGH) {
    System.arraycopy(updates, start, result, 0, size());
    Arrays.sort(result, 0, size());
  } else {
    int mid = size() / 2;
    BlogUpdateSorter left = new BlogUpdateSorter
      (updates, start, start + mid);
    BlogUpdateSorter right = new BlogUpdateSorter
      (updates, start + mid, end);

        // NB: This is a synchronous call
        invokeAll(left, right);
        merge(left, right);
    }
}


                                                           32
Fork/Join - merge

private void merge(BlogUpdateSorter left, BlogUpdateSorter right) {
  int i, lCt, rCt = 0;

    while (lCt < left.size() && rCt < right.size()) {
      result[i++]
        = (left.result[lCt].compareTo(right.result[rCt]) < 0)
           ? left.result[lCt++]
           : right.result[rCt++];
    }
    while (lCt < left.size()) result[i++] = left.result[lCt++];
    while (rCt < right.size()) result[i++] = right.result[rCt++];
}


public int size() { return end - start; }

public Update[] getResult() { return result; }


                                                            33
New concurrency models

• Java’s approach of mutable state, locks and visible by default looks
  increasingly dated
    – java.util.concurrent is a big help, but can only go so far
    – Java’s syntax and semantics are constraints
    – Thread is not a high-level concurrency abstraction

• Other languages on the JVM are free to innovate
    – Scala
        • Powerful actors model
    – Clojure
        •   Immutable by default
        •   Thread-isolation by default
        •   STM subsystem
        •   Multiple concurrency models




                                                               34
What’s in my future?

• Learning another JVM language won’t hurt!
    – Lots to choose from
    – No “Java Killer” yet.....

• Don’t forget about Java 7!
    – Some compelling new features (Coin, NIO.2, F/J, etc)
    – Yet more performance

• The Multi-core revolution is here
    – Brush up your modern concurrency
    – Java 7 makes this easier
    – Other languages offer alternative approaches




                                                             35
Java isn’t just the language, it’s the ecosystem




                                         36
And it’s about the community innit!




                                      37
Future of Java SE

• Will be just fine

• The mainline VM will continue to improve
   – invokedynamic
   – JRockit feature merge
   – Typed values? Structs for HPC?

• Probably not too many faddish language features
   – But you can have what you want anyway in other JVM languages
   – Yeah, we’re looking at you Scala, Clojure, Groovy fans




                                                              38
Future of JEE

• The future here looks bright!
   – More servers have become JEE6 certified
   – JEE7 process is starting to get underway
   – RESTFul and cloud at the forefront


• JEE has shrunk whilst the alternatives have grown
   – They’re pretty much meeting in the middle
   – Spring is quite big these days...

• Case Study - Adam Bien (Java Champion)
   – Live Demo - rapid development of apps with core JEE6
       • Check out the Parleys.com videos of him online




                                                            39
Future of Java ME

• On the decline?
   – Nokia has dropped it from their technology roadmap
   – ME still popular in the “dumbphone” market
       • That’s still a really huge market


• Oracle are working on “ME.next”

• Could Java SE eventually run on mobiles?
   – Maybe after JDK 8?

• Could Android become the official replacement for Java ME?
   – “No Comment” (Oracle and Google)
   – Seems unlikely today, but stranger things have happened



                                                               40
Google vs. Oracle - Round 1!




                               41
Where’s the lawsuit at?

• http://www.groklaw.net (search for Oracle Google)

• Most recent case event: #patents relevant reduced - maybe
   – Won’t hear any more significant news for another few months


• Developer community at Devoxx ‘10 voted (87%) that the lawsuit
  was harmful in some way to Java
   – Repeated surveys get similar results


• The message that this is scaring off the community & corporate
  customers is getting through to Oracle Mgmt
   – We’ve seen improvements




                                                            42
Java FX

• Well, v1.0 was a nice try
   – Did anyone really want JavaFX Script?


• Java FX 2.0 is coming
   – Refocus around Java and other JVM languages
   – Does a Java client even matter anymore?
   – Can it shake off the FX Script legacy?


• MSFT are downgrading Silverlight from their roadmap
   – ‘HTML5’ seems to be the way forward


• Why have another runtime in a browser when it already has a
  capable VM (i.e. JavaScript)?


                                                        43
JCP - Trouble in paradise?

• OK, so it was never _really_ paradise

• Stephen Colebourne’s blog captured some of the events
   – http://www.jroller.com/scolebourne/


• Prominent members left
   – Doug Lea, “Crazy” Bob Lee

• Community members Werner Keil, LJC and SouJava have joined
   – Hopefully can work with Oracle et al on positive changes
   – Starting with JSR 348
   – Now is a good time to make your voice heard!




                                                                44
OpenJDK governance?

• Was there a mature OSS gov. model for OpenJDK?

• Surely something is better than nothing

• New attempt being made by Mark Reinhold & the committee
   –   Really positive that the team are trying to make progress
   –   Open mailing list: .... Doug Lea is back
   –   Still an awful lot to be ironed out - but possibilities
   –   Burden’s still on Oracle to engage with the community
   –   But the community need to step up as well




                                                                   45
The future’s bright.
         The future’s Java!

• We have arguably the most capable VM on the planet

• We have a wealth of new languages to complement and challenge
  Java (and Java 7 of course)!

• We have oceans of open source software

• We have a great community (you guys)!!

• Opportunity to engage & utilise our “Interesting Times”

• It’s a GREAT time to be working in the Java ecosystem



                                                            46
Thanks for listening!
        (http://www.java7developer.com)




• Martijn Verburg - @karianna
• Slides at slideshare.com
                                          47

Mais conteúdo relacionado

Mais procurados

JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011Charles Nutter
 
Highlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG KoblenzHighlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG KoblenzVadym Kazulkin
 
Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Anton Arhipov
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습DoHyun Jung
 
Everything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsEverything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsAndrei Pangin
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Charles Nutter
 
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~ikikko
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Anton Arhipov
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesCharles Nutter
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGuillaume Laforge
 
Do we need Unsafe in Java?
Do we need Unsafe in Java?Do we need Unsafe in Java?
Do we need Unsafe in Java?Andrei Pangin
 
JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015Charles Nutter
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleAnton Arhipov
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBHiro Asari
 
Building a java tracer
Building a java tracerBuilding a java tracer
Building a java tracerrahulrevo
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and UtilitiesPramod Kumar
 
Groovy And Grails JUG Trento
Groovy And Grails JUG TrentoGroovy And Grails JUG Trento
Groovy And Grails JUG TrentoJohn Leach
 

Mais procurados (20)

JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Highlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG KoblenzHighlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
Highlights from Java 10, 11 and 12 and Future of Java at JUG Koblenz
 
Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011Java Bytecode For Discriminating Developers - GeeCON 2011
Java Bytecode For Discriminating Developers - GeeCON 2011
 
모던자바의 역습
모던자바의 역습모던자바의 역습
모던자바의 역습
 
JRuby and You
JRuby and YouJRuby and You
JRuby and You
 
Everything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap DumpsEverything you wanted to know about Stack Traces and Heap Dumps
Everything you wanted to know about Stack Traces and Heap Dumps
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 
Java 7: Quo vadis?
Java 7: Quo vadis?Java 7: Quo vadis?
Java 7: Quo vadis?
 
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
Jenkins 2を使った究極のpipeline ~ 明日もう一度来てください、本物のpipelineをお見せしますよ ~
 
Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011Java Bytecode for Discriminating Developers - JavaZone 2011
Java Bytecode for Discriminating Developers - JavaZone 2011
 
NIO and NIO2
NIO and NIO2NIO and NIO2
NIO and NIO2
 
JavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for DummiesJavaOne 2011 - JVM Bytecode for Dummies
JavaOne 2011 - JVM Bytecode for Dummies
 
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume LaforgeGroovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
Groovy and Grails in Action - Devoxx 2008 - University - Guillaume Laforge
 
Do we need Unsafe in Java?
Do we need Unsafe in Java?Do we need Unsafe in Java?
Do we need Unsafe in Java?
 
JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015JRuby and Invokedynamic - Japan JUG 2015
JRuby and Invokedynamic - Japan JUG 2015
 
GeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassleGeeCON 2017 - TestContainers. Integration testing without the hassle
GeeCON 2017 - TestContainers. Integration testing without the hassle
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRB
 
Building a java tracer
Building a java tracerBuilding a java tracer
Building a java tracer
 
Use of Apache Commons and Utilities
Use of Apache Commons and UtilitiesUse of Apache Commons and Utilities
Use of Apache Commons and Utilities
 
Groovy And Grails JUG Trento
Groovy And Grails JUG TrentoGroovy And Grails JUG Trento
Groovy And Grails JUG Trento
 

Destaque

Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Martijn Verburg
 
Modern Java Concurrency (Devoxx Nov/2011)
Modern Java Concurrency (Devoxx Nov/2011)Modern Java Concurrency (Devoxx Nov/2011)
Modern Java Concurrency (Devoxx Nov/2011)Martijn Verburg
 
Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)
Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)
Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)Martijn Verburg
 
Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)
Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)
Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)Martijn Verburg
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Martijn Verburg
 
Free community with deep roots
Free community with deep rootsFree community with deep roots
Free community with deep rootsMartijn Verburg
 
Introduction to Java 7 (Devoxx Nov/2011)
Introduction to Java 7 (Devoxx Nov/2011)Introduction to Java 7 (Devoxx Nov/2011)
Introduction to Java 7 (Devoxx Nov/2011)Martijn Verburg
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Martijn Verburg
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Garbage Collection - The Useful Parts
Garbage Collection - The Useful PartsGarbage Collection - The Useful Parts
Garbage Collection - The Useful PartsMartijn Verburg
 
Modern software development anti patterns (OSCON 2012)
Modern software development anti patterns (OSCON 2012)Modern software development anti patterns (OSCON 2012)
Modern software development anti patterns (OSCON 2012)Martijn Verburg
 
Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)Martijn Verburg
 

Destaque (13)

Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)
 
Modern Java Concurrency (Devoxx Nov/2011)
Modern Java Concurrency (Devoxx Nov/2011)Modern Java Concurrency (Devoxx Nov/2011)
Modern Java Concurrency (Devoxx Nov/2011)
 
Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)
Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)
Paperwork, Politics and Pain - Our year in the JCP (FOSDEM 2012)
 
Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)
Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)
Adopt OpenJDK - Lessons learned and Where we're going (FOSDEM 2013)
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
 
Free community with deep roots
Free community with deep rootsFree community with deep roots
Free community with deep roots
 
Introduction to Java 7 (Devoxx Nov/2011)
Introduction to Java 7 (Devoxx Nov/2011)Introduction to Java 7 (Devoxx Nov/2011)
Introduction to Java 7 (Devoxx Nov/2011)
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Garbage Collection - The Useful Parts
Garbage Collection - The Useful PartsGarbage Collection - The Useful Parts
Garbage Collection - The Useful Parts
 
NoHR Hiring
NoHR HiringNoHR Hiring
NoHR Hiring
 
Modern software development anti patterns (OSCON 2012)
Modern software development anti patterns (OSCON 2012)Modern software development anti patterns (OSCON 2012)
Modern software development anti patterns (OSCON 2012)
 
Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)Modern Java Concurrency (OSCON 2012)
Modern Java Concurrency (OSCON 2012)
 

Semelhante a Back to the future with Java 7 (Geekout June/2011)

What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem novaKotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem novaVíctor Leonel Orozco López
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx FranceDavid Delabassee
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Rittercatherinewall
 
DevNexus 2020: Discover Modern Java
DevNexus 2020: Discover Modern JavaDevNexus 2020: Discover Modern Java
DevNexus 2020: Discover Modern JavaHenri Tremblay
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Agora Group
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy PluginsPaul King
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Ivelin Yanev
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Sylvain Wallez
 
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?Henri Tremblay
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneAndres Almiray
 
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010Arun Gupta
 
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov Nayden Gochev
 

Semelhante a Back to the future with Java 7 (Geekout June/2011) (20)

What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem novaKotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
Kotlin+MicroProfile: Ensinando 20 anos para uma linguagem nova
 
55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France55 new things in Java 7 - Devoxx France
55 new things in Java 7 - Devoxx France
 
Java
JavaJava
Java
 
Java Future S Ritter
Java Future S RitterJava Future S Ritter
Java Future S Ritter
 
55 New Features in Java 7
55 New Features in Java 755 New Features in Java 7
55 New Features in Java 7
 
DevNexus 2020: Discover Modern Java
DevNexus 2020: Discover Modern JavaDevNexus 2020: Discover Modern Java
DevNexus 2020: Discover Modern Java
 
Best Of Jdk 7
Best Of Jdk 7Best Of Jdk 7
Best Of Jdk 7
 
Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011Terence Barr - jdk7+8 - 24mai2011
Terence Barr - jdk7+8 - 24mai2011
 
Atlassian Groovy Plugins
Atlassian Groovy PluginsAtlassian Groovy Plugins
Atlassian Groovy Plugins
 
Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11Java features. Java 8, 9, 10, 11
Java features. Java 8, 9, 10, 11
 
Java >= 9
Java >= 9Java >= 9
Java >= 9
 
Java 7 & 8 New Features
Java 7 & 8 New FeaturesJava 7 & 8 New Features
Java 7 & 8 New Features
 
What`s new in Java 7
What`s new in Java 7What`s new in Java 7
What`s new in Java 7
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
OracleCode One 2018: Java 5, 6, 7, 8, 9, 10, 11: What Did You Miss?
 
Oscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast LaneOscon Java Testing on the Fast Lane
Oscon Java Testing on the Fast Lane
 
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
S314168 - What's New in Enterprise Java Bean Technology @ JavaOne Brazil 2010
 
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
Lecture from javaday.bg by Nayden Gochev/ Ivan Ivanov and Mitia Alexandrov
 

Último

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Último (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

Back to the future with Java 7 (Geekout June/2011)

  • 1. Back to the Future with Java 7 Martijn Verburg (@karianna, @java7developer) http://www.java7developer.com Slide Design by http://www.kerrykenneally.com 1
  • 2. Who is this guy anyway? 2
  • 3. Who is this guy anyway? http://www.meetup.com/Londonjavacommunity/ 3
  • 4. Who is this guy anyway? 4
  • 5. How this talk is gonna work • This is a fact! – This is an opinion • Where’s Marty McFly? – Tough luck. • I will not make jokes about Estonia, Skype or the recent football results • This talk may be a little different to advertised... – Due to time constraints, other talks and beer 5
  • 6. Java’s not dead, it’s just been resting! • It’s quite true that Java (the language) has been a bit quiet – But that’s a lot to do with the “big company” stuff that we’ve heard about • Java 6 had some significant improvements – Performance is a key benefit • Java 7 sometimes seemed to be lost in the wilderness – Some of the features were released as updates to SE 6 – *Big* arguments about some features.... – JCP troubles 6
  • 7. How did we get here? Where are my shoes? • The community and the platform have not been quiet – You’re a noisy bunch, that’s for sure! – Conference attendances are _way_ up and growing – Oracle marketing estimates 9-10 million developers – Dozens of new JVM languages • We’re moving again – OpenJDK is liberated (GPL) – Like any good democracy, we need to be vigilant of our freedoms – JCP deadlock needed to be broken 7
  • 9. Parting of ways / new joiners 9 Original Image by Acaben
  • 10. OpenJDK - Plan B • 20 Sep 2010 - Mark Reinhold announces Plan B – Splits OpenJDK effort into Java 7 (July 2011) and Java 8 (2012) – Popular choice with the community • Some JRockit features to be added to OpenJDK – Enhanced mgmt of the JVM – Exact roadmap not yet clear • Changes to the memory model – Bye-bye Permgen - *almost* • Some new features to be delayed until JDK 8 – Closures Lambdas SAM literals – Modularisation (aka Jigsaw) 10
  • 11. Project Coin • “Small” changes • Language Level, not VM • Stay away from the type system • Developed in a very OSS manner – From idea inception through to development – Initial ideas must come with a strawman prototype – Was an ‘interesting’ experience for all involved – Looks likely to be repeated for JDK 8 small features 11
  • 12. Project Coin - Highlights • Strings in switch • try-with-resources (aka ARM or TWR) • Enhanced syntax for numeric literals • Diamond Syntax 12
  • 13. Strings in switch public void printDay(String dayOfWeek) { switch (dayOfWeek) { case "Sunday": System.out.println("Dimanche"); break; case "Monday": System.out.println("Lundi"); break; case "Tuesday": System.out.println("Mardi"); break; case "Wednesday": System.out.println("Mercredi"); break; case "Thursday": System.out.println("Jeudi"); break; case "Friday": System.out.println("Vendredi"); break; case "Saturday": System.out.println("Samedi"); break; default: System.out.println("Error: [" + dayOfWeek + "] is not a day of the week"); break; } } 13
  • 14. try-with-resources // Some exception handling omitted, // bonus points for guessing the right one! URL url = new URL("http://www.java7developer.com/blog/?page_id=97"); try (InputStream in = url.openStream()) { Files.copy(in, Paths.get("output.txt")); } catch(IOException ex) { ex.printStackTrace(); } 14
  • 15. Enhanced numeric literals int x = 0b1100110; byte allOnes = 255y; // (byte)0xFF or -1 in Java 6 long anotherLong = 2_147_483_648L; // Help for bit-twiddlers int bitPattern = 0b0001_1100__0011_0111__0010_1011__1010_0011; 15
  • 16. Diamond syntax Map<Integer, Map<String, String>> usersLists = new HashMap<Integer, Map<String, String>>(); // Wouldn't it be better if we could just write something like: Map<Integer, Map<String, String>> usersLists = new HashMap<>(); // This is actually true type inference, not string substitution /* * .NET and Scala type infer on variables * Java’s diamond syntax type infers on values */ 16
  • 17. NIO.2 - New I/O version 2 • Is aimed at simplifying I/O in Java • A new file system and path abstraction – Based on Path – Bulk access to file attributes – File system specific support (e.g. Symbolic links) • Asynchronous (non-blocking) I/O – For sockets and files – Mainly utilises java.util.concurrent.Future • Socket/Channel construct – Binding, options and multicast 13
  • 18. URLStream to file - Java 6 style URL url = new URL("http://www.java7developer.com/blog/?page_id=97"); try ( FileOutputStream fos = new FileOutputStream(new File("output.txt")); InputStream is = url.openStream() ) { byte[] buf = new byte[4096]; int len; while ((len = is.read(buf)) > 0) { fos.write(buf, 0, len); } } catch (IOException e) { e.printStackTrace(); } 18
  • 19. URL stream to file in Java 7 URL url = new URL("http://www.java7developer.com/blog/?page_id=97"); try (InputStream in = url.openStream()) { Files.copy(in, Paths.get("output.txt")); } catch(IOException ex) { ex.printStackTrace(); } 19
  • 20. NIO.2 - Future base file I/O try { Path file = Paths.get("/usr/karianna/foobar.txt"); AsynchronousFileChannel channel = AsynchronousFileChannel.open(file); ByteBuffer buffer = ByteBuffer.allocate(100_000); Future<Integer> result = channel.read(buffer, 0); while(!result.isDone()) { System.out.println("Pretend Business Process"); } Integer bytesRead = result.get(); } catch (IOException | ExecutionException | InterruptedException e) { e.printStackTrace(); } 20
  • 21. NIO.2 - New I/O version 2 • Come in as part of invokedynamic • Runtime Currently we have observation with Reflection API – See interfaces/classes/methods and fields at runtime • Without knowing their names at compile time • JDK 7 introduces a new way to inspect at runtime • Method Handles – Implement a subclass of java.lang.invoke.MethodHandle – Are objects that represent the ability to call a method • More powerful than Callables • May the presenter gods be kind.... 13
  • 22. Example - ThreadPoolManager private final ScheduledExecutorService stpe = Executors.newScheduledThreadPool(2); private final BlockingQueue<WorkUnit<String>> lbq; public ScheduledFuture<?> run(QueueReaderTask msgReader) { msgReader.setQueue(lbq); return stpe.scheduleAtFixedRate(msgReader, 10, 10, TimeUnit.MILLISECONDS); } private void cancel(final ScheduledFuture<?> handle) { stpe.schedule(new Runnable() { public void run() { handle.cancel(true); } }, 10, TimeUnit.MILLISECONDS); } 22
  • 23. Cancelling using Reflection // .... in ThreadPoolManager public Method makeMethod() { Method method = null; try { Class<?>[] argTypes = new Class[] { ScheduledFuture.class }; method = ThreadPoolManager.class.getDeclaredMethod("cancel", argTypes); method.setAccessible(true); } catch (IllegalArgumentException | NoSuchMethodException | SecurityException e) { e.printStackTrace(); } return meth; } 23
  • 24. Cancelling using a Proxy // .... in ThreadPoolManager public static class CancelProxy { private CancelProxy() { } public void invoke(ThreadPoolManager manager, ScheduledFuture<?> handle) { manager.cancel(handle); } } public CancelProxy makeProxy() { return new CancelProxy(); } 24
  • 25. Cancelling using MethodHandle // .... in ThreadPoolManager public MethodHandle makeMh() { MethodHandle methodHandle; // MethodType.methodType encodes return type & args MethodType methodType = MethodType.methodType(void.class, ScheduledFuture.class); try { methodHandle = MethodHandles.lookup().findVirtual (ThreadPoolManager.class, "cancel", methodType); } catch (NoAccessException e) { throw (AssertionError)new AssertionError().initCause(e); } return methodHandle; } 25
  • 26. MethodHandle Contrasted Reflection Proxies MethodHandle Access Must use Inner classes can Full access to all setAccessible(). access restricted methods allowed from Control methods. context. No issue with Can be disallowed by security manager. security managers. Type None. Ugly exception Static. Can be too Typesafe at run-time. on mismatch. strict. May need a lot Does not consume Discipline of permgen for all permgen. proxies. Performance Slow compared to Fast as any other Aiming to be as fast alternatives. method call. as other method calls. 26
  • 27. InvokeDynamic • invokedynamic is a key new JVM feature – It’s the first new bytecode since Java 1.0 – Joins invokevirtual, invokestatic, invokeinterface and invokespecial • It removes a key part of the static typing system – Method names / signatures will not need to be known at compile time – User code can determine dispatch at runtime (uses MethodHandle) • Aims to be as fast as invokevirtual • No Java syntax for handling it in Java 7 - but maybe for 8 27
  • 28. A friend to dynamic languages • Free, open JVM languages such as JRuby, Jython, Groovy, Clojure et al all stand to benefit from invokedynamic – These gains will vary, JRuby gains a lot, Clojure not so much – They’re even bringing it to Scala! • Groovy is already well established as Java’s flexible friend – Increasing its performance keeps it at the forefront • JRuby has been working closely with the JSR-292 team – Big potential wins – Makes JRuby enticing to Ruby developers 28
  • 29. And now for something completely different - Concurrency • Threads are like Otters! • Collaborative • Competitive • Sneaky • Hare off in different directions • Can wreak havoc if not contained 29
  • 31. Fork/Join • Java 7 gets in on the concurrency party with F/J – similar to MapReduce – useful for a certain class of problems – fork and join executions are not necessarily threads • In our example, we subclass RecursiveAction • Need to override compute() method • Framework provides – an invokeAll() to hand off more tasks – Dynamic thread pool – Work Queues, inc. Work stealing 31
  • 32. Fork/Join - compute @Override protected void compute() { if (size() < SMALL_ENOUGH) { System.arraycopy(updates, start, result, 0, size()); Arrays.sort(result, 0, size()); } else { int mid = size() / 2; BlogUpdateSorter left = new BlogUpdateSorter (updates, start, start + mid); BlogUpdateSorter right = new BlogUpdateSorter (updates, start + mid, end); // NB: This is a synchronous call invokeAll(left, right); merge(left, right); } } 32
  • 33. Fork/Join - merge private void merge(BlogUpdateSorter left, BlogUpdateSorter right) { int i, lCt, rCt = 0; while (lCt < left.size() && rCt < right.size()) { result[i++] = (left.result[lCt].compareTo(right.result[rCt]) < 0) ? left.result[lCt++] : right.result[rCt++]; } while (lCt < left.size()) result[i++] = left.result[lCt++]; while (rCt < right.size()) result[i++] = right.result[rCt++]; } public int size() { return end - start; } public Update[] getResult() { return result; } 33
  • 34. New concurrency models • Java’s approach of mutable state, locks and visible by default looks increasingly dated – java.util.concurrent is a big help, but can only go so far – Java’s syntax and semantics are constraints – Thread is not a high-level concurrency abstraction • Other languages on the JVM are free to innovate – Scala • Powerful actors model – Clojure • Immutable by default • Thread-isolation by default • STM subsystem • Multiple concurrency models 34
  • 35. What’s in my future? • Learning another JVM language won’t hurt! – Lots to choose from – No “Java Killer” yet..... • Don’t forget about Java 7! – Some compelling new features (Coin, NIO.2, F/J, etc) – Yet more performance • The Multi-core revolution is here – Brush up your modern concurrency – Java 7 makes this easier – Other languages offer alternative approaches 35
  • 36. Java isn’t just the language, it’s the ecosystem 36
  • 37. And it’s about the community innit! 37
  • 38. Future of Java SE • Will be just fine • The mainline VM will continue to improve – invokedynamic – JRockit feature merge – Typed values? Structs for HPC? • Probably not too many faddish language features – But you can have what you want anyway in other JVM languages – Yeah, we’re looking at you Scala, Clojure, Groovy fans 38
  • 39. Future of JEE • The future here looks bright! – More servers have become JEE6 certified – JEE7 process is starting to get underway – RESTFul and cloud at the forefront • JEE has shrunk whilst the alternatives have grown – They’re pretty much meeting in the middle – Spring is quite big these days... • Case Study - Adam Bien (Java Champion) – Live Demo - rapid development of apps with core JEE6 • Check out the Parleys.com videos of him online 39
  • 40. Future of Java ME • On the decline? – Nokia has dropped it from their technology roadmap – ME still popular in the “dumbphone” market • That’s still a really huge market • Oracle are working on “ME.next” • Could Java SE eventually run on mobiles? – Maybe after JDK 8? • Could Android become the official replacement for Java ME? – “No Comment” (Oracle and Google) – Seems unlikely today, but stranger things have happened 40
  • 41. Google vs. Oracle - Round 1! 41
  • 42. Where’s the lawsuit at? • http://www.groklaw.net (search for Oracle Google) • Most recent case event: #patents relevant reduced - maybe – Won’t hear any more significant news for another few months • Developer community at Devoxx ‘10 voted (87%) that the lawsuit was harmful in some way to Java – Repeated surveys get similar results • The message that this is scaring off the community & corporate customers is getting through to Oracle Mgmt – We’ve seen improvements 42
  • 43. Java FX • Well, v1.0 was a nice try – Did anyone really want JavaFX Script? • Java FX 2.0 is coming – Refocus around Java and other JVM languages – Does a Java client even matter anymore? – Can it shake off the FX Script legacy? • MSFT are downgrading Silverlight from their roadmap – ‘HTML5’ seems to be the way forward • Why have another runtime in a browser when it already has a capable VM (i.e. JavaScript)? 43
  • 44. JCP - Trouble in paradise? • OK, so it was never _really_ paradise • Stephen Colebourne’s blog captured some of the events – http://www.jroller.com/scolebourne/ • Prominent members left – Doug Lea, “Crazy” Bob Lee • Community members Werner Keil, LJC and SouJava have joined – Hopefully can work with Oracle et al on positive changes – Starting with JSR 348 – Now is a good time to make your voice heard! 44
  • 45. OpenJDK governance? • Was there a mature OSS gov. model for OpenJDK? • Surely something is better than nothing • New attempt being made by Mark Reinhold & the committee – Really positive that the team are trying to make progress – Open mailing list: .... Doug Lea is back – Still an awful lot to be ironed out - but possibilities – Burden’s still on Oracle to engage with the community – But the community need to step up as well 45
  • 46. The future’s bright. The future’s Java! • We have arguably the most capable VM on the planet • We have a wealth of new languages to complement and challenge Java (and Java 7 of course)! • We have oceans of open source software • We have a great community (you guys)!! • Opportunity to engage & utilise our “Interesting Times” • It’s a GREAT time to be working in the Java ecosystem 46
  • 47. Thanks for listening! (http://www.java7developer.com) • Martijn Verburg - @karianna • Slides at slideshare.com 47

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. How this talk is gonna work\n
  5. Java&amp;#x2019;s not dead - it&amp;#x2019;s just been resting!\n
  6. How di I get here? Where are my shoes?\n
  7. Along came Larry...\n
  8. Parting of ways and new Joiners\n
  9. OpenJDK - Plan B\n
  10. Project Coin\n
  11. Project Coin - highlights\n
  12. Strings in switch\n
  13. try-with-resources\n
  14. enhanced numeric literals\n
  15. diamond syntax\n
  16. NIO.2\n
  17. URLStream to file in Java 6\n
  18. URLStream to file in Java 7\n
  19. Future based Asynch I/O\n
  20. method handles\n
  21. URLStream to file in Java 6\n
  22. Example of using reflection to cancel\n
  23. Example of using a proxy to cancel\n
  24. Example of using a MethodHandle to cancel\n
  25. MethodHandles compared and contrasted\n
  26. invokedynamic\n
  27. A friend to dynamic languages\n
  28. Concurrency\n
  29. Concurrency matters again\n
  30. Fork/Join\n
  31. compute code\n
  32. merge code\n
  33. DEMO then New concurrency models\n
  34. What&amp;#x2019;s in my future?\n
  35. \n
  36. \n
  37. \n
  38. \n
  39. \n
  40. \n
  41. \n
  42. \n
  43. \n
  44. \n
  45. \n
  46. \n
  47. \n