Skip to main content

Posts

Showing posts with the label Java API

Easy Start with JNA

JNA (Java Native Access) is the good and easy answer to the JNI(Java Native Interface). Those who find it cumbersome to to call C, C++ DLL functions using JNI, then JNA is for you. The project is hosted at https://jna.dev.java.net/ . Here is my first encounter(experiment) with the JNA. Problem: I want to call one DLL function in Java program Solution: The first thing that comes into my mind is JNI, coz I heard a lot about it whenever something "native" has to be called in Java. Just while surfing for the more information on basic JNI programming, I came across the JNA project/api and find it interesting to give it try. Here are the basic two things you need to have in order to use JNA 1) JNA api JAR file (jna.jar): Download it from here 2) DLL which you want to call in your Java program Now this may be the big thing for a guy who haven't worked on VC++, DLL, MFC etc things. So here is the quick link about how to create the DLL http://www.icynorth.com/development/createdl...

Job storage in Quartz using Files, A FileJobStore Class

Quartz supports mainly two types of Job Storage for Scheduler information. • Memory (non persistent) storage The memory job storage facility for Quartz is provided by a class called org.quartz.simpl.RAMJobStore , The RAMJobStore is the default, i.e unless you change the configuration, and this is the JobStore that will be used for any Quartz application. Using this JobStore has some advantage 1. Easy to configure, because already configured by Scheduler as a default 2. It’s fast - a plain old simple memory access But, as a computer memory is volatile, when your Quartz application is stopped, it releases the memory back to the operating system. Of course, along with everything else stored in that released memory is the scheduling information. • Persistent storage Second is using database for Job storage which implements JobStoreSupport abstract class Quartz offers two different types of concrete persistent JobStores, each one designed for a specific database environment and co...