I want to implement Singleton in a Java class who call the onCall Method in Mule ,
There is my java code
public class MyClass implements Callable {
@Override
public LinkedList<File> onCall(MuleEventContext eventContext) throws Exception {
    String fileDirectory = eventContext.getMessage().getInvocationProperty("directory");
    String fileDestination = eventContext.getMessage().getInvocationProperty("destination");
    LinkedList<File> fileList = (LinkedList<File>) FileUtils.listFiles(new File(fileDirectory), null, false);
    for (int j = 0; j < fileList.size(); j++) {
        if (fileList.get(j).length() == 0) {
            eventContext.getMessage().setOutboundProperty("logger",
                    "The file was moved to " + fileDestination);
            FileUtils.moveFileToDirectory(fileList.get(j), new java.io.File(fileDestination), false);
        }
    }
    fileList = (LinkedList<File>) FileUtils.listFiles(new File(fileDirectory), null, false);
    return fileList;
}
}
