Skip to main content

Posts

Showing posts from November, 2010

Learning CDI (Contexts and Dependency Injection) Part 1

Please see the second part  here Contexts and Dependency Injection (CDI )  JSR 299  is a new feature in Java EE 6 Web Profile .  Its Enhance the JSR 330 Dependency Injection in Java. CDI are highly used annotation. CDI makes Loose coupling between classes. To use javax.inject.Inject annotation, we can inject any class into another classes     In traditional way, we create the instance using ' new ' operator in another class. here thats instance life time is dependent on target class. its tightly coupled. Here CDI makes to loosely coupled and change the life-cycle for that instance.

Necessary Classes need run the Simple Java Application

     When we run Java program, then first load the JVM ie. its load the necessary startup classes are needed by all the programs.  its load 300 classes for load JVM. Its make the initial delay for our program when we run first time. so latest jdk kit (1.6 update 14 or later) provide system tray tool. its load whenever system starts (Startup apps) its load the these nessary classes into cache . so when run the java program it run faster. suppose i create simple "Hello World" program when i run the HelloWorld.java file through -verbose command line option then we see what are the classes loaded Output Its showing more than 300 classes are loaded.

SSL on Tomcat

update : i posted new video for enable ssl in tomcat. please watch this video in 720p How to generate the keys or convert from one format to another format http://www.tomcatexpert.com/knowledge-base/using-openssl-configure-ssl-certificates-tomcat http://www.agentbob.info/agentbob/79-AB.html

Splash Screen in Java Application

Traditionally we are using splash screen with progress bar through JFrame or JWindow in Java swing application. But this approach, big disadvantage is splash screen is loaded after jvm is ready and necessary classes are loaded. In Java 6 provides convient way to show the splash screen even before jvm is get ready. It can integrate into JAR file also. When double click the jar the splash screen show right now. when  jvm start loading. after loading jvm we can procees the splash screen ie. we draw into splah screen, show progress bar , etc.. Java supports splash screen in gif,  png , and jpeg  format. We need to set command line parameter -splash as follows When we make jar bundle that time we need to add Splash Screen entry into manifest.mf file in jar Tip: This Feature only works latest Java 6 Version Its retrieve the Splash Screen image mentions in command...