Monday, August 5, 2013

Generic Queue & Consumer Implementation using Java

Here I have implemented a generic queue and consumer using Java.

Java Implementation Source Code

 //Create an ExecutionEngine and start.

boolean isAutoStart = false ;
boolean isAutoRestart = false ;

//Time Delay in Millisecond
int timeDelay = 100 ;
int queueLength - 100 ;

//ExecutorImpl is an implementation of the Executor to do the task when the executor do execute.

Executor executor = new ExecutorImpl();

ExecutionEngine executionEngine =  new ExecutionEngine<CustomBean>(executor,isAutoStart,        isAutoRestart,timeDelay,queueLength);


//Put an element to the queue
CustomBean customBean = new CustomBean();

No comments:

Post a Comment