tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "EG Koron" <x...@tongtech.com>
Subject SDO : could I choice the scope(helpcontext) while unserialize dataobject from inputstream
Date Fri, 30 Nov 2007 06:42:21 GMT
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(); 

 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message