Business Protocol over HTTP any patterns ?


General J2EE: Business Protocol over HTTP any patterns ?

  1. Business Protocol over HTTP any patterns ? (1 messages)

    Hello all,

              I have a business protocol to implement, something like a non java client will send messages over http and the server side will respond to messages.

    Assum the protocol requires total 5 steps.
    one all steps server might response, accepted, rejected or need_more_information kind of status.

    I am planning to implement the client handlers through HTTPServlet.

    With Http and servlet my problem is, I will have to hold the state of protocol_object till step 5 is not finished.

    Here are set of problems I am trying to solve

    client might talk to any servlet,
    from my protocol header, I will identify the client and get the cached object to work again with client.

    how will i decide that client is not responding and I shall move the object for gc.

    any idea's patterns anything.

    btw, cant go for statful cause app need to work purly on webserver.

  2. Not entirely sure you should go down this route :(

    Anyway, if you absolutely *must* do this, then use the Session object to record each different client's session.

    The Session object also has a timeout (default set to 30 minutes?) after which the session will be marked for garbage collection.