EJB and permanent checking

Discussion in 'Java' started by Guybrush Treepwood, Jan 14, 2005.

  1. I want to implement a webbased bookmark management application. Users will
    be notified if one of their bookmarks has changed content. So the server
    program will need to check regularly the differences between cached sites
    and the site at the url. But how is this done? I'm a beginner with EJB and
    as far as I understand, the Enterprise Beans come into action whenever a
    client makes connection. How can I keep checking the bookmarks, no matter
    what the logins are.
     
    Guybrush Treepwood, Jan 14, 2005
    #1
    1. Advertising

  2. Guybrush Treepwood wrote:

    > I want to implement a webbased bookmark management application. Users will
    > be notified if one of their bookmarks has changed content. So the server
    > program will need to check regularly the differences between cached sites
    > and the site at the url. But how is this done?


    Download the content and compare to cached content, prehaps using some
    checksumming. The http protocol also specifies the If-Modified-Since header:

    14.25 If-Modified-Since

    The If-Modified-Since request-header field is used with a method to
    make it conditional: if the requested variant has not been modified
    since the time specified in this field, an entity will not be
    returned from the server; instead, a 304 (not modified) response will
    be returned without any message-body.

    If-Modified-Since = "If-Modified-Since" ":" HTTP-date

    An example of the field is:

    If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

    [...] <http://www.faqs.org/rfcs/rfc2616.html>

    Using this would obviously be better since there is no need to download
    content. I do not know how dynamic pages are handled, I suppose they may
    be considered modified at any time ...

    From what you write below I suppose your server will be EJB-based. But
    EJB's can't download using http themselves, so you must find some other
    way, perhaps write a spider that is started automatically at certain
    intervals, get a list of sites from an ejb to scan, and feed the result
    back to the ejb which takes care of all the accounting.

    > I'm a beginner with EJB and
    > as far as I understand, the Enterprise Beans come into action whenever a
    > client makes connection. How can I keep checking the bookmarks, no matter
    > what the logins are.


    Not really sure what you want here. Possibly, you can't check all the
    users bookmarks when the user logs into your application (too slow), so
    I suppose you're asking how to implement asynchronous bookmark checking.
    But: Also consider, If the list of links isn't too large (perhaps
    because its's broken into some hierarcy of categories), and the
    If-Modified-since http-function works satisfactory (no need to download
    content), it might be possible to implement on-the-fly checking of the
    links, and you would have saved yourself a lot of asynchronous
    programming, and the state of the link-collection is always fresh.

    If not; To have EJB's execute stuff at a certain time, possibly
    repetitive, maybe the TimedObject of EJb 2.1 can be of help. But your
    real problem is not scheduling, but the fact that you can't make http
    connections from within the EJB container (In most cases nobody stops
    you, but it's not standards compliant). You'd have to make some external
    daemon program updating the bookmark database instead, and have the
    EJB's check the same database. Also note, you don't *have* to use EJB's
    for this, unless the general architecture of your applications requires EJB.

    Last but not least, you have to define what "updated" means. For
    instance; if the bookmark is referring a page at some commercial site,
    has the page really changed if only an ad-banner has changed (and they
    change a lot ... :) ?
     
    Jon Martin Solaas, Jan 16, 2005
    #2
    1. Advertising

  3. Jon Martin Solaas, Jan 16, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    1
    Views:
    731
    John C. Bollinger
    Jul 15, 2003
  2. Mumbai Joe
    Replies:
    0
    Views:
    630
    Mumbai Joe
    Jul 29, 2003
  3. Jeremy Haile

    To EJB or not to EJB

    Jeremy Haile, Sep 3, 2003, in forum: Java
    Replies:
    5
    Views:
    557
    Christopher Blunck
    Sep 10, 2003
  4. gk
    Replies:
    2
    Views:
    981
  5. Raymond Schanks
    Replies:
    0
    Views:
    700
    Raymond Schanks
    Aug 3, 2010
Loading...

Share This Page