Hi,
   SDO Itself doesn't have a way to handle this at the moment, but
Tuscany has a method in the SDOHelper interface

    public ObjectInputStream createObjectInputStream(InputStream
inputStream, HelperContext helperContext) throws IOException;

that allows you to associate a selected HelperContext with an input stream.


You'll find this interface in the lib project, in the
org.apache.tuscany.sdo.api package.

Regards, Kelvin.

On 30/11/2007, EG Koron <[EMAIL PROTECTED]> wrote:
> I could serialize SDO DataObject whose type meta-data stored in a NotDefault 
> context.
> But when I unserialize it from inputStream, a "type not find" exception will 
> raised because default Context is choosed
> So Is there any way that I could choice the context or target while reading 
> DataObject from inputStream ?
>
> HelperContext scope = SDOUtil.createHelperContext(); //a No Default Context
> scope.getXSDHelper().define(...) //define type from xsd in the scope
>
> DataObject origin = scope.getDataFactory().create(...) //create then 
> initialize a do
> do.set(...)
>
> ByteArrayOutputStream bos = new ByteArrayOutputStream(bos);
> ObjectOutputStream out = new ObjectOutputStream(bos);
> out.writeObject(do)
> out.close();
>
> ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
> /*
> following, a "cannot found type" Exception caused. As by default, it can only 
> read type from default Scope
> So could I choise the scope when I reading object from InputStream ???
> */
> DataObject do = (DataObject)new ObjectInputStream(bis).readObject();
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to