already here class notification

Jun 22, 2006 at 8:17am

already here class notification

#26516
Jun 22, 2006 at 11:01am

On 22 Jun 2006, at 09:17, f.e wrote:

> how do i know a class is already loaded in order to avoid copyright
> & infos to be written dozen times ?

Don’t know offhand, but if you want to write a banner message just
once, there are various ways of doing it – easiest off the top of my
head is to have a static boolean in the MXJ class which you examine,
and set, in the constructor. (This assumes that object instantiation
is single-threaded.)

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com

#79432
Jun 22, 2006 at 7:40pm

Or maybe just have a static block at the top of your class that does
the post…
It will be called once when the class is loaded.
Topher

On Jun 22, 2006, at 04:01 AM, Nick Rothwell wrote:

>
> On 22 Jun 2006, at 09:17, f.e wrote:
>
>> how do i know a class is already loaded in order to avoid
>> copyright & infos to be written dozen times ?
>
> Don’t know offhand, but if you want to write a banner message just
> once, there are various ways of doing it – easiest off the top of
> my head is to have a static boolean in the MXJ class which you
> examine, and set, in the constructor. (This assumes that object
> instantiation is single-threaded.)
>
>
> nick rothwell — composition, systems, performance — http://
> http://www.cassiel.com
>
>
>

#79433
Jun 23, 2006 at 9:10am

On 22 Jun 2006, at 20:42, topher lafata wrote:

> Or maybe just have a static block at the top of your class that
> does the post…

That’s a cleaner solution, but I wasn’t sure whether it was safe to
do post() while a static block is being executed…

– N.

nick rothwell — composition, systems, performance — http://
http://www.cassiel.com

#79434
Jun 24, 2006 at 6:40am

#79435

You must be logged in to reply to this topic.