Created
June 20, 2014 20:09
-
-
Save christian-posta/c61d3c257e007272bf7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
146 /** | |
147 * Eventually add the security subject that has created this event. | |
148 */ | |
149 private void prepare(final Event event) | |
150 { | |
151 Subject subject = Subject.getSubject(AccessController.getContext()); | |
152 if (subject != null) | |
153 { | |
154 try | |
155 { | |
156 Field f = Event.class.getDeclaredField("properties"); | |
157 f.setAccessible(true); | |
158 Map props = (Map) f.get(event); | |
159 props.put("event.subject", subject); | |
160 } | |
161 catch (Throwable t) | |
162 { | |
163 // Ignore | |
164 } | |
165 } | |
166 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment