How do i get a list of httpsessions currently active in container

          what is the object that i can interact with to get a listing of active httpsessions
          within my application context (servlet container) at any given time? i know i
          can setup a listener, is this the only way? is there now direct api?
          thanks
          

I replied to this question in another email thread...
          "Vinod Mehra" <[email protected]> wrote in message
          news:<[email protected]>...
          > Here is a jsp to give you an idea. Unfortunately the session timeout
          > (max-inactive-interval) is not exposed in the runtime mbean. So you will
          > have to hardcode it for now. If you want it be exposed please ask support
          > for a patch.
          >
          > <%@ page import="weblogic.management.runtime.ServletSessionRuntimeMBean,
          > weblogic.management.MBeanHome,
          > weblogic.management.Admin,
          > java.util.Date,
          > java.util.Set,
          > java.util.Iterator,
          > weblogic.servlet.security.ServletAuthentication,
          > weblogic.management.runtime.WebAppComponentRuntimeMBean"
          %>
          > <pre>
          > <%!
          > private static final long TIME_OUT = 10; // seconds
          > %>
          > <%
          > // login as system user
          > // FIXME: don't hardcode username/passwords
          > ServletAuthentication.weak("system", "gumby1234", request, response);
          >
          > MBeanHome home = Admin.getInstance().getMBeanHome();
          > if (home != null) {
          > Set mbeanSet = home.getMBeansByType("ServletSessionRuntime");
          > Iterator mbeanIterator = null;
          > mbeanIterator = mbeanSet.iterator();
          > while (mbeanIterator.hasNext()) {
          > ServletSessionRuntimeMBean runtime =
          (ServletSessionRuntimeMBean)mbeanIterator.next();
          > WebAppComponentRuntimeMBean parent = (WebAppComponentRuntimeMBean)
          runtime.getParent();
          > out.print("ContextPath: " + parent.getContextRoot() +
          > " LastAccessedTime: " + new
          Date(runtime.getTimeLastAccessed()));
          > if (hasSessionExpired(runtime)) {
          > out.println(" <b>Invalidating expired session!!</b>");
          > runtime.invalidate();
          > } else {
          > out.println(" Session is still good");
          > }
          > }
          > }
          > %>
          > <%!
          > private boolean hasSessionExpired(ServletSessionRuntimeMBean runtime) {
          > return (runtime.getTimeLastAccessed() < (System.currentTimeMillis() -
          TIME_OUT * 1000));
          > }
          > %>
          >
          > hth,
          > Vinod.
          >
          "Randheer Gehlot" <[email protected]> wrote in message
          news:[email protected]...
          >
          > Vinod,
          > This class "ServletSessionRuntimeMBean" does'nt give you list of
          all
          > the active sessions in memory. Is there any class which holds list of all
          active
          > sessions in memory ?
          >
          > Thanks..
          > "Vinod Mehra" <[email protected]> wrote:
          > >If you have session monitoring turned on ...
          > >
          > >weblogic.xml:
          > >
          > > <container-descriptor>
          > > <session-monitoring-enabled>false</session-monitoring-enabled>
          > > </container-descriptor>
          > >
          > >... then you should be able to lookup the runtime mbeans
          > >(ServletSessionRuntimeMBean).
          > >
          > >This is what the admin console also uses.
          > >
          > >--Vinod.
          > >
          > >"ke" <[email protected]> wrote in message news:[email protected]...
          > >>
          > >> what is the object that i can interact with to get a listing of active
          > >httpsessions
          > >> within my application context (servlet container) at any given time?
          > > i
          > >know i
          > >> can setup a listener, is this the only way? is there now direct api?
          > >>
          > >> thanks
          > >
          > >
          >
          

