2 Replies Latest reply on Apr 18, 2003 1:49 PM by marc.fleury

    not sure what pattern this would be.

    pucky

      So I've got a web app that needs to call a session bean depending on the message that comes in via a HTTP Post.

      i.e. a HashMap that contains "sayHi",Service

      if the webapp received request.getParameter("command)" = "sayHi" then it would take the service object and see which sessionBean to call and load. How do I do this? is it reflection? Introspection?

      Service.getJndiName
      Service.getServiceLocal
      Service.getServliceLocalHomt
      Service.getMethod
      ......

      what I'd like to do is be able to just add new services at will and if a command "sayBye" came in and there was a service available in the HashMap I'd call it otherwise an error would be returned.

      Hope someone can help.
      HashMap would be retrieved via a MBean therefore I could just tell the MBean to reload services.

      Thanks,
      p.s. Marc get working in that "Red Paper"! I can't wait to read it.
      Pucky

        • 1. Re: reclaiming managed connections
          marc.fleury

          Just upgraded to JBoss 2.4.8 from 2.4.4. Under 2.4.4, we knew we had problems with connection pooling but did not receive the nice error, "No Managed Connections Available", that 2.4.8 gives.

          We are using Oracle 9i with our jboss.jcml as follows:


          oracle.jdbc.driver.OracleDriver



          CisDS
          org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

          jdbc:oracle:thin:@localhost:1521:NISC1
          1200000
          cisnew
          30
          cis
          false
          false
          false
          true
          15000
          120000
          1800000
          false
          false
          1.0
          0



          Does anyone have a solution?

          Thanks,
          Brent

          • 2. Re: not sure what pattern this would be.
            marc.fleury

            > So I've got a web app that needs to call a session
            > bean depending on the message that comes in via a
            > HTTP Post.
            >
            > i.e. a HashMap that contains "sayHi",Service
            >
            > if the webapp received
            > request.getParameter("command)" = "sayHi" then it
            > would take the service object and see which
            > sessionBean to call and load. How do I do this? is
            > it reflection? Introspection?

            Right I did that at instill in california, basically it is called the "jfdi" pattern.

            So you come in and you want to start a sayHi session to talk to it. So the call that retrieves the session

            command = HTTPSession.getValue("command");
            if (session == null)
            then create it from EJB command = home.create();
            and keep it in memory HTTPSession.putValue("command", command);
            just delegate command.doStuff();


            here you are assuming a signature from the aspect that has no type, it is necessary to detype the signature so that you always know what to call. There can be an adaptor between ISO standard CRUD commands like the javabeans pattern, or you simply map it to whatever CRUD you do, like the collections API of the JDK. In AOP CRUD is instrumentable (domain of application are persistence and cache)