Design help please

Hi all,

I am trying to create a design for print services, and I'm trying to see if EJB is a good option. If you know of any similar tutorials/case studies, I'd appreciate a reference. I couldn't deduce anything for this case in Sun's tutorials...

I would like a user to be able to print to a certain printer, specified by its name, i.e. "printer 1st floor", "printer 2nd floor", etc. The names are listed in some directory.

I would like for an administrator to be able to administer each printer (get job list, stop, start, get status, etc).

Each printer is connected to a single host, but there may be more than one host.

My main question:

Is "Printer" a good candidate to be an EJB? The problem I'm having with that, is the fact that I don't know how a SINGLE application server could manage several DISTINCT EJBs that have the SAME class (Printer class), but are still not Stateful, in the sense that a single printer serves several users and must maintain a queue for their jobs.

If you think of any other obstacles in using EJB for this application, please feel free to comment....

thanks.

[1156 byte] By [sagmana] at [2007-11-27 2:20:56]
# 1

Hi,

there are at least 2 different solutions for your design:

1. Use a MessageDrivenBean (Queue) and send the print request to that queue. One parameter could be the printername. Then process the request on the serverside as you like.

2. Create a Stateless Session Bean lets say e.g. PrintService and an EntityBean: Printer. For every PrintJob you specify the Printer and the document / information that should be printed.

Leonadaa at 2007-7-12 2:22:50 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...