Java Development
-
Access Java Object from a script
In this example we shall show you how to access a Java Object from a script. We are using the…
Read More » -
Java EE 6 Decorators advanced usage
The example we’ll use is a Social media feed processor. So I have created an interface:  public interface SocialFeedProcessor…
Read More » -
Decorating classes at injection time with Java EE 6
Let’s say you have a ticket service that lets you order tickets for a certain event. The TicketService handles the…
Read More » -
Implement a shopping cart using the Strategy Pattern
First a definition: in the simplest terms, you can define the Strategy Pattern as telling an object to do a…
Read More » -
client server communication example
The Server.java import gnu.cajo.Cajo; // The cajo implementation of the Grail public class Server { public static class Test {…
Read More » -
Logging aspect example
Once upon time I was writing a plugin for a closed-source LMS J2EE application having such dependencies that it wasn’t…
Read More » -
JUnit Rules Example
The implementation of a Rule might look like this: import org.junit.rules.TestRule; import org.junit.runner.Description; import org.junit.runners.model.Statement; public class LoggingRule implements TestRule…
Read More » -
Create a simple BasicDataSource object
With this example we are going to demonstrate how to create a simple org.apache.commons.dbcp.BasicDataSource object, that is the basic implementation…
Read More » -
Delete File from FTP Server
This is an example of how to delete a File from an FTP Server. We are using the org.apache.commons.net.ftp.FTPClient Class that…
Read More » -
Get list of files from FTP Server
In this example we shall show you how to get a list of files from an FTP Server. We are using…
Read More »