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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:37:45+00:00 2026-06-15T12:37:45+00:00

I have created my own job class by extending the default class added couple

  • 0

I have created my own job class by extending the default class added couple of member variables and member methods. I saw the job gets triggered and is running for a very long time.

I just wanted to get the Job Instance not the JobDetail and wanted to invoke any member methods which has been defined by me or wanted to access the member variables.

Could you please let me know how we can achieve this?

Thanks,
Kathir

  • 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-15T12:37:47+00:00Added an answer on June 15, 2026 at 12:37 pm

    There is not such way, probably because quartz is meant to be compatible with a remote scheduling mode (i.e. cluster).

    But if you are using it in a single server / application context, you could probably implement your own JobFactory (http://quartz-scheduler.org/api/2.1.5/org/quartz/simpl/SimpleJobFactory.html) that will just delegate to the super class the creation of the instance, and then register the instance somehow in a map or something else. Then you’ll have to loop over the map keys to find the instance you are looking at.

    Be careful of memory leaks with such a solution


    Quick example:

    In your spring configuration file:

    <!-- quartz scheduler -->
    <bean id="orchestration-api-quartz-factory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="configLocation" value="classpath:spring/quartz.properties"/>
        <property name="jobFactory">
            <bean class="service.scheduler.SpringServiceJobFactory"/>
        </property>
    </bean>
    

    And the basic implementation of your Factory:

    /**
     * This job factory tries to locate the spring bean corresponding to the JobClass.
     *
     * @author Mathieu POUSSE
     */
    public class SpringServiceJobFactory extends SpringBeanJobFactory implements JobFactory {
    
        @Autowired
        private ApplicationContext context;
    
        /**
         * {@inheritDoc}
         */
        @Override
        protected Object createJobInstance(final TriggerFiredBundle bundle) 
                                           throws Exception {
            // create or get the bean instance
            Object bean = this.context.getBean(bundle.getJobDetail().getJobClass());
    
            // do what you want with the bean
            // but remeber what you did, otherwise if you forget to forget
            // you will have memory leaks !!!
    
            // myConcurrentMap.put("job.key", bean);
    
            return bean ;
        }
    
    }
    

    HIH

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

Sidebar

Related Questions

I have created my own Attached Property like this: public static class LabelExtension {
I have created my own button class called custom_btn. I created it on the
I have created my own customized lots of architecture including n-tier layers for different
I have created my own debugger application. It attaches to a process and creates
I have created blank Asp.Net-MVC 3 web application and want to write my own
I have created a custom list view, each row has it's own custom selector,
I have my own asp.net cookie created like this: var authTicket = new FormsAuthenticationTicket(
I have create my own NSOpenGLView class, right now the data that i want
I am trying to create my own Native win32 C++ Checkbox that can have
i have a big Joomla 1.5 Problem. I'll create my own Gallery Component/PlugIn and

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.