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

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


Posted by '김용환'
,
Posted by '김용환'
,
Posted by '김용환'
,
Posted by '김용환'
,



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 '김용환'
,
Posted by '김용환'
,


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

JDK7 nutshell 

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

동영상 : http://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를 소개.



Posted by '김용환'
,
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 '김용환'
,
Posted by '김용환'
,