Help needed on returning serviceregistrar by hand
Alex Co <[email protected]> Thu, 25 Jun 2009 09:00:32 -0600
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Hi all,
Jini serialization is not the same as writeObject/readObject serializatio=
n, right?
Suppose I have a compiled class file called MyServiceRegistrarProxy that=20=
implements ServiceRegistrar, Serializable.
MyServiceRegistrarProxy x=3D new MyServiceRegistrarProxy();
Now I want to store the x object into a file but following the same seria=
lization=20
protocol that reggie follows when it returns its serviceregistrar to clie=
nts by=20
sockets.
I want that the file contents be compliant with the future use of:
ServiceRegistrar registrar =3D lookup.getRegistrar();
e.g on future i want to have a second thread or something reading the fil=
e and=20
sending file data to clients and clients building ServiceRegistrar object=
s from=20
my MyServiceRegistrarProxy type.
To serialize the object to file using standard serialization i do this:
String filename =3D "myserviceregistrar.svr";
FileOutputStream fos =3D null;
ObjectOutputStream out =3D null;
=09MyServiceRegistrarProxy p =3D new MyServiceRegistrarProxy();
try
{
fos =3D new FileOutputStream(filename);
out =3D new ObjectOutputStream(fos);
out.writeObject(p);
out.close();
}
catch(IOException ex)
{
ex.printStackTrace();
}
whichs classes can i use to serialize it to file in a Jini compliant way?=
An example would be very appreciated.
Thanks a lot
Alex
--------------------------------------------------------------------------
Getting Started: http://www.jini.org/wiki/Category:Getting_Started
Community Web Site: http://jini.org
jini-users Archive: http://archives.java.sun.com/archives/jini-users.html
Unsubscribing: email "signoff JINI-USERS" to [email protected]