Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

Get a class instances

Thread view: 
Mohand - 31 Jan 2006 00:47 GMT
Hi
Can somebody help me?
I want to find all instances of a java class. The class is created and
several instances also are created. What I want to do is to retrieve all
these created instances.

Thanks all.

Mohand

---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 0605-1, 2006-01-30
Analyse le : 2006-01-30 19:47:45
avast! - copyright (c) 1988-2005 ALWIL Software.
http://www.avast.com
John C. Bollinger - 31 Jan 2006 03:27 GMT
> I want to find all instances of a java class. The class is created and
> several instances also are created. What I want to do is to retrieve all
> these created instances.

You cannot do what you ask unless you track instance creation.  One way
to do it is to use a factory object as the only means of creating
instances of the class you're talking about, and keeping a record in the
factory object of the instances created.  If you do this then you may
want to employ weak references so that your records of instances do not
prevent the instances from being garbage collected.  It starts to get
complicated if you want to do it right.

On the other hand, it is almost always a flawed design that requires the
kind of accounting you describe.  Why do you think you want to do what
you ask?

Signature

John Bollinger
jobollin@indiana.edu



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.