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

  • SEARCH
  • Home
  • 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 8963895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:27:38+00:00 2026-06-15T16:27:38+00:00

I have a widely distributed java swing application that is a web service client

  • 0

I have a widely distributed java swing application that is a web service client from a JAX WebService EJB on a Glassfish 3.1.2 server.

I want to be able to distribute a String notification to all users that stays active until they have read it. The notifications only need to exist within the Swing client.

I have created a superuser web portal to enter the String data and save it to a database.

My question is:

  1. What is the best technology to (push)distribute this data String Notification to my clients?
  2. How should I arcitect the database to know if the notification has been viewed? (So I can stop showing the “New Notification” on the client)

Or if there is a reference to a guide that would work wonderfully, I couldn’t find one.

My Ideas:

  • Have the client call a webservice every 10 minutes to check if there are any new notifications
  • For the database create a notification table and notifications seen. Link my users table to notifications seen table. Notifications seen is very basic with just 3 columns: NotificationID, UserID, TimeSeen.
  • 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-15T16:27:39+00:00Added an answer on June 15, 2026 at 4:27 pm

    One way of simulating push notifications is long polling. This
    technique is called Comet or Reverse AJAX. While it’s more common
    in REST based services, it can be just as easily accomplished in
    JAX-WS.

    For JAX-WS you will want to investigate:

    • asynchronous web service invocation
    • JAX-WS client APIs … Using the JAX-WS asynchronous programming model

    Have the client call a webservice every 10 minutes to check if there are any new notifications

    Instead with long polling, you make the initial client connection
    right away. But instead of the server responding immediately, it hangs
    onto the connection (asynchronously). Then when a notification needs
    to be pushed, it responds back on the existing connection.

    With this technique, as soon as information is available on the
    server, it will be “pushed” to the client.

    For the database create a notification table and notifications seen. Link my users table to notifications seen table. Notifications seen is very basic with just 3 columns: NotificationID, UserID, TimeSeen.

    Sounds good. Expose it as a JAX-WS service. When the client receives
    the message, have them invoke it with the NotificationID.

    Something like:

    NotificationService svc = ...;
    UserId userId = ...;
    
    AsyncHandler<Notification> handler = new AsyncHandler<Notification>()
    {
        public void handleResponse (Response<Notification> response)
        {
           Notification notification = response.get();
    
           // update swing gui
    
           NotificationID notificationId = notifcation.getId();
    
           svc.markNotificationAsSeen(userId, notificationId);
    
           // continue polling forever (or put in some logic to stop)
           svc.getNotificationAsync(userId, this);
        }
    };
    
    Future<?> invocation = svc.getNotificationAsync(userId, handler);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a web application providing a service using a simple REST interface (GET/POST
I have a largish application that runs fine and uses session variables widely We
I have a text like that: The C language is%y% widely used today in
I have noticed that when updating my web content files (in this case, a
I have an information retrieval application that creates bit arrays on the order of
I have this weird problem that's killing us. I have a widely used app
I have to build Java daemon process that once starts will always be working
We have a huge web application running on lasso, mainly because it first was
I have an idea for a web service, but am very new to web
I have simple query that loads data from two tables into GUI. I'm saving

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.