Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] issingleton() behavior

a singleton aspect will look like below, so it will be singleton as
relative to the aspect class visibility rule. If you have 2 unrelated
CL in which the aspect is (in fact are), you will have 2 aspect
classes, and thus 2 singletons instances (of 2 different aspect
classes), just as in OO.

aspect SingletonAspect {

  private static SingletonAspect s_singleton;

  // implicit method
  public static SingletonAspect aspectOf() {
    if (s_singleton == null) {
       s_singleton = ... // instantiate the singleton instance of
SingletonAspect
    }
    return s_singleton;
   }

  ....
}

Alex

On Sun, 06 Mar 2005 16:08:57 +0200, Alexandru Popescu
<alexandru.popescu@xxxxxxxxx> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi!
> 
> I would like to find out how is issingleton() behaving in a multiple-classloader application (f.e. a
> j2ee application having both EJB and web parts, deployed in a AS):
> 
> 1/ is it singleton in the AS JVM?
> 2/ is it singleton on CL basis?
> 
> I would also appreciate if you can point me to the implementations sources in AJ.
> 
> tia,
> - --
> :alex |.::the_mindstorm::.|
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.0 (MingW32)
> 
> iD8DBQFCKw75TTDTje0R2dgRAq4BAJ9fGZIpVjYeIwUhWIozaHxNJ3Fv5QCfZIeb
> g3QdpHYCF07yZyHFLTZ5tko=
> =a7lw
> -----END PGP SIGNATURE-----
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top