Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:01:11+00:00 2026-06-13T08:01:11+00:00

I am trying to get my head around session – timeout – idle handling

  • 0

I am trying to get my head around session – timeout – idle handling Multi-treads in Java.

I have a server & client application comunicating via telnet where I need to check if the user has been typing (anything), clicking (anywhere), or moved the mouse within a periode of time.

If not, the user will be prompted with a dialog box, asking if he wants to conntinue session or not. …(and If not, the user will automatically be logged out within the next minute or so.)

My application has multiple threads. ( – One user per thread). So I am not sure how to approatch this the best (and easiest) way?

I know it is a wide and far-fetched question, but I was hoping some of you could give me a pointer or tip in the right direction… 🙂

I was kind of hoping for a simple method that could check:
(a bit pseudo code on the fly:)

if (idle = true){
timer.start();
if (timer > 120sec)
displayWaringJFrame("Continue Session?  - YES or NO ?)
displayTimer.start();
if (displayTimer > 30sec)
application.user.closeSession()

…or something like that! 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:01:12+00:00Added an answer on June 13, 2026 at 8:01 am

    The simplest solution is a class java.lang.Thread.

    You can create class and implements interface Runnable

    public class Session implements Runnable{
        public void run(){
            //your code
        }
    }
    

    in main function create class Thread and as constuctor argument set instance of Session class after this importatnt is call method .start()

    public static void main(String args[]){
        new Thread(new Session()).start();
    }
    

    Much more convenient way to work with threads is java.util.concurrent.ExecutorService and java.util.concurrent.Executors

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

trying to get my head around Feedzirra here. I have it all setup and
I'm trying to get my head around the covariance of Scala's collections. I have
I'm trying to get my head around the addressing of WCF services. We have
I'm trying to get my head around this one: Say you have two models
am trying to get my head around the following: Have a small program am
Im trying to get my head around MySQL. I have learnt a great deal
I'm trying to get my head around solving the following problem. I have the
I'm trying to get my head around error handling in Haskell. I've found the
I am just trying to get my head around SSL. I have set up
I'm trying to get my head around IoC w. dependency injection and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.