Examples of EChangeSummary


Examples of org.eclipse.emf.ecore.sdo.EChangeSummary

            clone = clone((EDataGraph) graph.getDataGraph());
        } catch (IOException e) {
            throw new ECFException(e);
        }

        EChangeSummary changes = (EChangeSummary) clone.getChangeSummary();
        changes.applyAndReverse();

        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        try {
            changes.eResource().save(buf, null);
            if (SDOPlugin.isTracing(TRACE_TAG)) {
                SDOPlugin.getTraceLog().println("commit:");
                changes.eResource().save(SDOPlugin.getTraceLog(), null);
            }
        } catch (IOException e) {
            throw new ECFException(e);
        }
View Full Code Here

Examples of org.eclipse.emf.ecore.sdo.EChangeSummary

     *      byte[])
     */
    public void applyUpdate(ISharedDataGraph graph, Object data)
            throws ECFException {
        EDataGraph dataGraph = (EDataGraph) graph.getDataGraph();
        EChangeSummary changeSummary = (EChangeSummary) dataGraph
                .getChangeSummary();
        changeSummary.endLogging();
        // throw away any local changes
        changeSummary.apply();

        Resource res = changeSummary.eResource();
        res.unload();

        // apply changes from the event
        try {
            res.load(new ByteArrayInputStream((byte[]) data), null);
            if (SDOPlugin.isTracing(TRACE_TAG)) {
                SDOPlugin.getTraceLog().println("processUpdate:");
                res.save(SDOPlugin.getTraceLog(), null);
            }
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        changeSummary = (EChangeSummary) res.getContents().get(0);
        dataGraph.setEChangeSummary(changeSummary);
        // leave a change summary showing what has changed
        changeSummary.applyAndReverse();
        changeSummary.resumeLogging();
    }
View Full Code Here

Examples of org.eclipse.emf.ecore.sdo.EChangeSummary

     *
     * @see org.eclipse.ecf.sdo.IUpdateProvider#serializeDataGraph(commonj.sdo.DataGraph)
     */
    public Object serializeDataGraph(DataGraph dataGraph) throws IOException {
        EDataGraph clone = clone((EDataGraph) dataGraph);
        EChangeSummary changeSummary = clone.getEChangeSummary();
        if (changeSummary != null)
            changeSummary.apply();

        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        clone.getDataGraphResource().save(buf, null);
        return buf.toByteArray();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.