-
Notifications
You must be signed in to change notification settings - Fork 781
messaging addition #1195
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
messaging addition #1195
Conversation
private static final String MESSAGES_MAIN_PAGE_TAG = "main"; | ||
/* | ||
initial capacity - default 16 | ||
initial load factor - default 0.75f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if they are public constants, then take them from there (just in case JDK will change defaults ... )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Impossible, they're private
Message m = ((Message) obj); | ||
if (canAcceptMessage(m)) { | ||
m.apply(RuntimeEnvironment.getInstance()); | ||
LOGGER.log(Level.INFO, "Message received: {0}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not INFO, too high, please lower to debug/fine/finer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in the updated commit
LOGGER.log(Level.INFO, "Messages in the system: {0}", | ||
RuntimeEnvironment.getInstance().getMessagesInTheSystem()); | ||
} else { | ||
LOGGER.log(Level.INFO, "Message dropped: {0} - too many messages in the system", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.WARNING ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in the updated commit
m.apply(RuntimeEnvironment.getInstance()); | ||
LOGGER.log(Level.INFO, "Message received: {0}", | ||
m.getTags()); | ||
LOGGER.log(Level.INFO, "Messages in the system: {0}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FINE/FINER ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved in the updated commit
@@ -0,0 +1,317 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually use sh or ksh to be portable to other OSes ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to ksh
Some mention of the tool in top-level README would be nice. |
It would be nice if mouse over the exclamation mark displayed the message. |
@tulinkry can you resolve conflicts please ? |
Also, it would be nice if the pending messages were reflected in the project list on home page (plus maybe in project picker). |
Lastly, I'd remove the blue band altogether and replace it with colored background under the path with mouse over displaying all messages. I like that OpenGrok is still looking quite minimalistic; adding more elements would make it cluttered I think (as opposed to increasing density). |
Also, it would be good to test this change with persistent messages displayed via dtags.eftar. |
@tulinkry ping me , once you resolve conflicts |
I updated the screenshots in the initial PR comment. Javascript changes are tested in recent Firefox, recent Chrome and IE9.
|
Internal demo available here, with some messages with expiration +15 days. |
I added the
|
aed876b
to
b9db44e
Compare
bin for scripts/binaries probably makes more sense, feel free to change. |
c26663b
to
b7ddd6d
Compare
@tarzanek ready |
thank you sir, merging |
The configuration listener seems unemployed most of the time so I added a messaging feature which listens on the same socket.
As a first shot it is capable of two things:
The information are displayed:
Currently supported messages:
The messages can't enforce any kind of restrictions, they just display/delete some user content - they are useful to notify the clients that index/reindex or anything else is in progress and so some inconsistencies can occur.
All messages disappear with webapp deploy. They are current state of the runtime environment of the OpenGrok
Related to #1187. This is now possible with just implementing
Message
subclass with desired effect.It comes with a java main file to automatically send the message to the application and also with a shell wrapper to make it even more easier. The shell wrapper is located under
tools
.This shell wrapper only needs to find your
opengrok.jar
java file so it can run theMessages.java
main class in it. This is possible by settingOPENGROK_DISTRIBUTION_BASE
environment variable which points to the OpenGrok distribution directory (which containsdist/opengrok.jar
). Other options are available through set of switches.Usage from the command line is simple:
Here come some screenshots: