I can implement services in my application class without any problems. But for some reason I can not go into the actors themselves.
My actor:
class PollerCrow @Inject()(
@Named("pollService") pollService: PollService[List[ChannelSftp
, @Named("redisStatusService") redisStatusService: StatusService
, @Named("dynamoDBStatusService") dynamoDbStatusService: StatusService
) extends BaseCrow {
... impl and stuff ...
}
My companion object for actors:
object PollerCrow extends NamedActor {
override def name: String = this.getClass.getSimpleName
val filesToProcess = ConfigFactory.load().getString("poller.crow.files.to.process")
def props = Props[PollerCrow]
}
I get the following when I run it:
IllegalArgumentException: no matching constructor found on class watcher.crows.PollerCrow for arguments []
How can i fix this?
Edit:
I tied my actors:
class ActorModule extends AbstractModule with AkkaGuiceSupport {
override def configure() {
bindPollerActors()
}
private def PollActors() = {
bindActor[PollerCrow](PollerCrow.name)
}
}
Edit 2:
Additional class information:
abstract class BaseCrow extends Crow with Actor with ActorLogging
class PollerCrow @Inject()(
@Named(ServiceNames.PollService) pollService: PollService[List[ChannelSftp
, @Named(ServiceNames.RedisStatusService) redisStatusService: StatusService
, @Named(ServiceNames.DynamoDbStatusService) dynamoDbStatusService: StatusService
) extends BaseCrow {
override def receive: Receive = {
...
}
}
object PollerCrow extends NamedActor {
override def name: String = this.getClass.getSimpleName
def props = Props[PollerCrow]
}
trait NamedActor {
def name: String
final def uniqueGeneratedName: String = name + Random.nextInt(10000)
}
source
share