• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating Java attribute in an running Application

 
Gagan Tiwari
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20739
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2271
3
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic