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 1019263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:59:03+00:00 2026-05-16T10:59:03+00:00

Timers are created in EJB3 using the TimerService.createTimer() , and are then run via

  • 0

Timers are created in EJB3 using the TimerService.createTimer(), and are then run via whatever callback method that’s annotated by the @Timeout annotation, i.e:

@Resource
private TimerService timerService;

public void createHampster() {
    Hampster hampster = new Hampster("Fluffy III");
    timerService.createTimer(3000, 3000, hampster);
}

(…)

@Timeout
public void feedHampster(Timer timer) {
    Hampster hampster = (Hampster) timer.getInfo()
    //(...)
}

So, my question is, do these two blocks of code need to be within the same bean? Are timers inherit to the bean in which they were created, or are they global? My own testing suggests but former, and I haven’t found anything definite in the documentation.

  • 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-05-16T10:59:04+00:00Added an answer on May 16, 2026 at 10:59 am

    They are tied to the bean that creates them. EJB 3 specification sections 18.2 says:

    The bean class of an enterprise bean
    that uses the timer service must
    provide a timeout callback method.

    and

    When the time specified at timer
    creation elapses, the container
    invokes the timeout callback method of
    the bean.

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

Sidebar

Related Questions

I created an App which uses Timer class to callback a method at a
In EJB3 Timer Service, I can create the timer with the timerService.createTimer(...) function, but
Does a System.Timers.Timer elapse on a separate thread than the thread that created it?
I created a class that implements a System.Timers.Timer with an elapse event. private void
I have created windows service. I need to run that automatically after 2 minutes.
I created a simple System.Timers.Timer in my Init() method like so: Init() dataUpdateTimer =
I have created a Windows Forms application in .NET 2 using C# that runs
I'm using system.Timers.Timer to create a timer. public System.Timers.Timer timer = new System.Timers.Timer(200); private
I'm not sure what I'm doing wrong. I created a timer that updates a
I want to create a timer EJB3 when a stateless bean is created in

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.