aspose file tools*
The moose likes Java in General and the fly likes Updating Java attribute in an running Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Updating Java attribute in an running Application" Watch "Updating Java attribute in an running Application" New topic
Author

Updating Java attribute in an running Application

Gagan Tiwari
Ranch Hand

Joined: Jun 10, 2008
Posts: 71
Hi All,

I have a running application. I need to change an attribute of a Java Source without bringing down the application.

Is there any way in Java to acheive this?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

You can't expect that changing the source code would affect the application from which it was compiled. And besides, source code doesn't have "attributes", does it?

So let's suppose you didn't mean that. You actually want to change the value of some variable in the code which is running. To which the answer is, sure, you can do that if you have designed the code in the right way.

For example the code might periodically read a file and change the value of that variable depending on what it finds there. Or it might run a server which waits for requests, and change the value of that variable depending on what is in the request. I'm sure there are plenty of other ways.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Paul Clapham wrote:For example the code might periodically read a file and change the value of that variable depending on what it finds there. Or it might run a server which waits for requests, and change the value of that variable depending on what is in the request. I'm sure there are plenty of other ways.


Agreed.

Gagan, what exactly do you mean by "I need to change an attribute of a Java Source without bringing down the application"? Something like, you need to change the type of an instance variable from String to Integer? Hopefully, you'll be able to solve your problem with the explanation Paul provided above.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Updating Java attribute in an running Application