Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serializable problem

 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I am using a server side connection factory. For local connection I want to return a Data object. For remote connection I want to return a unigue RemoteData object. My problem is that the Data class does not implement Serializable, thus can not be returned?
Please advise?
Regards
Fred
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This means your RemoteData isn't truly remote. Does it extend UnicastRemoteObject; if not, is it exported using UnicastRemoteObject.exportObject()?
- Peter
 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
Thank you for always being prepared to help me!
I have a ConnectionFactoryImpl that extends UnicastRemoteObject and implements ConnectionFactory. ConnectionFactory is an interface that implements Remote and has one method getConnection(). For local connection I wanted to return a reference to Data. That's when I get an Serializable exception.
What I am starting to think is that I also need a client side connection factory. If it runs in local mode I could simply return Data, else for remote connection I would connect to the server to obtain a RemoteData object.
Am I on the right path?

Regards
Fred
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using a server side connection factory. For local connection I want to return a Data object.

You are not implying that your server side factory also returns a Data object for local connection, are you?
Eugene.
 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eugene,
That's why I am suggesting to have a client side factory too?
Regards
Fred
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

That's why I am suggesting to have a client side factory too?

Yes, you are on the right track. One possible solution is to have a client factory that will either return an instance of Data or a connection object using a server side connection factory.
Eugene.
 
Fred Barnes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eugene,
Thank you for the advise!
Regards
Fred
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic