creating the Immutable class in Java with simple source code example
We have heard the word “Immutable class” lots of time in Java. The best example is class “String“. Immutable class is the class whose value cannot be changed throughout the life cycle. We cannot change the content of String class, everytime new reference is created when we change the content, that is the basic difference between String and StringBuffer Class.
In this article, i will explain the step by step process to create the custom Immutable class in Java.
Our class should not able to derived and for that we will declare our class as final. The values cannot be change and thats why we will declare all the variables as final and we will provide only the getter methods as we cannot write setters because of final variables.
So to summarize, following steps needs to be taken: Continue reading “How to create Immutable Class in Java”
Tutorial of the Quartz framework for Java. Schedule job without loosing the performance of the application
What is Quartz?
Quartz is a job scheduling system that can be integrated with, or used along side virtually any other software system. The term “job scheduler” seems to conjure different ideas for different people. As you read this tutorial, you should be able to get a firm idea of what we mean when we use this term, but in short, a job scheduler is a system that is responsible for executing (or notifying) other software components when a pre-determined (scheduled) time arrives.
Quartz is quite flexible, and contains multiple usage paradigms that can be used separately or together, in order to achieve your desired behavior, and enable you to write your code in the manner that seems most ‘natural’ to your project.
Quartz is very light-weight, and requires very little setup/configuration – it can actually be used ‘out-of-the-box’ if your needs are relatively basic.
Quartz is fault-tolerant, and can persist (‘remember’) your scheduled jobs between system restarts.
Although Quartz is extremely useful for simply running certain system processes on given schedules, the full potential of Quartz can be realized when you learn how to use it to drive the flow of your application’s business processes.
Why not just use java.util.Timer?
Since JDK 1.3, Java has “built-in” timer capabilities, through the java.util.Timer and java.util.TimerTask classes – why would someone use Quartz rather than these standard features?
There are many reasons! Here are a few:
Timers have no persistence mechanism.
Timers have inflexible scheduling (only able to set start-time & repeat interval, nothing based on dates, time of day, etc.)
Timers don’t utilize a thread-pool (one thread per timer)
Timers have no real management schemes – you’d have to write your own mechanism for being able to remember, organize and retrieve your tasks by name, etc.
Step By Step Hibernate (ORM Tool) Tutorial Using eclipse WTP
Hibernate is the ORM tool widely used in java community to persist the java object using Object Relational Mapping (ORM) concept. ORM reduces number of lines to interact with database with optimized query language which is Hibernate Query language (HQL).
In this example, we will create a simple login application using hibernate tool of eclipse. We will use eclipse WTP (Web Tools Platform), to install “Hibernate Tools”. Follow below steps :
In Eclipse IDE, menu bar, select “Help” >> “Install New Software …” put the Eclipse update site URL “http://download.jboss.org/jbosstools/updates/stable/helios”
How to resolve the error “Unable to move value into property” in Customer care and Billing (CC&B) / Oracle revenue management and billing System (ORMB) / Oracle Utilities
Hi Friends this is very small but useful post to resolve the error “Unable to move value into”. Following is the snap of exception i found during developement (While inserting the value into Business Object [BO] using Business Service [BS] ).
The root LoggedException was: Unable to move value: ‘123456’ into property: ‘PolicyNum’
Caused by: java.lang.NoSuchMethodException: Unknown property : PolicyNum for bean class ‘com.splwg.cm.domain.customerinfo.policy.CmFeePolicy_DTO’
Before starting this demo application, I am assuming that you already have done CC&B set up on your local and Eclipse is configured.
What I am going to do so that I can use Business Script, Data Area, UI Map and BPA Script?
In this tutorial, I will create one UI Map which will take the person name as input and display list of all the person names as per input.
Final output screen would look like: