Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Flush Properties on Another Server  RSS feed

 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet that flushes the properties for the server on which it resides. Right now, I have to pass the jar'd servlet to each and every application server and modify the web.xml in order to use it. We have about 18 servers. I really don't want to do that if I can help it.

Is there a way that I can make the servlet process the flush (or anything else) on the server I select with just one servlet? I'm already grabbing the ContextPath, but it's just for displaying messages. I want to be able to tell it which application to actually process.

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "Flushes the properties of the server"?
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean that I flush the properties file with a PropertiesFactory.refreshProperties(). Sorry about that. I forget that not everyone speaks our lingo. I would like the refresh to work for the server of my choosing without having to have the servlet defined to that server. Is it possible or am I once again asking for something that is not yet ready for prime time? Thanks.
[ April 04, 2007: Message edited by: Pat Flickner ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand why you have a problem.

If you want to command a servlet to flush its properties file, just create an entry point - protected by some security of course - that carries out the command.

For example I can force reloading of question sets in my online tests from anywhere by a GET with the correct parameters. The response gives a convenient summary of the app status.

Bill
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not understanding. I don't have a "problem". I'm trying to figure out how to tell another server to flush its properties so that I don't have to have the code on that server. Are you saying I can do that? That I can tell another server to reset its properties to the new properties without having to be on the application attached to that server, that I don't have to have the code on that server? If so, do you have an example? Right now, I have to have the servlet on each server so that it can be used, and then I have to go to each application on each server to flush (reset) the properties if I make changes. I'm just looking for a way to have the code in one place on one server and then run the single bit of code to tell the other servers to grab the latest and greatest.

All the applications use the same set of properties files, but that shouldn't matter. This is the code:


[ April 05, 2007: Message edited by: Pat Flickner ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I can tell, there is nothing in the servlet API that has anything to do with Properties files. All servlet properties are defined through the deployment descriptor mechanism.

If there are Properties in your servlets they are part of the application API, or your specific servlet container API, not the servlet API. Therefore any solution to your problem will depend on your specific installation and will require specific code.

Bill
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to talk to another server. Okay, since you can't see the properties, let's try this: I want code that is on one application (and one server) to work for (execute the code for) another application on another server. Can it be done?

[Edited to remove not nice content]
[ April 06, 2007: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As William said, there is nothing in the servlet API that allows you to run
code on one machine from another in this matter.
[ April 06, 2007: Message edited by: Bear Bibeault ]
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for a direct response to a direct question.
[ April 06, 2007: Message edited by: Bear Bibeault ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you trying to run code that is already in each of the customer's apps (IE: a servlet that manipulates your properties) or are you trying to work directly with the properties objects from a remote server?

Also by server do you mean a different machine, a different instance of Tomcat (or whatever container you're using) on the same machine, or a different application running under the same instance of Tomcat?

The Servlet spec does leave some room for cross context access from within a single container so there might be some opportunities there.
[ April 06, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have edited this thread to remove the ickiness. Pat, please leave any ickiness out of your posts.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want code that is on one application (and one server) to work for (execute the code for) another application on another server. Can it be done?


Does the other application on the other server expose an API for this purpose?

Java is loaded with ways for applications to talk to each other but it takes specific code on each end.

Bill
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, thought this was dropped after I was told it couldn't be done. The servers are not remote -- they're just multiple application servers created under the WAS 5.1 and using Tomcat. I'm pretty sure that there's no specific API to talk to the apps, so I'd be very interested in hearing about this. I'm always looking for ways to streamline processes so that I don't have to do so much redundant coding.

Thanks a lot. I appreciate it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!