Hi:

I'm developing a Grid Service in which some EPRs are Resource Properties. So, 
I'm trying to get persistence saving them in a file. Following the "Globus 
Toolkit 4: Programming Java Service", I develop both store() and load() 
functions in the Resource.java.

The store() is OK with the following Serialization:

                        FileOutputStream fos = null;
                        File tmpFile = null;
                
                        // Statements associated with the EPR RP
                        EndpointReferenceType[] EPRList = getEPR();
                        String[] endpointString;
                        String NS = 
"http://org.merrill/namespaces/examples/Service";;
                        QName RESOURCE_REFERENCE = new 
QName(NS,"ResourceReference");

                        // Temporal file .temp creation
                        tmpFile = File.createTempFile("file", ".temp", 
getPersistenceHelper().getStorageDirectory());
                        fos = new FileOutputStream(tmpFile);
                        
                        // RPs are written in the temporal file
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        //EPR needs to be serialized
                        endpointString = new String[EPRList.length];
                        for (int i = 0; i < EPRList.length; i++){
                                endpointString[i] = 
ObjectSerializer.toString(EPRList[i], RESOURCE_REFERENCE);                      
    
                        }
                        oos.writeObject((String[]) endpointString); //It is 
written as a String[]
                        oos.close();



But I don't know how to retrieve the EPRs in the load() function. I don't know 
how to use the ObjectSerializer or ObjectDeserialize to get back the EPRs 
because I don't find the reverse method. Can anybody help me?

thanks

Carlos
_________________________________________________________________
La Ășltima hora de tu ciudad en MSN Noticias
http://noticias.es.msn.com/

Reply via email to