• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing Server Runtime from Applet

 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to get access to the servers Runtime object from inside my applet. Is there an easy way to do this? I don't need access to anything on the client. Just the server.
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What "server" is that and what is that "Runtime" object you're talking about?
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The server that serves the Applet.

And I'm referring to the java.lang.Runtime object.
 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still don't understand. Your applet is served by an HTTP server. Which doesn't have to be written in Java at all.

Anyway even if that server is written in Java, there's no way for clients to access its internals. Terribly bad idea from the security point of view. Where did this strange idea come from?
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:I still don't understand. Your applet is served by an HTTP server. Which doesn't have to be written in Java at all.



Really? I didn't know that.

Anyway even if that server is written in Java, there's no way for clients to access its internals. Terribly bad idea from the security point of view. Where did this strange idea come from?



I have a legacy applet that I have to support. It's very convoluted and "enterprisey". When a user first logs into the applet, it pushes out a large chunk of data. Being hosted on Tomcat, the memory usage would shoot up. If too many users logged on at once, it would cause the JVM to crash with an out of memory exception. To prevent this from happening, a call to the Runtime object was added to check the available memory. If there wasn't enough left, it would deny the login. Once a minute or so had passed and the memory had cleared, the call would allow the log in.

Not the greatest solution, but it worked. Now, however, I'm having to redo the whole log in process(long story why), and I'm trying to incorporate this memory check into the new process. But I guess I could just do it in the log in servlet instead of the applet.

I think I just answered my own question.
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic