onepseudoxy
onepseudoxy

Reputation: 580

Java implemented algorithm for scheduling

I want to use an algorithm implemented in java if it exists, that allow me to schedule work in a company where employees can leave company to serve client, the customer request come to the company every day and the algorithms can take also old customer request.

Upvotes: 0

Views: 377

Answers (4)

Kim Burgaard
Kim Burgaard

Reputation: 3538

You tagged your question with java-ee, so here's an answer that leverages the technologies and APIs available in the Java Enterprise Edition platform:

  1. Configure queue in an JMS server. Depending on your setup, you can either use the JMS server provided with the application server, or use an external message server.
  2. Implement an enterprise application with a Timer bean and a stateless Session bean.
    • The Timer bean will be set to fire every day/hour/other appropriate interval. When it wakes up, it calls the stateless Session bean.
    • The stateless Session bean has a single business method which reads all messages off the JMS queue and performs actions according to each message.
  3. Deploy the two beans in an enterprise application on the application server.
  4. Provide information to customers about how to connect to the queue and the message format, or implement client applications that submit messages to the queue on behalf of customers.

If you connect to a JMS queue that supports transactions, then any failure while handling a message in the stateless Session bean will cause the message to be put back into the queue and re-send.

This design does not use an Message-Driven Bean to consume the messages from the queue because then you would have to worry about persisting the messages through other means until the timer service fires.

Upvotes: 0

qza
qza

Reputation: 639

If you really wanted algorithm, try JGap or Jaga

Solver ofers some shedule apps.

Upvotes: 0

Martin Klinke
Martin Klinke

Reputation: 7332

Drools Planner is a tool for optimized automated planning. Is this what you're after?

Upvotes: 1

It Grunt
It Grunt

Reputation: 3378

Quartz Job Scheduler should do you just fine. You can configure jobs using CRON expressions. This product is used by enterprises everywhere.

Quartz Scheduler Home Page

Is this algorithm you need for a school project or for work? Why re-invent the wheel when you don't have to?

Upvotes: 1

Related Questions