Is it possible to absorb / desearialize an anonymous class in Java?
Example:
ByteArrayOutputStream operationByteArrayStream = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(operationByteArrayStream); oos.writeObject(new Task() { public void execute() { System.out.println("Do some custom task")); } });
My problem is that I want to perform some custom administration tasks, so I donโt need a version for each task. So what I'm trying to do is, through Groovy, configure a custom script task using an HTTP endpoint and serialize them in db to run them on time.
user253202
source share