(You should have numbered you questions... I will assume you did.)
1) Should be contained in HTTPServletRequest.getRequestURL() or HTTPServletRequest.getRequestURI()
3) Obtain the "jboss:type=Server" MBean and invoke the shutdown() operation.
4) There are two very different questions here. Are you wanting to know how to use LDAP for authentication? Or do you want to know how to make calls into LDAP to find out which users are in a group?
Oops, typo - the MBean name is "jboss.system:type=Server"
Thank you for your response. I just got a copy of your book and I am looking forward to learn from it!!
Ok, yes I should have numbered them. Next time :)
I am going to comment on your numbered responses.
1) and 2) : What if the HTTPServletRequest isn't available? i.e I am in an MBean and need to get the current server session info that contains that information provided by HTTPServletRequest and Session. Is there an JBoss component (MBean) I can access to get that?
3) Thank you. Can you point me to an example on how to access an MBean such as jboss.system:type=Server?
4) I think the how to use LDAP for authentication is done with the Login-config.xml file. How about accessing the information and making calls to the LDAP to find out which users are in a group?
Thank you again for your help.
Peter, I assume this is what you mean by accessing the MBean?
Context ctx = new InitialContext();
MBeanServerConnection mconn = (MBeanServerConnection)ctx.lookup("jmx/invoker/RMIAdaptor");
ObjectName name = new ObjectName("jboss.system:type=Server");
Yes, and look at the methods on MBeanServerConnection for things you can do (get/set attributes, invoke methods).
Re #1 & #2: from an mbean? I have no idea. How to get the Principal depends on the technology (and your have to read the JSR for the tech to find out). However, I think that the Principal is stored in the thread-local storage (no I don't know offhand how to get it from there).
Re #4: There is no JBoss API for accessing LDAP. JBoss AS uses the JNDI API to do its JNDI work. I have also seen other LDAP APIs for Java (a google should turn them up)
Ok! This is good info. Looking into the Twiddle for accessing the MBeans. (Tip from your book).
I need to look into the LDAP lookup stuff.
Thanks for your help!