reusable SessionBean
3 Message(s) by 2 Author(s) originally posted in java beans
| From: Sascha Effert |
Date: Friday, October 12, 2007
|
Hello,
I am writing a Metadata-Server for a Storage
virtual isation using JBoss
4.2.1. There I have a cupple of
physical disk s 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 server s
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've any other suggestion what I can do?
tschau
Sascha Effert
| From: efriedNoSpam |
Date: Saturday, October 13, 2007
|
wrote in message:
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've 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
| From: Sascha Effert |
Date: Monday, October 15, 2007
|
wrote in message:
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
Hi,
its so easy... I thought it isn't possible to use static fields in EJBs. I
will try it.
thanks a lot
Sascha Effert
Next Message: Toplink EJB and cascade persistence
Blogs related to reusable SessionBean
Re: How to retrieve the LocalObject of a stateless SessionBean
Sorry about the prior answer about
java:. I do that because it's local and there's not point in putting it in the global jndi space since it wouldn't be
usable. I believe you should remove the
...
j2se faqs
The field values of a session bean plus the transitive closure of the objects reachable from the bean's fields. The transitive closure of a bean is defined in terms of the serialization protocol for the Java programming language, ...
ORM (Object-relational mapping)
Jakarta ObjectRelationalBridge: full support for SessionBeans and BMP EntityBeans, JNDI, JTA & JCA integration; Java Ultra-Lite Persistence (JULP): yes; JaxorFramework: Yes, designed to run within any J2EE container, or can run outside ...
Spring
While the core features of the Spring Framework are usable in any Java application there are many extensions and improvements for building web-based applications on top of the Java Enterprise platform. Spring has gained a lot of ...
J2EE and .NET: Presentation Tier Interoperability
Although not usable across all cases, the top-down approach is the most conventional and straightforward. Experience has shown that there are cases where we cannot extend this approach because what works for one web service stack may ...
Introduce SpringFramework(zz) - kingquake21的专栏- CSDNBlog
Of course we'll also need to implement the local home interface and provide a bean implementation class that implements SessionBean and the MyComponent business methods interface. With Spring EJB access, the only Java coding we'll need ...