mardi 6 décembre 2016

Make a JADE (JAVA Agent DEvelopment) a singleton in the jade runtime envirnement

I am writing a producer/consumer program in java using the Jade platform, to make my implementation of the program relevant, I want to have only one producer instance running, Normally I would use the Singleton design patter.The problem is that the setup() function that runs when an agent is 'deployed' into a container calls the constructor of the Agent and since it's private (because of the singleton design pattern) it throws an exception :

jade.core.IMTPException: Illegal access exception in createAgent() - Caused by: Class jade.core.management.AgentManagementService$CommandTargetSink can not access a member of class producer.ProducerAgent with mo> jade.core.IMTPException: Illegal access exception in createAgent() - Caused by: Class jade.core.management.AgentManagementService$CommandTargetSink can not access a member of class producer.ProducerAgent with modifiers "private" difiers "private"

So my problem is how can make run a single instance of the producer Agent in the jade runtime. Thank you

Aucun commentaire:

Enregistrer un commentaire