greptilian logo

IRC log for #javaee, 2014-02-01

Please see http://irclog.greptilian.com/javaee for which days have been logged.

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:01 whartung this reminds me of an old mac commercial
00:01 whartung 2 engineers, late in the day, thumbing through manuals
00:01 whartung a lady walk up
00:01 whartung "You two have been at this all week, what are you doing?"
00:01 whartung "Making it easier to use!"
00:02 whartung they're struggling to install Windows on a PC
00:07 whartung weld apparently has no logging...
00:11 whartung back to a PropertyChangeListener
00:15 sfisque i remember that commercial
00:16 whartung I might just use a JMS topic
00:16 sfisque going afk for a bit.  i have a general question that hopefully someone can chime in on.  is there an event or interceptor that i can use to capture the moment jaas return a valid principal/credential?
00:17 whartung return from where?
00:17 sfisque that will definitely work because mdb's are top level ejbs so you'll have the proper context for asynch processing
00:18 sfisque from the container.  as in the container intercepts the request, does the jaas "present the login screen", processes the form input, performs the redirect back to the original request.  i want to capture the fact that the auth happened because i have "things that happen" based on user stuff
00:18 whartung ah -- dunno if that lifecycle is really exposed
00:18 whartung or if JAAS is the way to even do it today
00:19 sajjadg Apache Shiro :-)
00:19 whartung JEE constainers implement a couple of other JSRs for authentication nowadays
00:22 sfisque jaas works fine.  no need to reinvent the wheel AFAIC.  i have it working but i have to repoll for the user if it's null rather than just setting it once and reacting appropriately
00:22 whartung I was never able to get JAAS to work with a web form.
00:22 whartung we use our own forms and programmatic login on GF
00:43 SoniEx2 which one is faster: `metadata[recipe[index - 1]]` or a `last` parameter?
00:43 whartung eh?
00:44 SoniEx2 uhh wait
00:44 SoniEx2 https://github.com/SoniEx2/NewEnderMoney/blob/1.7.2/common/com/github/soniex2/endermoney/core/item/EnderCoin.java#L46
00:45 SoniEx2 see that `metadata[recipe[index - 1]]`?
00:45 whartung yea
00:45 SoniEx2 would it be faster to replace it with a `last` parameter?
00:45 whartung I don't know what "last" is
00:46 SoniEx2 uhh wait
00:46 SoniEx2 basically I would add `, int last` to the method
00:46 SoniEx2 and that would be v
00:47 whartung well in this case, v changes as it's part of the loop
00:48 whartung you could pull the metadata[recipe[index - 1]] out of the loop and then use that directly, but odds are really quite high the compiler is doing this for you already, so I wouldn't worry about it
00:48 whartung whatever is slowing you down, this isn't it.
00:48 SoniEx2 uhh well
00:49 SoniEx2 metadata[recipe[index - 1]] would be like calling the method with the last v?
00:49 SoniEx2 https://github.com/SoniEx2/NewEnderMoney/blob/1.7.2/common/com/github/soniex2/endermoney/core/item/EnderCoin.java#L45
00:49 whartung no, these are arrays - no methods involved here at all
00:49 SoniEx2 https://github.com/SoniEx2/NewEnderMoney/blob/1.7.2/common/com/github/soniex2/endermoney/core/item/EnderCoin.java#L48
00:50 SoniEx2 it calls itself up to 9 times
00:51 whartung but a) since neither metadata or recipe are marked as volatile, this is effectively a constant expression, so the compiler (or JIT) is quite likely moving this out of the loop for you already, and thus only does the calculation once
00:51 whartung but in the end, these are simple array deferencecs
00:51 SoniEx2 still
00:52 whartung still what? these are cheap..cheap cheap…super cheap…sub nanosecond exections.
00:52 SoniEx2 when the method gets called in the loop, recipe[index - 1] from the new method call = old x
00:52 SoniEx2 and v = metadata[x]
00:52 whartung I can guarantee you that you have FAR FAR worse performance problems that need you attention than this expression.
00:52 SoniEx2 well yeah
00:52 SoniEx2 it's my doTrade method :P
00:53 whartung ok
00:53 SoniEx2 but I have to update it to 1.7 so...
00:53 whartung so nothing
00:54 whartung this isn't; relevant to that either
00:54 SoniEx2 you want me to change CoinRecipe?
00:54 whartung regarding this specific expression, I don't want you to change anything
00:54 whartung it's fine as it is
00:55 SoniEx2 uhh ok
00:55 SoniEx2 what am I doing wrong?
00:55 whartung what do you mean?
00:55 SoniEx2 well you said I have performance problems?
00:56 whartung no, YOU said you had performance problems
00:56 SoniEx2 no
00:56 SoniEx2 I'm just trying to know which one is faster
00:56 whartung "which is faster, x or y" implies "performance problems"
00:56 whartung the expression is derefecenceing two arrays, repeatedly in a loop
00:57 SoniEx2 I don't think the JIT is smart enough to replace metadata[recipe[index - 1]] with the v from the caller...
00:57 whartung naively, since this is a constant expression, it would be "better" to move that calculation out of the loop
00:57 whartung but the compiler/jit is "smart enough" to do that for you.
00:57 whartung and in any case
00:57 whartung until it shows up on the top of your profiler, it's not even worth spending a nanosecond of thought on in consideration.
00:58 SoniEx2 moving it out of the loop... well that wouldn't use the v so it would do index - 1, then index from recipe, then index from metadata
00:58 whartung metadata[recipe[index - 1]] doesn't use 'v' a tall
00:58 SoniEx2 I think that's slower than just adding the v to the param list
00:58 whartung at all
00:58 SoniEx2 well yeah that's what I said...
00:58 whartung metadata is constant, recipe is constant, index is constant
00:58 whartung -1 is constant
00:59 whartung for the duration of the loop
00:59 whartung so if you don't want to do the math repeatedly, move it out of the loop
00:59 SoniEx2 well yeah
00:59 SoniEx2 but it still requires a single calculation
00:59 SoniEx2 that I could avoid by adding the v
00:59 whartung q = metadata[recipe[index - 1]]; if ((index == 0 || v >= q) && v <= left) {
01:00 SoniEx2 I would name it `last`
01:00 SoniEx2 not q
01:00 whartung you don't want to make the CALLER calculate this, as it's not their concern.
01:01 SoniEx2 no it's already calculated by the caller
01:01 whartung this sentinel value is a problem for the registerRecipes function, the caller can care less
01:02 SoniEx2 also it's recursive up to 9 levels because it's kind of a loop...
01:02 SoniEx2 a loop within a loop within a loop or something
01:03 SoniEx2 + I ported the thing from Lua which doesn't exactly help...
01:09 kotten_ joined ##javaee
01:11 sfisque ooooh  jboss has an MBean exposed in jaas :-)
01:12 whartung nice
01:12 whartung not surprising, know jboss structure
01:12 whartung MBeans were their hammer
01:12 SoniEx2 sfisque: could you help me?
01:12 sfisque jboss has a very deep and effective jaas history
01:12 sfisque i've used their jaas since v4
01:12 whartung how do you get jaas to work with a web form?
01:13 sfisque web.xml - configure for form.  tie security to the container security context (jboss-web.xml attribute)
01:13 whartung so basically a jaas realm
01:13 sfisque container handles everything. all u do is configure the driver(s), supply a login form, done
01:13 sfisque yes
01:14 whartung ok
01:14 whartung we implemented a GF realm
01:14 whartung but still use our own forms
01:14 sfisque u always supply a form.  unless you use "basic"… bleh
01:14 sfisque the difference is, who handles the marshalling and interception
01:15 sfisque jaas == container does the heavy lifting
01:15 sfisque the nice part of jaas, the security is exposed to the ejb layer.  you can annotate methods to check for principal or roles and have them throw exceptions if the caller does not have the correct authorizations
01:15 whartung we have about 99 auth type sna what not that we support in our app.
01:15 whartung we can still do that with programmatic login
01:15 whartung all that applies
01:16 whartung just a matter of how to register the principal with the container
01:16 sfisque aye.  i just like leveraging the container whenever possible because why should i write code needlessly :P
01:16 SoniEx2 sfisque: help me?
01:17 sfisque i would but i'm tight on time.  buddies coming over in a bit for some table top gaming :-D
01:17 SoniEx2 ok
01:17 whartung what are you playing?
01:18 sfisque finishing up a pathfinder (meh) story arc, then next week we're switching to a classic traveller campaign (i'm running that) for a little change in scenery
01:18 * whartung old school traveller buff
01:19 whartung I have pretty much everything.
01:19 whartung I bought my boxed set in '79
01:19 whartung all of that stuff, all of the MT stuff, all of the TNE stuff.
01:20 whartung Azhanit High Lightning, Fifth Frontier War
01:20 whartung Batller Rider, Brilliant Lances…I have a full set of the original JTAS
01:20 sfisque i liked some of the MT rules changes, but i disliked the canon stuff.  this campaign is classic with some "sci-fantasy" thrown in
01:20 sfisque nice
01:20 sfisque i'm rebuilding my collection of classic stuff.  sold off a ton years ago, now regret it
01:21 sfisque still have my AHL deck plans though.  couldnt part with them
01:21 whartung obviously you can get all electronic
01:21 sfisque aye but it's not the same
01:21 whartung yea I somehow lost the actual Supplement 5 (I think) that came with the game
01:21 whartung but I have the maps and counters
01:22 whartung I have a acknowledgement in Fire Fusion and Steel :D
01:22 sfisque cool
01:22 whartung I'z famous
01:22 whartung send money in accolades
01:22 * sfisque tosses whartung an imperial credit
01:23 whartung *clink*
01:24 whartung I watch T5 with interest, but it looks like a continuing disaster, so I lost interest
01:25 whartung I haven't been to the traveller forums in months
01:25 sfisque from what i saw it's pretty much MT and TNE folded together with the classic canon
01:26 whartung so is JNDI stable @Startup?
01:26 sfisque yes JNDI is container wide
01:26 sfisque unless the app itself does bindings
01:26 sfisque which is rare unless you're implementing your own directory context
01:27 sfisque JNDI has to be stable.  it's how you lookup EJB's (annotations are just shorthand for looking them up)
01:28 sfisque bingo, all i have to do is build a skeletal loginModule and have ti fire last.  basically dummy up a loginModule as an event handler
01:29 sfisque i should join the jaas jcp,  that api could use some love
01:29 sfisque there really should be lifecycle handlers and other goodies
01:30 sfisque so for now i keep doing what i'm doing, but i now have a refactor target :-)
01:31 whartung dunno if jaas is the place for that
01:31 whartung \o/ mdb worked
01:31 sfisque why not?  i mean tehre is a life cycle (pre-auth, authent, authorize, de-auth (logout)
01:31 sfisque so there should be some event handling exposed to the apps
01:31 sfisque NICE
01:32 whartung but in the container they have those other security JSRs also
01:32 sfisque but how many of them are ready for primetime in EE7?  i mean jaas has been around F O R E V E R
01:33 whartung Dunno -- they're all already IN 6
01:33 sfisque for regular web pages (not rest or ws)
01:33 sfisque ?
01:34 sfisque educate me.  i'm open to newer tech if it's stable :-D
01:34 sfisque if its off the shelf in the container, even better
01:34 whartung I'm so bummed this CDI stuff didn't work
01:35 sfisque CDI has issues in EE6/7.  hopefully in EE8 they'll finish removing ManagedBean and the other cruft and work out the EJB/CDI linkage grey areas
01:36 whartung I'll have to hunt down the jars
01:36 whartung jsr
01:36 whartung it might have to do with standardizing programmatic security
01:37 sfisque looking at the EE7 jsr list.  none are about security
01:37 sfisque https://blogs.oracle.com/java/entry/java_ee_7_the_details
01:38 sfisque oh maybe in Servlet 3.1
01:38 sfisque jsr 340
01:39 whartung jsr 196
01:41 whartung I have to run off -- have a good weekend -- game strong.
01:44 sfisque o/
03:53 MasterProgram joined ##javaee
04:47 MasterProgram joined ##javaee
04:59 MasterProgram joined ##javaee
07:21 apric left ##javaee
07:37 Voyage joined ##javaee
09:13 Yegor joined ##javaee
09:16 ibaca joined ##javaee
09:17 Yegor Hi all. Someone can help me with EJB? I have two beans http://pastebin.com/nWZr7E6f. Why is my @PostConstruct method called twice?
09:45 kotten_ joined ##javaee
10:15 AlexCzar joined ##javaee
11:14 pdurbin joined ##javaee
14:20 firebird1 joined ##javaee
17:01 firebird1 joined ##javaee
18:47 AlexCzar joined ##javaee
20:41 sajjadg joined ##javaee
21:04 Voyage joined ##javaee
21:09 SoniEx2 joined ##javaee
21:16 MasterProgram joined ##javaee
21:21 NationalCoder joined ##javaee
21:49 Voyage joined ##javaee
21:58 vadian joined ##javaee
21:59 vadian left ##javaee
22:24 NationalCoder joined ##javaee
22:30 MasterProgram joined ##javaee
23:02 NationalCoder joined ##javaee
23:18 Voyage joined ##javaee
23:37 pdurbin https://www.openshift.com/blogs/how-to-host-your-java-ee-application-with-auto-scaling
23:44 Voyage Can I use spring on the top of a JavaEE application that has all features e.g EJBs, JPA, or viceversa as make JavaEE on top of spring ?

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

Please see http://irclog.greptilian.com/javaee for which days have been logged.