Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #6745

Re: Detecting if a class is already known

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Detecting if a class is already known
Date Tue, 2 Aug 2011 07:51:10 -0700 (PDT)
Organization http://groups.google.com
Lines 23
Message-ID <09ab50c8-adfc-4f90-b943-dc810b0225af@glegroupsg2000goo.googlegroups.com> (permalink)
References <c58b6bca-daa4-4942-b466-768344bf26b1@l7g2000vbz.googlegroups.com> <j0uril$3sm$1@dont-email.me>
Reply-To comp.lang.java.programmer@googlegroups.com
NNTP-Posting-Host 172.19.9.147
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1312296670 8193 127.0.0.1 (2 Aug 2011 14:51:10 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Tue, 2 Aug 2011 14:51:10 +0000 (UTC)
In-Reply-To <j0uril$3sm$1@dont-email.me>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=172.19.9.147; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6745

Show key headers only | View raw


markspace wrote:
> Ross wrote:
>> However, I don't want to load classes that already exist
> 
> This is already covered by the ClassLoader docs.  You can also search 

And by the default classloader behavior.

> for a tutorial how it all works, but basically you overload findClass 
> and don't touch the other methods and it all works out.  loadClass 
> automatically searches for existing classes first, then only calls 
> findClass if it needs too.  IIRC.
> 
> 
>>    private boolean known( String className )
> 
> 
> <http://download.oracle.com/javase/7/docs/api/java/lang/ClassLoader.html#findLoadedClass%28java.lang.String%29>

I'm not even sure he needs to do anything new to the classloader.  The default classloader action is to not load a class it already has.  So what new is needed?

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Detecting if a class is already known Ross <rossclement@gmail.com> - 2011-07-29 09:47 -0700
  Re: Detecting if a class is already known markspace <-@.> - 2011-07-29 10:44 -0700
    Re: Detecting if a class is already known Lew <lewbloch@gmail.com> - 2011-08-02 07:51 -0700
  Re: Detecting if a class is already known Arne Vajhøj <arne@vajhoej.dk> - 2011-08-05 22:21 -0400

csiph-web