Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Machine > Re: Overriding ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 728 of 843
Post > Topic >>

Re: Overriding (or something similar) Exceptions

by Tris Orendorff <triso@[EMAIL PROTECTED] > Nov 13, 2006 at 11:45 PM

"graham.parsons@[EMAIL PROTECTED]
" <graham.parsons@[EMAIL PROTECTED]
> burped up 
warm pablum in news:1163439189.887227.93360@[EMAIL PROTECTED]
> Hi guys,
> 
> We have a "legacy" Java application that has been developed by many
> developers - some handle exceptions nicely, others not so.
> 
> What I would like to do is create a log of all the exceptions and
> messages that are being thrown internally without changing the code.
> 
> I was thinking around the classloader - create my own Exception class
> which uses the standard one but before passing the call to the standard
> one, writes out to the log.
> 
> So mine is loaded by the JVM but all I do is extend the standard one
> and override a method - is this "cyclic dependancy possible"?

If I understand you, you can do this.  Exceptions and cl***** are very 
similar so you can say, "public class Mine extends IOException {}" and 
write a new constructor.  You still have to change the code to use your 
new exceptions.

So my second suggestion would be to add the logging code to the runtime 
library and whip up a special rt.jar file.

-- 
Sincerely,

Tris Orendorff
[Q: What kind of modem did Jimi Hendrix use?
 A: A purple Hayes.]
 




 3 Posts in Topic:
Overriding (or something similar) Exceptions
"graham.parsons@[EMA  2006-11-13 09:33:10 
Re: Overriding (or something similar) Exceptions
"Oliver Wong" &  2006-11-13 14:43:48 
Re: Overriding (or something similar) Exceptions
Tris Orendorff <triso@  2006-11-13 23:45:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:12:38 CST 2008.