Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Beans > Re: reusable Se...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 1326 of 1403
Post > Topic >>

Re: reusable SessionBean

by efriedNoSpam@[EMAIL PROTECTED] (EricF) Oct 13, 2007 at 04:29 AM

In article <fencl2$3e1$1@[EMAIL PROTECTED]
>, fermat@[EMAIL PROTECTED]
>Hello,
>
>I am writing a Metadata-Server for a Storage virtualisation using JBoss
>4.2.1. There I have a cupple of physical disks used to build a virtual
>disk. There are EntityBeans for the the virtual disks and the physical
>disk. Next there exists a SessionBean to be called by the storage servers
>which decides which physical disk is to be used for a spcified area of
the
>virtual disk. The askes something like "On which physical Disk schall I
>store block 1234 of Virtual Disk 9876?", the Session Bean initializes a
>distribution algorithm over the physical disks of the virtual disks and
>sends back which physical disk is to be used.
>
>Now my problem: The initalisation of the distribution algorithm takes
much
>time (up to some minutes). The distribution could be reused for every
>request to a virtual disk if the instance could survive between calls. So
I
>want something like a hashtable where I can store for any virtual disk an
>initialised instance of the distribution algorithm. Is there any way to
do
>this in JBoss? Or do you have any other suggestion what I can do?
>
>tschau
>
>Sascha Effert

In the past, I had a static member of a SLSB and initialized it if null.
This 
may not be the best way now.

Someling like:

public class MyBean implements SessionBean {
        private static Hashtable data;

        private void init ejbCreate()  {
                if (data == null)
                        initdata();
        }
        ....               
}

What you mightwant to look at is storing your data using JNDI and populate
it 
at the server startup. You shoul be able to inject it into your bean if
using 
EJB3.

Eric
 




 3 Posts in Topic:
reusable SessionBean
Sascha Effert <fermat@  2007-10-12 11:08:48 
Re: reusable SessionBean
efriedNoSpam@[EMAIL PROTE  2007-10-13 04:29:03 
Re: reusable SessionBean
Sascha Effert <fermat@  2007-10-15 11:03:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Dec 4 0:04:31 CST 2008.