Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Serialization of IWorkspace/IProject object on Riena Server

Hi Prasanna,

I am not sure I am getting this...... Remote service requires a service, an interface for the service (is that the workspace ?) and a client calling it. If you use Riena Remote Service, you use "hessian" as the serialization, so not Java Serialization code is needed. What is the purpose of this serializer code that you are doing on the server (in what service).

Maybe you can explain why you use Java serialization and what is the service ?

christian

Am 06.05.2009 um 21:17 schrieb Prasanna Tummala:

Hi,

        I anyone help me to Serialize IProject object that is created on server and pass it to client and deserialize it.

On Server(At send end) i am doing this..
FileOutputStream underlyingStream = new FileOutputStream("myobject.ser");
        ObjectOutputStream serializer = new ObjectOutputStream(underlyingStream);
        IProject pr = _project.getIProject();
        serializer.writeObject(_project);
        serializer.flush();
        serializer.close();

On client (At receive end) iam doing this
 FileInputStream fis = new FileInputStream("myobject.ser");
                 ObjectInputStream ois = new ObjectInputStream(fis);
                // IProject myDeserializedPorjectObject = (IProject)ois.readObject();
                 Project myDeserializedServerObject = (Project) ois.readObject();
                
                 ois.close();
                 IProject prj = myDeserializedServerObject.getIProject();
                 String path = myDeserializedServerObject.getProjectPath();

here On Client path is returned properly but IProject object is null. What am i missing here, why is IProject object not  passed from server

Here is my Project.java
public class Project implements Serializable {

private  String _projectName;
    private static String _projectPath;
    private static IWorkspace workspace;
    private static IWorkspaceRoot wsRoot;
    
    private  IProject _project = null;

    static final long serialVersionUID = 1L;
    
    /*************************************************************
    ** Constructor.
    *************************************************************/
    public Project(String usrName, String hostName, String projectName) {

        _projectName = projectName;
      
        // Save off the full path for the project.
        workspace = ResourcesPlugin.getWorkspace();
        wsRoot = workspace.getRoot();
       
        IProjectDescription description = workspace.newProjectDescription(projectName);
        // use the dct2000test project nature
       
        _project = workspace.getRoot().getProject("test");
    
       
    }
}



Thanks,
Prasanna


MSN Battles We pitch one stalwart against the other and give you the power. Who will you vote for? Share photos while you chat with Windows Live Messenger. <ATT00001.c>


Back to the top