My problem is solved. I needed to make the Actor class Serializable.
> It depends on what the PartialFunction closes over. Impossible to
> answer or implement generically.
> On Sun, May 13, 2012 at 9:12 PM, Samira Tasharofi
> <samira.tashar...@gmail.com> wrote:
> > Hi all,
> > In Akka 1.3, I have a class named "CustomeActorRef" that extends
> > "ActorRef" and I use a factory to create an instance of
> > CustomeActorRef instead of ActorRef.
> > Inside CustomeActorRef, I override the method "invoke" to serialize
> > the actor behavior by the following code:
> > override def invoke(messageHandle: MessageInvocation): Unit = {
> > super.invoke(messageHandle)
> > if (this.hotswap.nonEmpty) {
> > var beh = this.hotswap.head
> > var stream = new java.io.ObjectOutputStream(new
> > java.io.FileOutputStream("behavior"))
> > stream.writeObject(beh)
> > }
> > }
> > But upon calling "writeObject" I am getting exception. Do you know how
> > I can serialize the actor behavior?
> > Thanks,
> > Samira
> > --
> > You received this message because you are subscribed to the Google Groups "Akka User List" group.
> > To post to this group, send email to akka-user@googlegroups.com.
> > To unsubscribe from this group, send email to akka-user+unsubscribe@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.
> --
> Jonas Bonér
> CTO
> Typesafe - The software stack for applications that scale
> Phone: +46 733 777 123
> Twitter: @jboner