package natalia.dymnikova.cluster;

import akka.actor.AbstractExtensionId;
import akka.actor.Actor;
import akka.actor.ExtendedActorSystem;
import akka.actor.Props;
import org.springframework.context.ApplicationContext;

public class SpringAkkaExtensionId extends AbstractExtensionId<SpringAkkaExtensionId.AkkaExtension> {

    public static SpringAkkaExtensionId instance = new SpringAkkaExtensionId();

    @Override
    public AkkaExtension createExtension(final ExtendedActorSystem system) {
        return new AkkaExtension();
    }

    public static class AkkaExtension implements akka.actor.Extension {
        public Props props(final Class<? extends ActorLogic> actorClass, final Object ...arguments) {
            return Props.create(SpringActorProducer.class, actorClass, arguments);
        }
    }
}
