@SuppressWarnings("unchecked") private ActorRef doCreateObject() throws Exception { Props props; if (actorClass != null) { props = Props.create(new SpringCreator(ctx, Class.forName(actorClass), args)); } else if (actorBeanName != null && actorBeanClass != null) { props = SpringProps.create(actorSystem, actorBeanName, (Class<? extends AbstractActor>) Class.forName(actorBeanClass)); } else if (actorBeanClass != null) { props = SpringProps.create(actorSystem, (Class<? extends AbstractActor>) Class.forName(actorBeanClass)); } else { props = SpringProps.create(actorSystem, actorBeanName); } if (props == null) { throw new BeanCreationException("Can not create ActorRef for given parameters, actorClass=" + actorClass + ", actorBeanClass=" + actorBeanClass + ", actorBeanName=" + actorBeanName); } if (routerConfig != null) { props = props.withRouter(routerConfig); } if (deploy != null) { props = props.withDeploy(deploy); } if (mailbox != null) { props = props.withMailbox(mailbox); } if (dispatcher != null) { props = props.withDispatcher(dispatcher); } return actorSystem.actorOf(props); }