One easy way is to extend UntypedActor, override whatever methods you need 
with final methods and provide your own callback methods for overriding by 
sub classes.
The slightly messy part of this is that you’ll be forced to provide 
callback method names with different names (e.g. onResolverReceive).

A nicer but slightly more complex solution is to use something like AspectJ 
with load time weaving and simply mark classes for which you need such 
defaults with an annotation, interface, or some coding convention.


On Monday, October 20, 2014 10:34:44 PM UTC+3, Chanan Braunstein wrote:
>
> Hello,
>
> Is it possible to define a base class for actors that will provide some 
> default behaviors? For example I create a MyAbstractActor that handles 
> MyMessage type. Someone on my team can then extend that class and handle 
> some other types as well. Somewhat like AbstractPersistentActor handles 
> Persistent messages, but in Java and hopefully without implementing all of 
> Actor which at a glance seems like AbstractPersistentActor is doing.
>
> Thanks,
> Chanan
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to