serialization with rmi

Hi!
1. If i try to move an object that is not serializable through the net, the only thing i get is exception about this?
2. If i want to move an object by value and not by remote reference, i have not to declare it as inplements Remote. Is it the only way to do so?
Thank you!
rzvika3Asked:
Who is Participating?
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.

jerchCommented:
An object that is passed as value in rmi should implements Serializable.  Hence, the attributes of the object also need to implement Serializable.

Hope this helps.

Jerson
0

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
rzvika3Author Commented:
and question 2?
0
jerchCommented:
Yes, if you want an object to passed as value simply do not implement the Remote interface instead implement the Serializable interface.  This is required by the RMI specification.  All return value and arguments must implement Serializable if its passed by value.

Always take note that transient and static fields are not passed by value instead it is reinitialize to its default value.

For example, you have an object with a static int fields that contains 5.  If you passed the object to the client or server.  The value it will receive is the default value or the initial value.  


0
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
Java

From novice to tech pro — start learning today.