Similar Messages

  • How can I get a list of DSNs currently registered?

    Hi everybody,
    Can anyone tell me how to obtain a list of the DSNs currently registered on my machine using Java?
    I want to populate a drop-down list for the user (an administrator) to select the requisite DSN to work with.
    I realise that this is probably platform-specific (Windows in my case), hence posting here under JNI.
    I have searched the forums here at great length for the solution, but only seem to find unhelpful replies along the lines of 'JDBC can't do that - you'll need to resort to JNI'. So could I politely ask that if you don't actually know how to do it (or can at least provide a pointer or two) then please do not reply telling me ways in which it can't be done.
    Many thanks for your help.
    Paul.

    Hi,
    Thanks for the pointers.
    I already know the Windows API (I'm converting a VB app into Java and need to pick up the DSNs created for the original VB app to use via JDBC).
    Regarding picking it up from the registry - I don't know how to do this via Java. I've been looking at Preferences, but it seems to me that you don't have complete access to the Registry via Preferences - am I right about that?
    Re the third-party library: I have seen it mentioned a few places, seached on Google, etc, and even followed a few hopefull-looking links but I always come up with nothing :(
    Ho-hum...any other suggestions please?
    Cheers,
    Paul.

  • How can I get that which one is currently activated window

    I created a frame. The user may be minimize that frame and he may use some other window like internet explorer or Notepad or something else. Then I want to know that which window is the currently activated window. Is it possible. Please help me.

    you can use Javascript functions/varibles.
    In any page you can insert a special form like this:
    <form name="myNameWindow">
    <input type="hidden" name="myName" value="Ivan_pag01">
    </form>
    and in the other reading that value.
    Obviusly you have to save a reference in a variable of the other window.
    This is possible only if:
    1) other page is in the same browser window but in an other frame
    2) you have generated the other page via an "window.open" function (or your page is generated from it via that function)
    -- Ivan

  • How can I get a list of apps which are supported on ipod touch model ma623zo?

    How can I get a list of apps which are supported on ipod touch model ma623zo?
    It's about 6 years old I think.
    I have put the latest IOS on there (currently 3.1.3 (7E18)).
    I download apps from the app store but they often fail to launch. I assume they're incompatible.
    Is there a way to check which apps will work and which won't before I buy them?
    Thanks!

    I have no idea how my reply could be "misleading". I stated the exact situation: there are millions of apps in the iTunes Store, and providing a comprehensive, accurate list of which apps support which version(s) of iOS would be highly impractical. You can perhaps help with your search by going to AppShopper:
    http://appshopper.com/search/?search=iOS+3
    That will give you at least some starting points, but AppShopper is neither comprehensive nor completely accurate. I've found a number of apps listed there over the time the site has existed that either are no longer offered or which have been updated beyond the iOS version indicated. But it might help.
    Regards.

  • How do i get a list of all the apps i have purchased this year

    how do i get a list of all the apps  have purchased this year and how much each app was

    Check your iTunes purchase history (click your email address in the upper right corner in the iTunes App Store-> log in -> click Purchase History).  This gives you a comprehensive list of apps you've purchased.
     Cheers, Tom

  • How can I get a list of database names from environment

    Hi,
    How can I get a list of database names from environment.
    I had found a method in JE API Docs named Environment.getDatabaseNames(), and i couldn't found the same method in Berkeley DB.
    I use java interface, is it supported?
    Thanks.

    Hello,
    I don't know if it would work for you, but have you checked the db_archive utility at:
    http://download.oracle.com/docs/cd/E17076_01/html/api_reference/C/db_archive.html
    Check the -s option.
    Thanks,
    Sandra

  • How do I get a list of current activations for my license?

    We have a company license which we use for multiple installs.  Over time, we have replaced and/or reimaged PCs and reinstalled and activated the software.  We just started getting a warning that license have been exceeded.  We were unaware it needed to be deactivated on decommissioned machines.  How do we get a list of activated machines and reconcile that with the machines which have had it removed or been reimaged and activated again?

    Hi,
    There is not tool available for external use to keep check of your activations.
    You have to manually keep track or you may contact customer service to check activation count on product.
    Regards,
    Ajlan Huda.

  • How do i get a list of all Roles defubed under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?

     

    Sorry for the typographical mistake.
    Please read the question as:"How do i get a list of all Roles defined under a particular OrganizationalUnit? How can i use LDAPConnection.search method for this?"

  • HT1420 how can I get a list of the computers that are currently authorized?

    I need to authorize my home computer after switching from PC to Mac. How can I get a list of which devices are currently authorized?

    There is no list.

  • Hi ,How can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm or poerwshell . i have struggled for a week.

    Hi ,how can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm
    or poerwshell . i have struggled for a week
    tchocr

    Hi,
    There is no such PowerShell command can achiev this. Maybe you can use a script to get the user name with folder redirection enabled. However, I am not familiar with writing script, and it would be better for you to ask in script forum below for professional
    assistance:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • How can I get a list of active users on an AS Java platform on a cluster?

    Hello Experts,
    I have an AS Java NetWeaver CE v7.1 EhP1 SP3 system and it's running in a cluster.  Do you know how I can get a list of all users that are currently logged in or whom have active sessions on each application server instance?
    Thanks,
    Sam

    > I don't know how to get classes used by VA for this tab.
    I wouldn't make any development investments based on classes for the VA anymore...
    Considering that not only Salvatore himself, but also the JControl might decide for itself that the system needs a hard shutdown and restart.. a possibly better solution would be to use a redirect. If the message server does does not respond or does not find any DIs or not the one which your previous session state was for, then redirect to a page with a meaningfulll message (and apology on it.
    Just a thought,
    Cheers,
    Julius

  • How can I get a list of purchased apps?

    Recently restored my iPhone from backup, and I need to download my apps.  How can I get a list of apps that I've downloaded/purchased?
    If I search for an app via the app store that I had previously installed, the Install icon turns into a Cloud with a down arrow symbol on it - there must be a way to get a list of all of these right?
    Anyone clever enough to solve this riddle?

    Open the App Store app, go to the Updates pane and tap Purchased.

  • How can I get a list of all workbooks

    Can anybody please tell me how can I get a list of all my workbooks that are on my Oracle Discoverer database without having to manually write them down? I am using Oracle Database 10g Enterprise Edition.

    Hi,
    To implement the EUL Management BA follow metalink NOTE:556932.1
    there are very simple steps you need to perform in order to use it

  • How can I get a list of all my annotations to send to someone else, listed by PAGE #, not order.

    How can I get a list of all my annotations to send to someone else, listed by PAGE #, not order??

    The comments list is sorted by page by default. If it's not for some reason, click the "Sort comments" button and select that option. It looks like this:

  • How can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm or poerwshell . i have struggled for a week.

    How can I get a list of all laptops or users with folder direction enabled or offline files enabled, be it sccm or poerwshell . i have struggled for a week.

    Hi,
    There is no such PowerShell command can achiev this. Maybe you can use a script to get the user name with folder redirection enabled. However, I am not familiar with writing script, and it would be better for you to ask in script forum below for professional
    assistance:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=ITCG&filter=alltypes&sort=lastpostdesc
    Best Regards,
    Mandy
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

Maybe you are looking for