By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,737 Members | 1,971 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,737 IT Pros & Developers. It's quick & easy.

Is It Possible To Access Remote Classes?

P: n/a
I think I read something about this and I may just be using the wrong terms
in search engines.

I thought I read about a process where I could write Java classes that would
be stored on a server (I think they had to be signed), and would be
accessible to Java classes running on other computers. Is this possible?
Can someone give me more info (or at least a list of terms, since I seem to
be getting info on applets, which I can't use because they can't open a
file and upload it)?

I am working on a program that retrieves data from a POP3 address, allows
the user to edit settings, then sends the changed settings out through
SMTP. I would also like for the user to be able to select a file on
his/her computer and send it along with the settings. I finally found out
that applets can't read in the file on a user's system. Since that won't
work with applets, I was thinking I could write a class that would start
the program (and maybe the GUI) while it was downloading remote classes.
This would make it easy for me to update the program at any time by just
updating the classes stored on the online server.

Is this possible? Is there a better way to do this?

Thanks for any info or help.

Hal
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hal Vaughan <ha*@thresholddigital.com> wrote in message news:<hXmyb.258012$mZ5.1897311@attbi_s54>...
I think I read something about this and I may just be using the wrong terms
in search engines.

I thought I read about a process where I could write Java classes that would
be stored on a server (I think they had to be signed), and would be
accessible to Java classes running on other computers. Is this possible?

[snipped...]

There are two possibilities here. I think I can guess which one you need,
but I'll mention then both just to be on the safe side.

Java can indeed fetch and use classes dynamically at runtime. The data
can arrive from anywhere (filesystem, network, etc) so long as it forms
a valid class format. This process is controlled by a 'class loader'
class, which you can write yourself if you need bespoke class loading
functionality - although there are a number of useful class loaders
already available.

Take a look at the Javadocs for java.lang.ClassLoader for starters.

The other possibility, probably not what you wanted - but I'll mention
it anyway, is RMI (Remote Method Invocation). RMI enables a piece of
software to call methods on objects which physically live on an entirely
different computer (or at least in a separate memory address space!) In
a crude sense, it enables a 'single' piece of software to run across a
network of computers, as if they were one giant single computer. However,
to share their objects computers need some form of RMI service running.
-FISH- ><>
Jul 17 '05 #2

P: n/a
FISH wrote:
Hal Vaughan <ha*@thresholddigital.com> wrote in message
news:<hXmyb.258012$mZ5.1897311@attbi_s54>... <snip> There are two possibilities here. I think I can guess which one you need,
but I'll mention then both just to be on the safe side.
I'm glad you mentioned both. The first is what I was looking for, but after
reading your comments on the 2nd, that may be something that would work
even better for me. I could have one or two simple "startup" classes to
get the program running and to make a JFrame on the user's computer and the
rest running on the web site server. (There'll be less than 40 people
using this all together, so I'm not worried about the load on the server.)
Java can indeed fetch and use classes dynamically at runtime. The data
can arrive from anywhere (filesystem, network, etc) so long as it forms
a valid class format. This process is controlled by a 'class loader'
class, which you can write yourself if you need bespoke class loading
functionality - although there are a number of useful class loaders
already available.

Take a look at the Javadocs for java.lang.ClassLoader for starters.
Thanks -- I had never heard of ClassLoader, so that's a good start for me.
It didn't come up in any of my searches.
The other possibility, probably not what you wanted - but I'll mention
it anyway, is RMI (Remote Method Invocation). RMI enables a piece of
software to call methods on objects which physically live on an entirely
different computer (or at least in a separate memory address space!) In
a crude sense, it enables a 'single' piece of software to run across a
network of computers, as if they were one giant single computer. However,
to share their objects computers need some form of RMI service running.
-FISH- ><>


Thanks!

Hal
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.