Package org.vrspace.server.core
Class BotManager
java.lang.Object
org.vrspace.server.core.BotManager
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
@Component
public class BotManager
extends Object
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
BotManger component starts right after server startup. For each Bot configured in BotConfig, sets properties, adds it to the
world, and starts self test. If it passes, Bot remains in the world as a an active object, otherwise it's marked inactive.
Provides a single threaded executor service for all hosted asynchronous bots.
- Author:
- joe
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnotifyListeners(Bot bot, VREvent event) Replacement for VRObject.notifyListeners() that Bots need to use for events they generate.voidonApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
BotManager
public BotManager()
-
-
Method Details
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
-
notifyListeners
Replacement for VRObject.notifyListeners() that Bots need to use for events they generate. Optionally asynchronous notification, if Bot.async is true. And since bots have no websocket session, also notifies session listeners, e.g. to log bot actions.- Parameters:
bot-event-
-