package org.nohope.akka.spring;

import akka.actor.UntypedActor;

import javax.inject.Inject;
import javax.inject.Named;

/**
 * @author <a href="mailto:ketoth.xupack@gmail.com">ketoth xupack</a>
 * @since 9/16/12 11:12 PM
 */
public class Bean extends UntypedActor {
    private final Integer param1;
    private final String param2;
    private final String param3;

    @Inject
    public Bean(final Integer param1,
                @Named("param2") final String param2,
                @Named("param3") final String param3) {
        this.param1 = param1;
        this.param2 = param2;
        this.param3 = param3;
    }

    public Integer getParam1() {
        return param1;
    }

    public String getParam2() {
        return param2;
    }

    public String getParam3() {
        return param3;
    }

    @Override
    public void onReceive(final Object message) {
        if (message instanceof Props) {
            switch ((Props) message) {
                case PARAM1:
                    getSender().tell(param1);
                    break;
                case PARAM2:
                    getSender().tell(param2);
                    break;
                case PARAM3:
                    getSender().tell(param3);
                    break;
            }
        }
    }

    public static enum Props {
        PARAM1, PARAM2, PARAM3
    }
}

@@ -1021,19 +1021,30 @@
 l(param1
+, getSelf()
 );%0A
-
         
@@ -1134,16 +1134,27 @@
 l(param2
+, getSelf()
 );%0A     
@@ -1204,16 +1204,16 @@
 PARAM3:%0A
-
         
@@ -1247,16 +1247,27 @@
 l(param3
+, getSelf()
 );%0A     

fix for akka deprecated api