Community
Participate
Working Groups
With bug 265435 we have now the foundation for EObjects at the server-side. Possible benefits: 1) Easier IStore implementation 2) Ability to call generated EOperations 3) Ability to use custom EDataType serialization 4) Ability to use existing EObject-based Tooling server-side
Rebasing all unresolved enhancement requests to 3.0
Rebasing all outstanding enhancements requests to version 4.0
Created attachment 179507 [details] Patch v1 This is a functional patch, but not well tested
Development happens in branch objects_on_server for these projects: org.eclipse.emf.cdo org.eclipse.emf.cdo.server org.eclipse.emf.cdo.tests
The patch contains a usage example in RepositoryTest.testWriteAccessHandlers_WithServerCDOView(): public void handleTransactionBeforeCommitting(ITransaction transaction, CommitContext commitContext, OMMonitor monitor) throws RuntimeException { CDOView view = CDOServerUtil.openView(commitContext, isConfig(LEGACY)); for (CDORevision revision : commitContext.getNewObjects()) { CDOObject object = view.getObject(revision.getID()); if (object instanceof Customer) { Customer customer = (Customer)object; String name = customer.getName(); if ("Admin".equals(name)) { throw new IllegalStateException("Adding a customer with name 'Admin' is not allowed"); } } } view.close(); } Note the differences compared to RepositoryTest.testWriteAccessHandlers()!
Server-side CDOViews can be opened with these factory methods: CDOServerUtil.openView(ISession, CDOBranchPoint, boolean, CDORevisionProvider) CDOServerUtil.openView(IView, boolean) CDOServerUtil.openView(IStoreAccessor.CommitContext, boolean)
Everybody who's interested in this new feature, please test it and let me know if it works for you ;-)
With the new org.eclipse.emf.cdo.spi.server.ObjectWriteAccessHandler it becomes even easier: @Override protected void handleTransactionBeforeCommitting(OMMonitor monitor) throws RuntimeException { for (EObject object : getNewObjects()) { if (object instanceof Customer) { Customer customer = (Customer)object; String name = customer.getName(); if ("Admin".equals(name)) { throw new IllegalStateException("Adding a customer with name 'Admin' is not allowed"); } } } }
Committed to HEAD
Available in R20110608-1407