The part that confuses you creates an anonymous class, then instantiates and passes the newly created instance to the method as an argument. The block of code you are referring to is the body of an anonymous class that is derived from UntypedActorFactory
For example, if you have an interface:
interface SomeInterface { void someMethod(); }
You can create an anonymous class that implements your interface like this (similar syntax is suitable for extending named classes):
SomeInterface instance = new SomeInterface() { public void someMethod() {
source share