6번째.. 마지막이다.
(오늘 jdk7 정식 릴리즈 되는날 완료했다. )

invokedynamic
fork/join
project coin
nio2
를 제외한 나머지 내용.


Jdk(java) 7 - 6 기타기능

Posted by 김용환 '김용환'
TAG Java, java7, jdk, jdk7

Jdk(java) 7 - 5. invoke-dynamic
.
Posted by 김용환 '김용환'




Jdk 7 4-forkjoin
.
Posted by 김용환 '김용환'

어제 정식으로 jdk7 이 릴리즈 되었다.

http://www.oracle.com/technetwork/java/javase/downloads/java-se-jdk-7-download-432154.html
Posted by 김용환 '김용환'
TAG java7



JSR292를 보다가 invokedynmaic jvm instruction에 대한 자세한 글을 보게 되었다. 굿..

The Java Virtual Machine (JVM) has been widely adopted in part
because of its classfile format, which is portable, compact, modular,
verifiable, and reasonably easy to work with. However, it was
designed for just one language—Java—and so when it is used to
express programs in other source languages, there are often “pain
points” which retard both development and execution. The most
salient pain points show up at a familiar place, the method call
site.
To generalize method calls on the JVM, the JSR 292 Expert
Group has designed a new invokedynamic instruction that provides
user-defined call site semantics. In the chosen design,
invokedynamic serves as a hinge-point between two coexisting
kinds of intermediate language: bytecode containing dynamic call
sites, and combinator graphs specifying call targets. A dynamic
compiler can traverse both representations simultaneously, producing
optimized machine code which is the seamless union of
both kinds of input. As a final twist, the user-defined linkage of a
call site may change, allowing the code to adapt as the application
evolves over time. The result is a system balancing the conciseness
of bytecode with the dynamic flexibility of function pointers.
Posted by 김용환 '김용환'
TAG java7

http://java.sun.com/developer/technicalArticles/DynTypeLang/index.html
http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html
http://homepages.inf.ed.ac.uk/kwxm/JVM/codeByFn.html
http://androidkr.blogspot.com/2010_07_01_archive.html
http://cr.openjdk.java.net/~jrose/pres/200906-Cookbook.pdf
http://www.wiki.jvmlangsummit.com/images/4/41/DaVinciMachineTalk.pdf
http://www.wiki.jvmlangsummit.com/images/9/93/2011_Forax.pdf
http://blog.headius.com/2007/01/invokedynamic-actually-useful.html
http://download.oracle.com/javase/7/docs/technotes/guides/vm/multiple-language-support.html
Posted by 김용환 '김용환'


OSCON 2011 에서 Joe Darcy가 발표한 2개를 공유한다.
 

JDK7 nutshell 

http://blogs.oracle.com/darcy/resource/OSCON/oscon2011_JDK7_nutshell.pdf

동영상 : https://www.youtube.com/watch?v=7nkB3hxH5po&feature=player_embedded

내용 : jdk 7 기본 소개, project coin에 시간을 많이 들임 (Netbeans 사용)




OpenJDK의 State 공유

http://blogs.oracle.com/darcy/resource/OSCON/oscon2011_OpenJDKState.pdf

내용 : JDK7으로 가는 여정, JCP의 state, jdk 7 기본 소개,jdk 8 방향

Posted by 김용환 '김용환'

java7 nio2를 소개.



Jdk 7 3-nio2
Posted by 김용환 '김용환'
TAG Java, java7, jdk7, NIO2
java7 RC 버그로 의심되는 코드가 있었다.


c:\test 라는 디렉토리를 계속 모니터링하고, 디렉토리안에서 특정 폴더나 파일이 변경되면 알려주는 간단한 코드이다.



import java.nio.channels.CompletionHandler;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
import static java.nio.file.StandardWatchEventKinds.*;
public class WatchServiceTest {
 public static void main(String[] args) throws Exception {
  Path dir = Paths.get("c:\\test\\");
  WatchService watcher = FileSystems.getDefault().newWatchService();
  WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE,
    ENTRY_MODIFY);
  for (;;) {
   key = watcher.take();
   for (WatchEvent<?> event : key.pollEvents()) {
    if (event.kind() == ENTRY_CREATE) {
     Path name = (Path) event.context();
     System.out.println("path : " + name.toAbsolutePath());
     System.out.format("%s created%n", name);
    } else if (event.kind() == ENTRY_DELETE) {
     Path name = (Path) event.context();
     System.out.println("path : " + name.toAbsolutePath());
     System.out.format("%s deleted%n", name);
    } else if (event.kind() == ENTRY_MODIFY) {
     Path name = (Path) event.context();
     System.out.println("path : " + name.toAbsolutePath());
     System.out.format("%s modified%n", name);
    }
   }
   key.reset();
  }
 }
}


c:\test\ 에서 폴더를 생성했는데.. 잉??
workspace 에서 폴더를 생성했다고 나온다..

WatchEvent 클래스의 context 메소드를 호출하면 Path 가 나오는데, 내부적으로 꼬였나 보다.


path : E:\jdk1.7\test\새 폴더
새 폴더 created
path : E:\jdk1.7\test\새 폴더 (2)
새 폴더 (2) created
path : E:\jdk1.7\test\새 폴더 (2)
새 폴더 (2) deleted
path : E:\jdk1.7\test\make
make created



관련해서 Oracle BugDatabase에 신고했다.


Posted by 김용환 '김용환'
TAG Bug, java7

문서 다운로드



공유 Jdk 7-2-project coin

Posted by 김용환 '김용환'