Applet licensing mechanism - CPU license

Hi All,

I've got a commercial java applet which I usually license on a per-domain basis. I have a licensing mechanism in place for covering this, where the applet is supplied with a license key at runtime.

However, I have a requirement to be able to license the applet on a per-server (CPU) basis. I have seen a number of commercial applets licensed in this way, and I am hoping I can get some advice here on how to implement such a mechanism.

The licensing is used as a deterent obviously - I am well aware that licensing mechanisms in applets are not bullet-proof, but some sort of licensing effort is better than nothing! :-)

Just incase it makes any difference or opens up any options, the applet is digitally signed.

Any ideas / advice?

Thank you in advance.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
richardocAuthor Commented:
Thanks for your suggestions!

Only problem is that, I need to restrict it to a particular server, not client. If I could get the IP address of the server that served up the applet, that might do the trick.
If the IP address is fixed, you could try

OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

Correction - that's nonsense (returns client address). Try


richardocAuthor Commented:
Yes, but surely that will return the ip address of the client machine that the applet is running on, and not the IP address of the server that served up the applet.
I'm trying to restrict the applet to a single server - not a single client.
>>Yes, but surely that will return the ip address of the client machine

(See my correction above)
richardocAuthor Commented:
getDocumentBase will just return the url of the page the applet was loaded from:
And getHost() will just return the domain part of the url.

I need to get the IP it was served from, because the the applet could get served from 1 of 100 domains running on the server; hence the need for a cpu license.
richardocAuthor Commented:
Its actually very straightforward to get the IP from a hostname:

InetAddress inet = InetAddress.getByName("");
System.out.println ("IP  : " + inet.getHostAddress());

Thanks anyway.

Yes, the hostname *is* the IP address ;-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.