Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for #34 and #39 #40

Merged
merged 7 commits into from Jan 31, 2015
Merged

Fixes for #34 and #39 #40

merged 7 commits into from Jan 31, 2015

Conversation

Vogel612
Copy link
Collaborator

Implemented a shutdown mechanism as Poison Pill
Made all threads shut down slowly and cleanly when calling shutdown

  • This includes making the Query Thread run as daemon thread to keep him out of the shutdown process
    Cleaned up Program by allowing the injection of ChatInterface (which has to be logged in already)
    Updated gitignore a little to accomodate javadoc zip-files

- Main now also uses spaces for padding
- Main is now responsible for wiring commands to the bot.
- Any bot extending AbstractBot can now be shut down by enqueuing a Poison-Pill to them
- Default Bot logger made static
- Made Program less brittle on startup for JavaDocAccessor
- Allowed Injecting ChatInterface to Program via Constructor
- Moved shutdown Command to CoreBotCommands
- Exposed querying thread ExecutorService from Program
- Program also holds the Poison-Pill
- Removed System.exit from shutdown command
- Exposed Bot instance from Program
#39

- Removed executor shutdowns in #finalize()
- Added protected #shutdown() method to AbstractBot that allows extending classes to clean up threads they introduce themselves
- Main is now responsible for firing up a Thread responsible for querying
- Removed executor from Program
- Added Logger to Main
- Removed superfluous shutdown call in createShutdownCommand()
- Extracted "safe" message querying to it's own method
- Made use of ChatInterface's AutoCloseable to handle resources
- Added clarifying javadoc to what assumptions are made about the chatInterface's state when it's passed to Program
@Vogel612
Copy link
Collaborator Author

This will have to wait until #35 and #36 are integrated into master
Additionally I have some more rather minor changes for a later pull-request in stash

@Vogel612
Copy link
Collaborator Author

After clearing this with Uni, I've decided to adapt this to the latest changes by Michael. Then a review will follow

Conflicts:
	src/main/java/com/gmail/inverseconduit/bot/Program.java
@Vogel612
Copy link
Collaborator Author

Vogel612 added a commit that referenced this pull request Jan 31, 2015
@Vogel612 Vogel612 merged commit 1a59ad3 into Unihedro:master Jan 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant