abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred <frederic.augu...@gmail.com>
Subject Re: Abdera and Singleton
Date Thu, 20 Sep 2007 08:42:05 GMT
ok thanks.

But, when I am using the same instance of Abdera, can I have some problem
with concurrent access ?

I do that, because create a new instace of Abdera is very long.

Frédéric

2007/9/19, James M Snell <jasnell@gmail.com>:
>
> We could probably add this, but for a variety of classloader related
> reasons, it's likely that it would not be a complete replacement for the
> new Abdera() approach.
>
> - James
>
> Fred wrote:
> > Hi,
> >
> > I am using Abdera, and I remark that created a new instance of Abdera
> can be
> > long.
> >
> > Can Abdera Class implement Singleton pattern ?
> >
> > You have to add this code in Abdera Class
> >     private static Abdera abdera;
> >
> >     public static Abdera getInstance() {
> >         if(abdera == null) {
> >             abdera = new Abdera();
> >         }
> >         return abdera;
> >     }
> > and replace all "new Abdera()" by Abdera.getInstance().
> >
> > What do you think of this solution ?
> >
> > Regards,
> > Frederic
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message