8 Replies Latest reply on Sep 11, 2003 12:12 AM by freemanhill

    Different clients ,same state content

    freemanhill

      Hi,all,
      In out project ,we have to let differen clients use the same state content.But we want to save the state in memory not in DB.So we DO not want to choose CMP.And JBoss clustering seems can not replicate Stateless session bean but only stateful session bean,unfortunately it seemed different clients can NOT call the same Stateful session bean.
      Is there anyone can help us?
      Thanks in advance.
      Hill

        • 1. Re: Different clients ,same state content
          darranl

          Have a look at the 'JBoss Clustering' documentation, if you do not already have a copy you can buy one by following the 'Buy JBoss doco' link to the right.

          There is a section that discusses the 'JBoss Clustering Framework', this covers distributed state which might be what you are looking for.

          • 2. Re: Different clients ,same state content
            freemanhill

            Of cource we had bought it.
            JBossClustering.pdf,Date 2003-04-02.
            Thanks in advance for timely reply.

            • 3. Re: Different clients ,same state content
              freemanhill

              Another question,
              If I do as the docu,our source codes can only for JBoss.Is there any other way to implement our target only using Stardard J2EE components?
              Thanks all

              • 4. Re: Different clients ,same state content
                slaboure

                Why do you need clustering for? Your question simply state that you have multiple client that request the same information and you want it to be cached, right? Do you have any specific clustering need or not?

                cheers,



                sacha

                • 5. Re: Different clients ,same state content
                  freemanhill

                  Thanks for reply.
                  Our project is a mobile application system.
                  But one handset client every time request with different http seesion. And we want to save state of all clients.
                  We had read the Clustering Docu,but there is no sample source codes for DS(Page 70 of 89).
                  How we can do?
                  Thanks again...

                  • 6. Re: Different clients ,same state content
                    slaboure

                    OK, but will you use a cluster or not?

                    If not, then you can simply use an MBean service that will remember your "handy" sessions.

                    If you will, then simply look at the DS API, it is really easy to use.

                    Cheers,


                    sacha

                    • 7. Re: Different clients ,same state content
                      freemanhill

                      Thanks in advance.

                      But we do not find some way to construct DS object.Here are Constructors of org.jboss.ha.framework.serverDistributedStateImpl.
                      public DistributedStateImpl () {} // for JMX checks

                      public DistributedStateImpl (HAPartition partition, MBeanServer server)
                      {
                      this.partition = partition;
                      this.mbeanServer = server;
                      this.log = Logger.getLogger (this.getClass ());
                      }
                      And in out servlet how can we construct it?

                      new DistributedState() or new DistributedState(HaPartition myPartition,MBeanServer myServer)

                      If choose the second,and how to construct HaPartition and MBeanServer?

                      When we try

                      myPartition = (HAPartition)jndiContext.lookup("/HAPartion/DefaultPartition");

                      server log comes out "HAPartion not bound"!

                      How should we do?

                      Thanks again,

                      Hill

                      • 8. Re: Different clients ,same state content
                        freemanhill

                        My mistake...
                        And as you say, it is really easy to use.

                        org.jboss.ha.framework.server.util.DistributedTimedCachePolicy explain it clearly.

                        Our grateful thanks are due to your reply.