I am a little bit confused by what you tried to do here. Why do you want
your remote object to be a singleton? Should the container manager remote
objects?
ServiceLocator( a J2ee Pattern ) which is responsible for locating the
bean's home or remote interface for the client should be singleton. But I do
not see the point to make remote object singleton. Am I missing something
here?
-----Original Message-----
From: Glyn Normington [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 9:17 AM
To: [EMAIL PROTECTED]
Subject: Re: A question about singleton
Kevin Mukhar wrote:
>The classic pattern for the Singleton class uses a read-only static field
to
>hold the Singleton reference, ...
I suppose the initial expression for the static field would be like this:
BeanX singleton = ((BeanXHome)javax.rmi.PortableRemoteObject.narrow(
new InitialContext().lookup(path), BeanXHome.class)).create(parms)
but where would this code would be placed. It's no good inside ejbCreate
as ejbCreate is already running on a new instance rather than the singleton.
So how could you implement the singleton portably?
>I would argue that the restriction against read/write statics applies
>to helper classes.
I agree. CICS treats enterprise beans and their helper classes the same
in this respect.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".