You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/01/22 08:36:26 UTC
svn commit: r1234456 [12/17] - in /incubator/isis/trunk/framework/runtimes:
dflt/bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/classsubstitutor/
dflt/bytecode/dflt/src/main/java/org/apache/isis/runtimes/dflt/bytecode/dflt/obje...
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerDefault.java Sun Jan 22 07:36:07 2012
@@ -59,8 +59,7 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
import org.apache.log4j.Logger;
-public class AdapterManagerDefault extends AdapterManagerAbstract implements AdapterFactoryAware,
- SpecificationLoaderAware, OidGeneratorAware, ServicesInjectorAware, DebuggableWithTitle {
+public class AdapterManagerDefault extends AdapterManagerAbstract implements AdapterFactoryAware, SpecificationLoaderAware, OidGeneratorAware, ServicesInjectorAware, DebuggableWithTitle {
private static final Logger LOG = Logger.getLogger(AdapterManagerDefault.class);
@@ -221,8 +220,7 @@ public class AdapterManagerDefault exten
}
@Override
- public ObjectAdapter adapterFor(final Object pojo, final ObjectAdapter ownerAdapter,
- final IdentifiedHolder identifiedHolder) {
+ public ObjectAdapter adapterFor(final Object pojo, final ObjectAdapter ownerAdapter, final IdentifiedHolder identifiedHolder) {
// attempt to locate adapter for the pojo
final ObjectAdapter adapter = getAdapterFor(pojo);
@@ -238,10 +236,12 @@ public class AdapterManagerDefault exten
return createStandaloneAdapter(pojo);
}
- // aggregated objects are either intrinsically aggregate (on their spec) or
+ // aggregated objects are either intrinsically aggregate (on their spec)
+ // or
// the reference to them are aggregated.
//
- // can only do this if have been given an ownerAdapter & identified arguments to act as context.
+ // can only do this if have been given an ownerAdapter & identified
+ // arguments to act as context.
if (ownerAdapter != null && identifiedHolder != null) {
if (specIsAggregated(noSpec) || referenceIsAggregated(identifiedHolder)) {
final ObjectAdapter newAdapter = createAggregatedAdapter(pojo, ownerAdapter, identifiedHolder);
@@ -317,15 +317,18 @@ public class AdapterManagerDefault exten
// //////////////////////////////////////////////////////////////////
/**
- * Removes the specified object from both the identity-adapter map, and the pojo-adapter map.
+ * Removes the specified object from both the identity-adapter map, and the
+ * pojo-adapter map.
*
* <p>
- * This indicates that the object is no longer in use, and therefore that no objects exists within the system.
+ * This indicates that the object is no longer in use, and therefore that no
+ * objects exists within the system.
*
* <p>
- * If an {@link ObjectAdapter adapter} is removed while its pojo still is referenced then a subsequent interaction
- * of that pojo will create a different {@link ObjectAdapter adapter}, in a {@link ResolveState#TRANSIENT transient}
- * state.
+ * If an {@link ObjectAdapter adapter} is removed while its pojo still is
+ * referenced then a subsequent interaction of that pojo will create a
+ * different {@link ObjectAdapter adapter}, in a
+ * {@link ResolveState#TRANSIENT transient} state.
*
* <p>
* TODO: should do a cascade remove of any aggregated objects.
@@ -349,9 +352,11 @@ public class AdapterManagerDefault exten
* {@inheritDoc}
*
* <p>
- * Note that there is no management of {@link Version}s here. That is because the {@link PersistenceSession} is
- * expected to manage this. (In practice this is done by the <tt>ObjectAdapterStore</tt> implementation delegated by
- * the <tt>PersistenceSessionObjectStore</tt>, and propogated back to client-side as required).
+ * Note that there is no management of {@link Version}s here. That is
+ * because the {@link PersistenceSession} is expected to manage this. (In
+ * practice this is done by the <tt>ObjectAdapterStore</tt> implementation
+ * delegated by the <tt>PersistenceSessionObjectStore</tt>, and propogated
+ * back to client-side as required).
*/
@Override
public void remapAsPersistent(final ObjectAdapter adapter) {
@@ -370,7 +375,8 @@ public class AdapterManagerDefault exten
final AggregatedOid aggregatedOid = new AggregatedOid(rootOid, otma.getName());
final ObjectAdapter collectionAdapter = getAdapterFor(aggregatedOid);
if (collectionAdapter != null) {
- // collection adapters are lazily created and so there may not be one.
+ // collection adapters are lazily created and so there may not
+ // be one.
aggregateAdapters.addCollectionAdapter(otma, collectionAdapter);
}
}
@@ -380,7 +386,8 @@ public class AdapterManagerDefault exten
private void remapAsPersistent(final AggregateAdapters aggregateAdapters) {
final ObjectAdapter rootAdapter = aggregateAdapters.getRootAdapter();
- // although the Oid reference doesn't change, the Oid internal values will change
+ // although the Oid reference doesn't change, the Oid internal values
+ // will change
final Oid oid = rootAdapter.getOid();
if (LOG.isDebugEnabled()) {
LOG.debug("remapAsPersistent: " + oid);
@@ -453,8 +460,7 @@ public class AdapterManagerDefault exten
}
public Object getCollectionPojo(final OneToManyAssociation association, final ObjectAdapter ownerAdapter) {
- final PropertyOrCollectionAccessorFacet accessor =
- association.getFacet(PropertyOrCollectionAccessorFacet.class);
+ final PropertyOrCollectionAccessorFacet accessor = association.getFacet(PropertyOrCollectionAccessorFacet.class);
return accessor.getProperty(ownerAdapter);
}
@@ -468,8 +474,7 @@ public class AdapterManagerDefault exten
@Override
public ObjectAdapter testCreateTransient(final Object pojo, final Oid oid) {
if (!oid.isTransient()) {
- throw new IllegalArgumentException(
- "Oid should be transient; use standard API to recreate adapters for persistent Oids");
+ throw new IllegalArgumentException("Oid should be transient; use standard API to recreate adapters for persistent Oids");
}
return map(createOrRecreateRootAdapter(pojo, oid));
}
@@ -479,7 +484,8 @@ public class AdapterManagerDefault exten
// ///////////////////////////////////////////////////////////////////////////
/**
- * Creates a new root {@link ObjectAdapter adapter} for the supplied domain object.
+ * Creates a new root {@link ObjectAdapter adapter} for the supplied domain
+ * object.
*
* @see #createOid(Object)
*/
@@ -489,29 +495,33 @@ public class AdapterManagerDefault exten
}
/**
- * The default implementation will always create a new transient {@link ObjectAdapter adapter}, using the
- * {@link OidGenerator}. However, the method has <tt>protected</tt> visibility so can be overridden if required. For
- * example, some object stores (eg Hibernate) may be able to infer from the pojo itself what the {@link Oid} and
- * persistence state of the object is.
+ * The default implementation will always create a new transient
+ * {@link ObjectAdapter adapter}, using the {@link OidGenerator}. However,
+ * the method has <tt>protected</tt> visibility so can be overridden if
+ * required. For example, some object stores (eg Hibernate) may be able to
+ * infer from the pojo itself what the {@link Oid} and persistence state of
+ * the object is.
*/
protected Oid createOid(final Object pojo) {
return getOidGenerator().createTransientOid(pojo);
}
/**
- * Creates an {@link ObjectAdapter adapter} with an {@link AggregatedOid} (so that its version and its persistence
- * are the same as its owning parent).
+ * Creates an {@link ObjectAdapter adapter} with an {@link AggregatedOid}
+ * (so that its version and its persistence are the same as its owning
+ * parent).
*
* <p>
- * Should only be called if the pojo is known not to be {@link #getAdapterFor(Object) mapped}.
+ * Should only be called if the pojo is known not to be
+ * {@link #getAdapterFor(Object) mapped}.
*
* <p>
- * Helper method, but <tt>protected</tt> so can be overridden if required. For example, some object stores
- * (specifically, the XML object store at time of writing) do not support aggregated Oids for anything other than
+ * Helper method, but <tt>protected</tt> so can be overridden if required.
+ * For example, some object stores (specifically, the XML object store at
+ * time of writing) do not support aggregated Oids for anything other than
* collections.
*/
- protected ObjectAdapter createAggregatedAdapter(final Object pojo, final ObjectAdapter ownerAdapter,
- final IdentifiedHolder identifiedHolder) {
+ protected ObjectAdapter createAggregatedAdapter(final Object pojo, final ObjectAdapter ownerAdapter, final IdentifiedHolder identifiedHolder) {
final Identifier identifier = identifiedHolder.getIdentifier();
ensureMapsConsistent(ownerAdapter);
@@ -526,11 +536,11 @@ public class AdapterManagerDefault exten
final ObjectAdapter aggregatedAdapter = createOrRecreateAdapter(pojo, aggregatedOid);
// we copy over the type onto the adapter itself
- // [not sure why this is really needed, surely we have enough info in the adapter
+ // [not sure why this is really needed, surely we have enough info in
+ // the adapter
// to look this up on the fly?]
final TypeOfFacet facet = identifiedHolder.getFacet(TypeOfFacet.class);
- aggregatedAdapter
- .setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(facet));
+ aggregatedAdapter.setElementSpecificationProvider(ElementSpecificationProviderFromTypeOfFacet.createFrom(facet));
// same locking as parent
aggregatedAdapter.setOptimisticLock(ownerAdapter.getVersion());
@@ -542,23 +552,28 @@ public class AdapterManagerDefault exten
* Creates a {@link ObjectAdapter adapter} with no {@link Oid}.
*
* <p>
- * Should only be called if the pojo is known not to be {@link #getAdapterFor(Object) mapped}, and for immutable
- * value types referenced.
+ * Should only be called if the pojo is known not to be
+ * {@link #getAdapterFor(Object) mapped}, and for immutable value types
+ * referenced.
*/
private ObjectAdapter createStandaloneAdapter(final Object pojo) {
return createOrRecreateAdapter(pojo, null);
}
/**
- * Helper method that creates but does not {@link #mapAndInjectServices(ObjectAdapter) add}) the root
- * {@link ObjectAdapter adapter} along with adapters for all collections, an {@link ObjectAdapter adapter}, and sets
- * its {@link ResolveState} based on the {@link Oid}.
+ * Helper method that creates but does not
+ * {@link #mapAndInjectServices(ObjectAdapter) add}) the root
+ * {@link ObjectAdapter adapter} along with adapters for all collections, an
+ * {@link ObjectAdapter adapter}, and sets its {@link ResolveState} based on
+ * the {@link Oid}.
*
* <p>
* The {@link ResolveState} state will be:
* <ul>
- * <li> {@link ResolveState#TRANSIENT} if the {@link Oid} is {@link Oid#isTransient() transient}.
- * <li> {@link ResolveState#GHOST} if the {@link Oid} is persistent (not {@link Oid#isTransient() transient}).
+ * <li> {@link ResolveState#TRANSIENT} if the {@link Oid} is
+ * {@link Oid#isTransient() transient}.
+ * <li> {@link ResolveState#GHOST} if the {@link Oid} is persistent (not
+ * {@link Oid#isTransient() transient}).
* <li> {@link ResolveState#VALUE} if no {@link Oid} was supplied.
* </ul>
*/
@@ -567,15 +582,15 @@ public class AdapterManagerDefault exten
final AggregateAdapters aggregateAdapters = new AggregateAdapters(rootAdapter);
- // failed experiment to try to ensure that all adapters are loaded for the root;
+ // failed experiment to try to ensure that all adapters are loaded for
+ // the root;
// left in in case we want to re-instate
// eagerlyCreateCollectionAdapters(rootAdapter, aggregateAdapters);
return aggregateAdapters;
}
@SuppressWarnings("unused")
- private void eagerlyCreateCollectionAdapters(final ObjectAdapter rootAdapter,
- final AggregateAdapters aggregateAdapters) {
+ private void eagerlyCreateCollectionAdapters(final ObjectAdapter rootAdapter, final AggregateAdapters aggregateAdapters) {
for (final OneToManyAssociation otma : rootAdapter.getSpecification().getCollections()) {
final Object referencedCollection = getCollectionPojo(otma, rootAdapter);
final ObjectAdapter collectionAdapter = createAggregatedAdapter(referencedCollection, rootAdapter, otma);
@@ -616,7 +631,8 @@ public class AdapterManagerDefault exten
if (LOG.isDebugEnabled()) {
// don't interact with the underlying object because may be a ghost
// and would trigger a resolve
- // don't call toString() on adapter because calls hashCode on underlying object,
+ // don't call toString() on adapter because calls hashCode on
+ // underlying object,
// may also trigger a resolve.
LOG.debug("adding identity for adapter with oid=" + adapter.getOid());
}
@@ -663,10 +679,13 @@ public class AdapterManagerDefault exten
* Fail early if any problems.
*/
private void ensureMapsConsistent(final ObjectAdapter adapter) {
- // it isn't possible to guaranteee that the Oid will have no previous, because
- // if running standalone or server-side then we don't know that we can clear the previous
+ // it isn't possible to guaranteee that the Oid will have no previous,
+ // because
+ // if running standalone or server-side then we don't know that we can
+ // clear the previous
//
- // ensureThat(adapter.getOid().hasPrevious(), is(false), "adapter's Oid has a previous value.");
+ // ensureThat(adapter.getOid().hasPrevious(), is(false),
+ // "adapter's Oid has a previous value.");
if (adapter.getResolveState().isValue()) {
return;
@@ -684,10 +703,13 @@ public class AdapterManagerDefault exten
private void ensureMapsConsistent(final Oid oid) {
ensureThatArg(oid, is(notNullValue()));
- // it isn't possible to guaranteee that the Oid will have no previous, because
- // if running standalone or server-side then we don't know that we can clear the previous
+ // it isn't possible to guaranteee that the Oid will have no previous,
+ // because
+ // if running standalone or server-side then we don't know that we can
+ // clear the previous
//
- // ensureThat(oid.hasPrevious(), is(false), "adapter's Oid has a previous value.");
+ // ensureThat(oid.hasPrevious(), is(false),
+ // "adapter's Oid has a previous value.");
final ObjectAdapter adapter = getOidAdapterMap().getAdapter(oid);
if (adapter == null) {
@@ -700,17 +722,13 @@ public class AdapterManagerDefault exten
private void ensurePojoAdapterMapConsistent(final ObjectAdapter adapter) {
final Object adapterPojo = adapter.getObject();
final ObjectAdapter adapterAccordingToPojoAdapterMap = getPojoAdapterMap().getAdapter(adapterPojo);
- ensureThatArg(adapter, is(adapterAccordingToPojoAdapterMap), "mismatch in PojoAdapterMap: adapter's Pojo: "
- + adapterPojo + ", \n" + "provided adapter: " + adapter + "; \n" + " but map's adapter was : "
- + adapterAccordingToPojoAdapterMap);
+ ensureThatArg(adapter, is(adapterAccordingToPojoAdapterMap), "mismatch in PojoAdapterMap: adapter's Pojo: " + adapterPojo + ", \n" + "provided adapter: " + adapter + "; \n" + " but map's adapter was : " + adapterAccordingToPojoAdapterMap);
}
private void ensureOidAdapterMapConsistent(final ObjectAdapter adapter) {
final Oid adapterOid = adapter.getOid();
final ObjectAdapter adapterAccordingToOidAdapterMap = getOidAdapterMap().getAdapter(adapterOid);
- ensureThatArg(adapter, is(adapterAccordingToOidAdapterMap), "mismatch in OidAdapter map: " + "adapter's Oid: "
- + adapterOid + ", " + "provided adapter: " + adapter + "; " + "map's adapter: "
- + adapterAccordingToOidAdapterMap);
+ ensureThatArg(adapter, is(adapterAccordingToOidAdapterMap), "mismatch in OidAdapter map: " + "adapter's Oid: " + adapterOid + ", " + "provided adapter: " + adapter + "; " + "map's adapter: " + adapterAccordingToOidAdapterMap);
}
// //////////////////////////////////////////////////////////////////
@@ -727,7 +745,8 @@ public class AdapterManagerDefault exten
// replacing this code, just commented out for now to act as a reference.
- // public ObjectAdapter adapterFor(final Object domainObject, final Oid oid, final Version version) {
+ // public ObjectAdapter adapterFor(final Object domainObject, final Oid oid,
+ // final Version version) {
// if (oid != null) {
// return adapterFor(domainObject, oid);
// }
@@ -747,25 +766,35 @@ public class AdapterManagerDefault exten
// replacing this code, just commented out for now to act as a reference.
// /**
- // * Creates a new adapter with a new transient OID, and then added to the identity map.
+ // * Creates a new adapter with a new transient OID, and then added to the
+ // identity map.
// *
// * <p>
- // * The {@link ObjectAdapter adapter's} {@link ObjectAdapter#getResolveState() resolve state}
- // * is set to either {@link ResolveState#TRANSIENT} or {@link ResolveState#STANDALONE}
+ // * The {@link ObjectAdapter adapter's} {@link
+ // ObjectAdapter#getResolveState() resolve state}
+ // * is set to either {@link ResolveState#TRANSIENT} or {@link
+ // ResolveState#STANDALONE}
// * as required.
// *
// * <p>
// * <b><i>REVIEW: think this is wrong; we should set to
- // * {@link ResolveState#STANDALONE} is the {@link ObjectAdapter adapter} has been created
- // * with no identity ({@link ObjectAdapter#getOid() is null}), not based on the {@link
+ // * {@link ResolveState#STANDALONE} is the {@link ObjectAdapter adapter}
+ // has been created
+ // * with no identity ({@link ObjectAdapter#getOid() is null}), not based on
+ // the {@link
// ObjectSpecification#isAggregated()}</i></b>
// */
- // private ObjectAdapter createAdapterForNewObjectAndMap(final Object domainObject) {
- // final Oid transientOid = getOidGenerator().createTransientOid(domainObject);
- // final ObjectAdapter adapter = getAdapterFactory().createAdapter(domainObject, transientOid);
+ // private ObjectAdapter createAdapterForNewObjectAndMap(final Object
+ // domainObject) {
+ // final Oid transientOid =
+ // getOidGenerator().createTransientOid(domainObject);
+ // final ObjectAdapter adapter =
+ // getAdapterFactory().createAdapter(domainObject, transientOid);
// if (LOG.isDebugEnabled()) {
- // // don't call toString() because may still be a ghost and any interaction could resolve
- // LOG.debug("creating adapter (transient) for adapter with oid=" + adapter.getOid());
+ // // don't call toString() because may still be a ghost and any interaction
+ // could resolve
+ // LOG.debug("creating adapter (transient) for adapter with oid=" +
+ // adapter.getOid());
// }
// identityMap.addAdapter(adapter);
//
@@ -781,16 +810,19 @@ public class AdapterManagerDefault exten
// replacing this code, just commented out for now to act as a reference.
- // private ObjectAdapter adapterFor(final Object domainObject, final Oid oid) {
+ // private ObjectAdapter adapterFor(final Object domainObject, final Oid
+ // oid) {
// ObjectAdapter adapter = getAdapterFor(oid);
// if (adapter != null) {
//
- // // TODO: REVIEW: was tripping the exception setting a Boolean on a @NotPersistable.
+ // // TODO: REVIEW: was tripping the exception setting a Boolean on a
+ // @NotPersistable.
// // is it safe for immutable values to use equals(.) instead?
//
// ObjectSpecification noSpec = adapter.getSpecification();
// ValueFacet valueFacet = noSpec.getFacet(ValueFacet.class);
- // ImmutableFacet immutableFacet = valueFacet != null? valueFacet.getFacet(ImmutableFacet.class): null;
+ // ImmutableFacet immutableFacet = valueFacet != null?
+ // valueFacet.getFacet(ImmutableFacet.class): null;
// if (immutableFacet != null) {
// if (!adapter.getObject().equals(domainObject)) {
// throw new
@@ -799,7 +831,9 @@ public class AdapterManagerDefault exten
// }
// } else {
// if (adapter.getObject() != domainObject) {
- // throw new AdapterException("Mapped adapter is for different domain object: " + domainObject + "; " +
+ // throw new
+ // AdapterException("Mapped adapter is for different domain object: " +
+ // domainObject + "; " +
// adapter);
// }
// }
@@ -809,7 +843,8 @@ public class AdapterManagerDefault exten
// adapter = getAdapterFor(domainObject);
// if (adapter != null) {
// if (!adapter.getOid().equals(oid)) {
- // throw new AdapterException("Mapped adapter has oid: " + oid + "; " + adapter);
+ // throw new AdapterException("Mapped adapter has oid: " + oid + "; " +
+ // adapter);
// }
// return adapter;
// }
@@ -817,10 +852,12 @@ public class AdapterManagerDefault exten
// }
// /**
- // * Should only be called if it is known that the domainObject and Oid do not
+ // * Should only be called if it is known that the domainObject and Oid do
+ // not
// * correspond to any existing {@link ObjectAdapter}.
// */
- // private ObjectAdapter createAdapterAndMap(final Object domainObject, final Oid oid) {
+ // private ObjectAdapter createAdapterAndMap(final Object domainObject,
+ // final Oid oid) {
// return map(createAdapter(domainObject, oid));
// }
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerExtended.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerExtended.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerExtended.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerExtended.java Sun Jan 22 07:36:07 2012
@@ -28,19 +28,21 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
/**
- * Extension of the {@link AdapterManager} as viewed by the {@link PersistenceSession}.
+ * Extension of the {@link AdapterManager} as viewed by the
+ * {@link PersistenceSession}.
*
* <p>
- * Extends the {@link AdapterManager} interface in various ways, providing additional support:
+ * Extends the {@link AdapterManager} interface in various ways, providing
+ * additional support:
* <ul>
- * <li>for the {@link PersistenceSession} itself (by extending the {@link AdapterManagerPersist} interface),
+ * <li>for the {@link PersistenceSession} itself (by extending the
+ * {@link AdapterManagerPersist} interface),
* <li>for tests (by extending {@link AdapterManagerTestSupport}) and,
- * <li>for slightly dodgy implementations (such as the <tt>MemoryObjectStore</tt> that manipulate the identity maps
- * directly (by extending {@link AdapterManagerBackdoor}).
+ * <li>for slightly dodgy implementations (such as the
+ * <tt>MemoryObjectStore</tt> that manipulate the identity maps directly (by
+ * extending {@link AdapterManagerBackdoor}).
* </ul>
*/
-public interface AdapterManagerExtended extends Iterable<ObjectAdapter>, Resettable, AdapterManager,
- AdapterManagerPersist, ObjectAdapterLookup, AdapterManagerProxy, AdapterManagerTestSupport, AdapterManagerBackdoor,
- DebuggableWithTitle, SessionScopedComponent {
+public interface AdapterManagerExtended extends Iterable<ObjectAdapter>, Resettable, AdapterManager, AdapterManagerPersist, ObjectAdapterLookup, AdapterManagerProxy, AdapterManagerTestSupport, AdapterManagerBackdoor, DebuggableWithTitle, SessionScopedComponent {
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerPersist.java Sun Jan 22 07:36:07 2012
@@ -32,36 +32,43 @@ import org.apache.isis.runtimes.dflt.run
public interface AdapterManagerPersist {
/**
- * Remaps the {@link ObjectAdapter adapter} and any associated aggregated (collection) adapters using a new value
- * for the {@link Oid} provided by the {@link OidGenerator}.
+ * Remaps the {@link ObjectAdapter adapter} and any associated aggregated
+ * (collection) adapters using a new value for the {@link Oid} provided by
+ * the {@link OidGenerator}.
*
* <p>
- * The {@link Oid} of the supplied {@link ObjectAdapter adapter} should be in such a state that it can be
- * {@link OidGenerator#convertTransientToPersistentOid(Oid) converted from transient to persistent}. Note that some
- * {@link Oid} implementations require an initial state call to do this (eg to read from a database identity or
- * sequence value).
+ * The {@link Oid} of the supplied {@link ObjectAdapter adapter} should be
+ * in such a state that it can be
+ * {@link OidGenerator#convertTransientToPersistentOid(Oid) converted from
+ * transient to persistent}. Note that some {@link Oid} implementations
+ * require an initial state call to do this (eg to read from a database
+ * identity or sequence value).
*
* <p>
- * The adapter is remapped in the {@link AdapterManager}, and the {@link Oid#getPrevious() previous} is set to its
- * transient value). Similarly for any aggregated adapters. This is needed for client/server so that the client can
- * remap a changed object.
+ * The adapter is remapped in the {@link AdapterManager}, and the
+ * {@link Oid#getPrevious() previous} is set to its transient value).
+ * Similarly for any aggregated adapters. This is needed for client/server
+ * so that the client can remap a changed object.
*
* @see AdapterManagerProxy#remapUpdated(Oid)
*/
void remapAsPersistent(ObjectAdapter adapter);
/**
- * Either returns an existing {@link ObjectAdapter adapter} (as per {@link #getAdapterFor(Object)} or
- * {@link #getAdapterFor(Oid)}), otherwise re-creates an adapter with the specified (persistent) {@link Oid}.
+ * Either returns an existing {@link ObjectAdapter adapter} (as per
+ * {@link #getAdapterFor(Object)} or {@link #getAdapterFor(Oid)}), otherwise
+ * re-creates an adapter with the specified (persistent) {@link Oid}.
*
* <p>
- * Typically called when the {@link Oid} is already known, that is, when resolving an already-persisted object. Is
- * also available for <tt>Memento</tt> support however, so {@link Oid} could also represent a
+ * Typically called when the {@link Oid} is already known, that is, when
+ * resolving an already-persisted object. Is also available for
+ * <tt>Memento</tt> support however, so {@link Oid} could also represent a
* {@link Oid#isTransient() transient} object.
*
* <p>
- * If the {@link ObjectAdapter adapter} is recreated, its {@link ResolveState} will be {@link ResolveState#GHOST} if
- * a persistent {@link Oid}, or {@link ResolveState#TRANSIENT} otherwise.
+ * If the {@link ObjectAdapter adapter} is recreated, its
+ * {@link ResolveState} will be {@link ResolveState#GHOST} if a persistent
+ * {@link Oid}, or {@link ResolveState#TRANSIENT} otherwise.
*/
ObjectAdapter recreateRootAdapter(Oid oid, Object pojo);
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerProxy.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerProxy.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerProxy.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerProxy.java Sun Jan 22 07:36:07 2012
@@ -30,11 +30,13 @@ import org.apache.isis.runtimes.dflt.run
public interface AdapterManagerProxy extends ObjectAdapterLookup {
/**
- * Remaps an {@link Oid} that has been {@link Oid#getPrevious() updated} so that its {@link ObjectAdapter adapter}
- * (if any) is mapped to that {@link Oid}.
+ * Remaps an {@link Oid} that has been {@link Oid#getPrevious() updated} so
+ * that its {@link ObjectAdapter adapter} (if any) is mapped to that
+ * {@link Oid}.
*
* <p>
- * Part of public API so that the proxy persistor can maintain its maps when it processes a newly persisted object.
+ * Part of public API so that the proxy persistor can maintain its maps when
+ * it processes a newly persisted object.
*
* @see AdapterManagerPersist#remapAsPersistent(ObjectAdapter)
*/
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerTestSupport.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerTestSupport.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerTestSupport.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterManagerTestSupport.java Sun Jan 22 07:36:07 2012
@@ -25,17 +25,19 @@ import org.apache.isis.core.metamodel.ad
public interface AdapterManagerTestSupport {
/**
- * For testing purposes, creates an {@link ObjectAdapter adapter} for the supplied domain object with the specified
- * {@link Oid}.
+ * For testing purposes, creates an {@link ObjectAdapter adapter} for the
+ * supplied domain object with the specified {@link Oid}.
*
* <p>
- * The usual way of creating {@link ObjectAdapter adapter}s is using {@link #adapterFor(Object)}, using the
- * <tt>OidGenerator</tt> to obtain an {@link Oid}. This test-support method differs because it allows the
+ * The usual way of creating {@link ObjectAdapter adapter}s is using
+ * {@link #adapterFor(Object)}, using the <tt>OidGenerator</tt> to obtain an
+ * {@link Oid}. This test-support method differs because it allows the
* {@link Oid} to be specified explicitly.
*
* <p>
- * Note that the {@link Oid} must represent a {@link Oid#isTransient() transient} object. If an
- * {@link ObjectAdapter adapter} is required for a persistent {@link Oid}, just use
+ * Note that the {@link Oid} must represent a {@link Oid#isTransient()
+ * transient} object. If an {@link ObjectAdapter adapter} is required for a
+ * persistent {@link Oid}, just use
* {@link #recreateRootAdapter(Object, Oid)}.
*
* @see #adapterFor(Object)
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterUtils.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterUtils.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterUtils.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AdapterUtils.java Sun Jan 22 07:36:07 2012
@@ -31,8 +31,7 @@ public final class AdapterUtils {
private AdapterUtils() {
}
- public static ObjectAdapter createAdapter(final Class<?> type, final Object object,
- final AdapterManager adapterManager, final SpecificationLoader specificationLoader) {
+ public static ObjectAdapter createAdapter(final Class<?> type, final Object object, final AdapterManager adapterManager, final SpecificationLoader specificationLoader) {
final ObjectSpecification specification = specificationLoader.loadSpecification(type);
if (specification.isNotCollection()) {
return adapterManager.adapterFor(object);
@@ -41,8 +40,7 @@ public final class AdapterUtils {
}
}
- public static Object[] getCollectionAsObjectArray(final Object option, final ObjectSpecification spec,
- final AdapterManager adapterManager) {
+ public static Object[] getCollectionAsObjectArray(final Object option, final ObjectSpecification spec, final AdapterManager adapterManager) {
final ObjectAdapter collection = adapterManager.adapterFor(option);
final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
final Object[] optionArray = new Object[facet.size(collection)];
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AggregateAdapters.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AggregateAdapters.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AggregateAdapters.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/AggregateAdapters.java Sun Jan 22 07:36:07 2012
@@ -32,8 +32,7 @@ import org.apache.isis.core.metamodel.sp
public class AggregateAdapters implements Iterable<ObjectAdapter> {
private final ObjectAdapter rootAdapter;
- private final Map<OneToManyAssociation, ObjectAdapter> collectionAdapters =
- new LinkedHashMap<OneToManyAssociation, ObjectAdapter>();
+ private final Map<OneToManyAssociation, ObjectAdapter> collectionAdapters = new LinkedHashMap<OneToManyAssociation, ObjectAdapter>();
public AggregateAdapters(final ObjectAdapter rootAdapter) {
Assert.assertNotNull(rootAdapter);
@@ -55,8 +54,10 @@ public class AggregateAdapters implement
}
/**
- * Iterate over the {@link #addCollectionAdapter(OneToManyAssociation, ObjectAdapter) collection adapter}s (does not
- * include the {@link #getRootAdapter() root adapter}.
+ * Iterate over the
+ * {@link #addCollectionAdapter(OneToManyAssociation, ObjectAdapter)
+ * collection adapter}s (does not include the {@link #getRootAdapter() root
+ * adapter}.
*/
@Override
public Iterator<ObjectAdapter> iterator() {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/ObjectToAdapterTransformer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/ObjectToAdapterTransformer.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/ObjectToAdapterTransformer.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/ObjectToAdapterTransformer.java Sun Jan 22 07:36:07 2012
@@ -26,7 +26,8 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
/**
- * Uses the Commons Collection API to transform {@link Object}s into {@link ObjectAdapter} adapters.
+ * Uses the Commons Collection API to transform {@link Object}s into
+ * {@link ObjectAdapter} adapters.
*
*/
public final class ObjectToAdapterTransformer implements Transformer {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/OidAdapterHashMap.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/OidAdapterHashMap.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/OidAdapterHashMap.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/OidAdapterHashMap.java Sun Jan 22 07:36:07 2012
@@ -73,8 +73,7 @@ public class OidAdapterHashMap implement
@Override
public void reset() {
LOG.debug("reset");
- for (final Iterator<Map.Entry<Oid, ObjectAdapter>> iterator = adapterByOidMap.entrySet().iterator(); iterator
- .hasNext();) {
+ for (final Iterator<Map.Entry<Oid, ObjectAdapter>> iterator = adapterByOidMap.entrySet().iterator(); iterator.hasNext();) {
final Map.Entry<Oid, ObjectAdapter> entry = iterator.next();
final ObjectAdapter adapter = entry.getValue();
if (!adapter.getSpecification().isService()) {
@@ -93,10 +92,11 @@ public class OidAdapterHashMap implement
adapterByOidMap.put(oid, adapter);
// log at end so that if toString needs adapters they're in maps.
if (LOG.isDebugEnabled()) {
- // do not call toString() on adapter because would call hashCode on the pojo,
- // which for Hibernate PersistentCollections would trigger a resolve.
- LOG.debug("add oid: " + oid + " ; oid.hashCode: + #" + Long.toHexString(oid.hashCode())
- + " ; adapter.hashCode(): #" + Long.toHexString(adapter.hashCode()));
+ // do not call toString() on adapter because would call hashCode on
+ // the pojo,
+ // which for Hibernate PersistentCollections would trigger a
+ // resolve.
+ LOG.debug("add oid: " + oid + " ; oid.hashCode: + #" + Long.toHexString(oid.hashCode()) + " ; adapter.hashCode(): #" + Long.toHexString(adapter.hashCode()));
}
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterHashMap.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterHashMap.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterHashMap.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterHashMap.java Sun Jan 22 07:36:07 2012
@@ -98,8 +98,7 @@ public class PojoAdapterHashMap implemen
@Override
public void reset() {
LOG.debug("reset");
- for (final Iterator<Map.Entry<Object, ObjectAdapter>> iterator = adapterByPojoMap.entrySet().iterator(); iterator
- .hasNext();) {
+ for (final Iterator<Map.Entry<Object, ObjectAdapter>> iterator = adapterByPojoMap.entrySet().iterator(); iterator.hasNext();) {
final Map.Entry<Object, ObjectAdapter> entry = iterator.next();
final ObjectAdapter adapter = entry.getValue();
if (!adapter.getSpecification().isService()) {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterMap.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterMap.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterMap.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adaptermanager/internal/PojoAdapterMap.java Sun Jan 22 07:36:07 2012
@@ -24,8 +24,7 @@ import org.apache.isis.core.commons.comp
import org.apache.isis.core.commons.debug.DebuggableWithTitle;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-public interface PojoAdapterMap extends DebuggableWithTitle, Iterable<ObjectAdapter>, SessionScopedComponent,
- Resettable {
+public interface PojoAdapterMap extends DebuggableWithTitle, Iterable<ObjectAdapter>, SessionScopedComponent, Resettable {
void add(Object pojo, ObjectAdapter adapter);
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerObjectChanged.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerObjectChanged.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerObjectChanged.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerObjectChanged.java Sun Jan 22 07:36:07 2012
@@ -26,15 +26,18 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
/**
- * Helper class that encapsulates the processing performed by domain object containers that are performing an
- * objectChanged.
+ * Helper class that encapsulates the processing performed by domain object
+ * containers that are performing an objectChanged.
*
* <p>
- * Implementation note: rather than inject in its dependencies, we instead look up dependencies from the
- * {@link IsisContext}. This is necessary, for the {@link PersistenceSession} at least, because class enhancers may hold
- * a reference to the factory as part of the generated bytecode. Since the {@link PersistenceSession} could change over
- * the lifetime of the instance (eg when using the {@link InMemoryObjectStore}), we must always look the
- * {@link PersistenceSession} from the {@link IsisContext}. The same applies to the {@link ServicesInjector}.
+ * Implementation note: rather than inject in its dependencies, we instead look
+ * up dependencies from the {@link IsisContext}. This is necessary, for the
+ * {@link PersistenceSession} at least, because class enhancers may hold a
+ * reference to the factory as part of the generated bytecode. Since the
+ * {@link PersistenceSession} could change over the lifetime of the instance (eg
+ * when using the {@link InMemoryObjectStore}), we must always look the
+ * {@link PersistenceSession} from the {@link IsisContext}. The same applies to
+ * the {@link ServicesInjector}.
*/
public class DomainObjectContainerObjectChanged {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/container/DomainObjectContainerResolve.java Sun Jan 22 07:36:07 2012
@@ -27,14 +27,18 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.persistence.PersistenceSession;
/**
- * Helper class that encapsulates the processing performed by domain object containers that are performing a resolve.
+ * Helper class that encapsulates the processing performed by domain object
+ * containers that are performing a resolve.
*
* <p>
- * Implementation note: rather than inject in its dependencies, we instead look up dependencies from the
- * {@link IsisContext}. This is necessary, for the {@link PersistenceSession} at least, because class enhancers may hold
- * a reference to the factory as part of the generated bytecode. Since the {@link PersistenceSession} could change over
- * the lifetime of the instance (eg when using the {@link InMemoryObjectStore}), we must always look the
- * {@link PersistenceSession} from the {@link IsisContext}. The same applies to the {@link ServicesInjector}.
+ * Implementation note: rather than inject in its dependencies, we instead look
+ * up dependencies from the {@link IsisContext}. This is necessary, for the
+ * {@link PersistenceSession} at least, because class enhancers may hold a
+ * reference to the factory as part of the generated bytecode. Since the
+ * {@link PersistenceSession} could change over the lifetime of the instance (eg
+ * when using the {@link InMemoryObjectStore}), we must always look the
+ * {@link PersistenceSession} from the {@link IsisContext}. The same applies to
+ * the {@link ServicesInjector}.
*/
public class DomainObjectContainerResolve {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/internal/RuntimeContextFromSession.java Sun Jan 22 07:36:07 2012
@@ -62,8 +62,8 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.transaction.UpdateNotifier;
/**
- * Provides services to the metamodel based on the currently running {@link IsisSession session} (primarily the
- * {@link PersistenceSession}).
+ * Provides services to the metamodel based on the currently running
+ * {@link IsisSession session} (primarily the {@link PersistenceSession}).
*/
public class RuntimeContextFromSession extends RuntimeContextAbstract {
@@ -108,8 +108,7 @@ public class RuntimeContextFromSession e
};
@Override
- public ObjectAdapter adapterFor(final Object pojo, final ObjectAdapter ownerAdapter,
- final IdentifiedHolder identifiedHolder) {
+ public ObjectAdapter adapterFor(final Object pojo, final ObjectAdapter ownerAdapter, final IdentifiedHolder identifiedHolder) {
return getRuntimeAdapterManager().adapterFor(pojo, ownerAdapter, identifiedHolder);
}
};
@@ -232,7 +231,7 @@ public class RuntimeContextFromSession e
}
};
this.localizationProvider = new LocalizationProviderAbstract() {
-
+
@Override
public Localization getLocalization() {
return IsisContext.getLocalization();
@@ -269,10 +268,11 @@ public class RuntimeContextFromSession e
return servicesProvider;
}
+ @Override
public LocalizationProviderAbstract getLocalizationProvider() {
return localizationProvider;
}
-
+
@Override
public ObjectDirtier getObjectDirtier() {
return objectDirtier;
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectfactory/ObjectFactoryAbstract.java Sun Jan 22 07:36:07 2012
@@ -33,16 +33,19 @@ import org.apache.isis.runtimes.dflt.run
* Abstract adapter for {@link ObjectFactory}.
*
* <p>
- * Implementation note: rather than use the <tt>*Aware</tt> interfaces, we instead look up dependencies from the
- * {@link IsisContext}. This is necessary, for the {@link PersistenceSession} at least, because class enhancers may hold
- * a reference to the factory as part of the generated bytecode. Since the {@link PersistenceSession} could change over
- * the lifetime of the instance (eg when using the {@link InMemoryObjectStore}), we must always look the
- * {@link PersistenceSession} from the {@link IsisContext}. The same applies to the {@link ServicesInjector}.
+ * Implementation note: rather than use the <tt>*Aware</tt> interfaces, we
+ * instead look up dependencies from the {@link IsisContext}. This is necessary,
+ * for the {@link PersistenceSession} at least, because class enhancers may hold
+ * a reference to the factory as part of the generated bytecode. Since the
+ * {@link PersistenceSession} could change over the lifetime of the instance (eg
+ * when using the {@link InMemoryObjectStore}), we must always look the
+ * {@link PersistenceSession} from the {@link IsisContext}. The same applies to
+ * the {@link ServicesInjector}.
*
* <p>
- * In theory it would be possible to cache the {@link SpecificationLoader} and inject using
- * {@link SpecificationLoaderAware}, but since we are already using the {@link IsisContext}, decided instead to use the
- * same approach throughout.
+ * In theory it would be possible to cache the {@link SpecificationLoader} and
+ * inject using {@link SpecificationLoaderAware}, but since we are already using
+ * the {@link IsisContext}, decided instead to use the same approach throughout.
*/
public abstract class ObjectFactoryAbstract implements ObjectFactory {
@@ -54,7 +57,8 @@ public abstract class ObjectFactoryAbstr
*/
STRICT,
/**
- * Ignore if no {@link ObjectAdapterPersistor} has been injected (intended for testing only).
+ * Ignore if no {@link ObjectAdapterPersistor} has been injected
+ * (intended for testing only).
*/
RELAXED
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreLogger.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreLogger.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreLogger.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/IsisStoreLogger.java Sun Jan 22 07:36:07 2012
@@ -90,15 +90,13 @@ public class IsisStoreLogger extends Log
}
@Override
- public ObjectAdapter[] getInstances(final PersistenceQuery criteria) throws ObjectPersistenceException,
- UnsupportedFindException {
+ public ObjectAdapter[] getInstances(final PersistenceQuery criteria) throws ObjectPersistenceException, UnsupportedFindException {
log("get instances matching " + criteria);
return decorated.getInstances(criteria);
}
@Override
- public ObjectAdapter getObject(final Oid oid, final ObjectSpecification hint) throws ObjectNotFoundException,
- ObjectPersistenceException {
+ public ObjectAdapter getObject(final Oid oid, final ObjectSpecification hint) throws ObjectNotFoundException, ObjectPersistenceException {
final ObjectAdapter object = decorated.getObject(oid, hint);
log("get object for " + oid + " (of type " + hint.getShortIdentifier() + ")", object.getObject());
return object;
@@ -143,8 +141,7 @@ public class IsisStoreLogger extends Log
}
@Override
- public void resolveField(final ObjectAdapter object, final ObjectAssociation field)
- throws ObjectPersistenceException {
+ public void resolveField(final ObjectAdapter object, final ObjectAssociation field) throws ObjectPersistenceException {
log("resolve eagerly object in field " + field + " of " + object);
decorated.resolveField(object, field);
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStorePersistence.java Sun Jan 22 07:36:07 2012
@@ -44,11 +44,13 @@ public interface ObjectStorePersistence
String name();
/**
- * Determine if the object store has been initialized with its set of start up objects.
+ * Determine if the object store has been initialized with its set of start
+ * up objects.
*
* <p>
- * This method is called only once after the {@link #init()} has been called. If it returns <code>false</code> then
- * the framework will run the fixtures to initialise the object store.
+ * This method is called only once after the {@link #init()} has been
+ * called. If it returns <code>false</code> then the framework will run the
+ * fixtures to initialise the object store.
*/
boolean isFixturesInstalled();
@@ -66,34 +68,42 @@ public interface ObjectStorePersistence
// ///////////////////////////////////////////////////////
/**
- * Makes an {@link ObjectAdapter} persistent. The specified object should be stored away via this object store's
- * persistence mechanism, and have an new and unique OID assigned to it (by calling the object's <code>setOid</code>
- * method). The object, should also be added to the cache as the object is implicitly 'in use'.
+ * Makes an {@link ObjectAdapter} persistent. The specified object should be
+ * stored away via this object store's persistence mechanism, and have an
+ * new and unique OID assigned to it (by calling the object's
+ * <code>setOid</code> method). The object, should also be added to the
+ * cache as the object is implicitly 'in use'.
*
* <p>
- * If the object has any associations then each of these, where they aren't already persistent, should also be made
- * persistent by recursively calling this method.
+ * If the object has any associations then each of these, where they aren't
+ * already persistent, should also be made persistent by recursively calling
+ * this method.
* </p>
*
* <p>
- * If the object to be persisted is a collection, then each element of that collection, that is not already
- * persistent, should be made persistent by recursively calling this method.
+ * If the object to be persisted is a collection, then each element of that
+ * collection, that is not already persistent, should be made persistent by
+ * recursively calling this method.
* </p>
*
*/
CreateObjectCommand createCreateObjectCommand(ObjectAdapter object);
/**
- * Persists the specified object's state. Essentially the data held by the persistence mechanism should be updated
- * to reflect the state of the specified objects. Once updated, the object store should issue a notification to all
- * of the object's users via the <class>UpdateNotifier </class> object. This can be achieved simply, if extending
- * the <class> AbstractObjectStore </class> by calling its <method>broadcastObjectUpdate </method> method.
+ * Persists the specified object's state. Essentially the data held by the
+ * persistence mechanism should be updated to reflect the state of the
+ * specified objects. Once updated, the object store should issue a
+ * notification to all of the object's users via the <class>UpdateNotifier
+ * </class> object. This can be achieved simply, if extending the <class>
+ * AbstractObjectStore </class> by calling its <method>broadcastObjectUpdate
+ * </method> method.
*/
SaveObjectCommand createSaveObjectCommand(ObjectAdapter object);
/**
- * Removes the specified object from the object store. The specified object's data should be removed from the
- * persistence mechanism and, if it is cached (which it probably is), removed from the cache also.
+ * Removes the specified object from the object store. The specified
+ * object's data should be removed from the persistence mechanism and, if it
+ * is cached (which it probably is), removed from the cache also.
*/
DestroyObjectCommand createDestroyObjectCommand(ObjectAdapter object);
@@ -108,31 +118,38 @@ public interface ObjectStorePersistence
// ///////////////////////////////////////////////////////
/**
- * Retrieves the object identified by the specified OID from the object store. The cache should be checked first
- * and, if the object is cached, the cached version should be returned. It is important that if this method is
- * called again, while the originally returned object is in working memory, then this method must return that same
- * Java object.
- *
- * <p>
- * Assuming that the object is not cached then the data for the object should be retreived from the persistence
- * mechanism and the object recreated (as describe previously). The specified OID should then be assigned to the
- * recreated object by calling its <method>setOID </method>. Before returning the object its resolved flag should
- * also be set by calling its <method>setResolved </method> method as well.
- *
- * <p>
- * If the persistence mechanism does not known of an object with the specified {@link Oid} then a
- * {@link ObjectNotFoundException} should be thrown.
- *
- * <para>Note that the OID could be for an internal collection, and is therefore related to the parent object (using
- * a <class>CompositeOid </class>). The elements for an internal collection are commonly stored as part of the
- * parent object, so to get element the parent object needs to be retrieved first, and the internal collection can
- * be got from that. </para>
+ * Retrieves the object identified by the specified OID from the object
+ * store. The cache should be checked first and, if the object is cached,
+ * the cached version should be returned. It is important that if this
+ * method is called again, while the originally returned object is in
+ * working memory, then this method must return that same Java object.
+ *
+ * <p>
+ * Assuming that the object is not cached then the data for the object
+ * should be retreived from the persistence mechanism and the object
+ * recreated (as describe previously). The specified OID should then be
+ * assigned to the recreated object by calling its <method>setOID </method>.
+ * Before returning the object its resolved flag should also be set by
+ * calling its <method>setResolved </method> method as well.
+ *
+ * <p>
+ * If the persistence mechanism does not known of an object with the
+ * specified {@link Oid} then a {@link ObjectNotFoundException} should be
+ * thrown.
+ *
+ * <para>Note that the OID could be for an internal collection, and is
+ * therefore related to the parent object (using a <class>CompositeOid
+ * </class>). The elements for an internal collection are commonly stored as
+ * part of the parent object, so to get element the parent object needs to
+ * be retrieved first, and the internal collection can be got from that.
+ * </para>
*
* <p>
* Returns the stored ObjectAdapter object .
*
*
- * @return the requested {@link ObjectAdapter} that has the specified {@link Oid}.
+ * @return the requested {@link ObjectAdapter} that has the specified
+ * {@link Oid}.
*
* @throws ObjectNotFoundException
* when no object corresponding to the oid can be found
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/ObjectStoreTransactionManagement.java Sun Jan 22 07:36:07 2012
@@ -27,31 +27,34 @@ import org.apache.isis.runtimes.dflt.run
import org.apache.isis.runtimes.dflt.runtime.system.transaction.IsisTransactionManager;
/**
- * Interface for the {@link IsisTransactionManager} to interact with the {@link ObjectStore}.
+ * Interface for the {@link IsisTransactionManager} to interact with the
+ * {@link ObjectStore}.
*/
public interface ObjectStoreTransactionManagement {
/**
- * Used by the {@link ObjectStoreTransactionManager} to tell the underlying {@link ObjectStore} to start a
- * transaction.
+ * Used by the {@link ObjectStoreTransactionManager} to tell the underlying
+ * {@link ObjectStore} to start a transaction.
*/
void startTransaction();
/**
- * Used by the current {@link ObjectStoreTransaction} to flush changes to the {@link ObjectStore} (either via a
- * {@link IsisTransactionManager#flushTransaction()} or a {@link IsisTransactionManager#endTransaction()}).
+ * Used by the current {@link ObjectStoreTransaction} to flush changes to
+ * the {@link ObjectStore} (either via a
+ * {@link IsisTransactionManager#flushTransaction()} or a
+ * {@link IsisTransactionManager#endTransaction()}).
*/
void execute(List<PersistenceCommand> unmodifiableList);
/**
- * Used by the {@link ObjectStoreTransactionManager} to tell the underlying {@link ObjectStore} to commit a
- * transaction.
+ * Used by the {@link ObjectStoreTransactionManager} to tell the underlying
+ * {@link ObjectStore} to commit a transaction.
*/
void endTransaction();
/**
- * Used by the {@link ObjectStoreTransactionManager} to tell the underlying {@link ObjectStore} to abort a
- * transaction.
+ * Used by the {@link ObjectStoreTransactionManager} to tell the underlying
+ * {@link ObjectStore} to abort a transaction.
*/
void abortTransaction();
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/PersistenceSessionObjectStore.java Sun Jan 22 07:36:07 2012
@@ -77,14 +77,11 @@ public class PersistenceSessionObjectSto
private final Map<String, Oid> services = new HashMap<String, Oid>();
/**
- * Initialize the object store so that calls to this object store access persisted objects and persist changes to
- * the object that are saved.
+ * Initialize the object store so that calls to this object store access
+ * persisted objects and persist changes to the object that are saved.
*/
- public PersistenceSessionObjectStore(final PersistenceSessionFactory persistenceSessionFactory,
- final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory,
- final ServicesInjector servicesInjector, final OidGenerator oidGenerator,
- final AdapterManagerExtended identityMap, final PersistAlgorithm persistAlgorithm,
- final ObjectStorePersistence objectStore) {
+ public PersistenceSessionObjectStore(final PersistenceSessionFactory persistenceSessionFactory, final ObjectAdapterFactory adapterFactory, final ObjectFactory objectFactory, final ServicesInjector servicesInjector, final OidGenerator oidGenerator, final AdapterManagerExtended identityMap,
+ final PersistAlgorithm persistAlgorithm, final ObjectStorePersistence objectStore) {
super(persistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, oidGenerator, identityMap);
if (LOG.isDebugEnabled()) {
@@ -120,12 +117,15 @@ public class PersistenceSessionObjectSto
}
/**
- * Returns the cached value of {@link ObjectStore#isFixturesInstalled() whether fixtures are installed} from the
- * {@link PersistenceSessionFactory} (provided it implements {@link FixturesInstalledFlag}), otherwise queries
- * {@link ObjectStore} directly.
+ * Returns the cached value of {@link ObjectStore#isFixturesInstalled()
+ * whether fixtures are installed} from the
+ * {@link PersistenceSessionFactory} (provided it implements
+ * {@link FixturesInstalledFlag}), otherwise queries {@link ObjectStore}
+ * directly.
* <p>
- * This caching is important because if we've determined, for a given run, that fixtures are not installed, then we
- * don't want to change our mind by asking the object store again in another session.
+ * This caching is important because if we've determined, for a given run,
+ * that fixtures are not installed, then we don't want to change our mind by
+ * asking the object store again in another session.
*
* @see FixturesInstalledFlag
*/
@@ -181,13 +181,12 @@ public class PersistenceSessionObjectSto
private ObjectAdapter loadObjectFromPersistenceLayer(final Oid oid, final ObjectSpecification hintSpec) {
// the object store will map for us, using its hydrator (calls back
// to #recreateAdapter)
- return getTransactionManager().executeWithinTransaction(
- new TransactionalClosureWithReturnAbstract<ObjectAdapter>() {
- @Override
- public ObjectAdapter execute() {
- return objectStore.getObject(oid, hintSpec);
- }
- });
+ return getTransactionManager().executeWithinTransaction(new TransactionalClosureWithReturnAbstract<ObjectAdapter>() {
+ @Override
+ public ObjectAdapter execute() {
+ return objectStore.getObject(oid, hintSpec);
+ }
+ });
}
/**
@@ -216,9 +215,9 @@ public class PersistenceSessionObjectSto
Assert.assertTrue("only resolve object that is persistent", adapter, adapter.isPersistent());
resolveImmediatelyFromPersistenceLayer(adapter);
if (LOG.isDebugEnabled()) {
- // don't log object - its toString() may use the unresolved field, or unresolved collection
- LOG.debug("resolved: " + adapter.getSpecification().getShortIdentifier() + " " + resolveState.code()
- + " " + adapter.getOid());
+ // don't log object - its toString() may use the unresolved
+ // field, or unresolved collection
+ LOG.debug("resolved: " + adapter.getSpecification().getShortIdentifier() + " " + resolveState.code() + " " + adapter.getOid());
}
}
}
@@ -249,8 +248,7 @@ public class PersistenceSessionObjectSto
@Override
public void resolveField(final ObjectAdapter objectAdapter, final ObjectAssociation field) {
- if (field.isNotPersisted() || field.isOneToManyAssociation()
- || field.getSpecification().isCollectionOrIsAggregated()) {
+ if (field.isNotPersisted() || field.isOneToManyAssociation() || field.getSpecification().isCollectionOrIsAggregated()) {
return;
}
final ObjectAdapter referenceAdapter = field.get(objectAdapter);
@@ -263,9 +261,7 @@ public class PersistenceSessionObjectSto
if (LOG.isInfoEnabled()) {
// don't log object - it's toString() may use the unresolved field
// or unresolved collection
- LOG.info("resolve field " + objectAdapter.getSpecification().getShortIdentifier() + "." + field.getId()
- + ": " + referenceAdapter.getSpecification().getShortIdentifier() + " "
- + referenceAdapter.getResolveState().code() + " " + referenceAdapter.getOid());
+ LOG.info("resolve field " + objectAdapter.getSpecification().getShortIdentifier() + "." + field.getId() + ": " + referenceAdapter.getSpecification().getShortIdentifier() + " " + referenceAdapter.getResolveState().code() + " " + referenceAdapter.getOid());
}
resolveFieldFromPersistenceLayer(objectAdapter, field);
}
@@ -284,17 +280,20 @@ public class PersistenceSessionObjectSto
// ////////////////////////////////////////////////////////////////
/**
- * Makes an {@link ObjectAdapter} persistent. The specified object should be stored away via this object store's
- * persistence mechanism, and have an new and unique OID assigned to it. The object, should also be added to the
- * {@link AdapterManager} as the object is implicitly 'in use'.
+ * Makes an {@link ObjectAdapter} persistent. The specified object should be
+ * stored away via this object store's persistence mechanism, and have an
+ * new and unique OID assigned to it. The object, should also be added to
+ * the {@link AdapterManager} as the object is implicitly 'in use'.
*
* <p>
- * If the object has any associations then each of these, where they aren't already persistent, should also be made
- * persistent by recursively calling this method.
+ * If the object has any associations then each of these, where they aren't
+ * already persistent, should also be made persistent by recursively calling
+ * this method.
*
* <p>
- * If the object to be persisted is a collection, then each element of that collection, that is not already
- * persistent, should be made persistent by recursively calling this method.
+ * If the object to be persisted is a collection, then each element of that
+ * collection, that is not already persistent, should be made persistent by
+ * recursively calling this method.
*
* @see #remapAsPersistent(ObjectAdapter)
*/
@@ -353,10 +352,12 @@ public class PersistenceSessionObjectSto
if (adapter.getResolveState().respondToChangesInPersistentObjects()) {
if (isImmutable(adapter)) {
// previously used to throw
- // new ObjectPersistenceException("cannot change immutable object");
+ // new
+ // ObjectPersistenceException("cannot change immutable object");
// however, since the the bytecode enhancers effectively make
// calling objectChanged() the responsibility of the framework,
- // we may as well now do the check here and ignore if doesn't apply.
+ // we may as well now do the check here and ignore if doesn't
+ // apply.
return;
}
@@ -406,8 +407,8 @@ public class PersistenceSessionObjectSto
// ///////////////////////////////////////////////////////////////////////////
/**
- * Removes the specified object from the system. The specified object's data should be removed from the persistence
- * mechanism.
+ * Removes the specified object from the system. The specified object's data
+ * should be removed from the persistence mechanism.
*/
@Override
public void destroyObject(final ObjectAdapter adapter) {
@@ -430,8 +431,7 @@ public class PersistenceSessionObjectSto
@Override
public void execute() {
if (adapter.getVersion() == null) {
- throw new ObjectPersistenceException(
- "Object to be deleted does not have a version (maybe it should be resolved first): " + adapter);
+ throw new ObjectPersistenceException("Object to be deleted does not have a version (maybe it should be resolved first): " + adapter);
}
final DestroyObjectCommand command = objectStore.createDestroyObjectCommand(adapter);
getTransactionManager().addCommand(command);
@@ -454,21 +454,25 @@ public class PersistenceSessionObjectSto
// ///////////////////////////////////////////////////////////////////////////
/**
- * Callback from the {@link PersistAlgorithm} (or equivalent; some object stores such as Hibernate will use
- * listeners instead) to indicate that the {@link ObjectAdapter adapter} is persisted, and the adapter maps should
+ * Callback from the {@link PersistAlgorithm} (or equivalent; some object
+ * stores such as Hibernate will use listeners instead) to indicate that the
+ * {@link ObjectAdapter adapter} is persisted, and the adapter maps should
* be updated.
*
* <p>
- * The object store is expected to have already updated the {@link Oid} state and the {@link ResolveState} . Some
- * object stores (again, we're thinking Hibernate here) might also have updated collections, both the Oid of the
- * collection and the pojo wrapped by the adapter.
+ * The object store is expected to have already updated the {@link Oid}
+ * state and the {@link ResolveState} . Some object stores (again, we're
+ * thinking Hibernate here) might also have updated collections, both the
+ * Oid of the collection and the pojo wrapped by the adapter.
*
* <p>
- * The {@link PersistAlgorithm} is called from {@link #makePersistent(ObjectAdapter)}.
+ * The {@link PersistAlgorithm} is called from
+ * {@link #makePersistent(ObjectAdapter)}.
*
* <p>
- * TODO: the <tt>PersistenceSessionProxy</tt> doesn't have this method; should document better why this is the case,
- * and where the equivalent functionality is (somewhere in the marshalling stuff, I think).
+ * TODO: the <tt>PersistenceSessionProxy</tt> doesn't have this method;
+ * should document better why this is the case, and where the equivalent
+ * functionality is (somewhere in the marshalling stuff, I think).
*
* @see #remapAsPersistent(ObjectAdapter)
*/
@@ -490,18 +494,17 @@ public class PersistenceSessionObjectSto
}
private ObjectAdapter[] getInstancesFromPersistenceLayer(final PersistenceQuery persistenceQuery) {
- return getTransactionManager().executeWithinTransaction(
- new TransactionalClosureWithReturnAbstract<ObjectAdapter[]>() {
- @Override
- public ObjectAdapter[] execute() {
- return objectStore.getInstances(persistenceQuery);
- }
+ return getTransactionManager().executeWithinTransaction(new TransactionalClosureWithReturnAbstract<ObjectAdapter[]>() {
+ @Override
+ public ObjectAdapter[] execute() {
+ return objectStore.getInstances(persistenceQuery);
+ }
- @Override
- public void onSuccess() {
- clearAllDirty();
- }
- });
+ @Override
+ public void onSuccess() {
+ clearAllDirty();
+ }
+ });
}
// ///////////////////////////////////////////////////////////////////////////
@@ -509,9 +512,10 @@ public class PersistenceSessionObjectSto
// ///////////////////////////////////////////////////////////////////////////
/**
- * Checks whether there are any instances of the specified type. The object store should look for instances of the
- * type represented by <variable>type </variable> and return <code>true</code> if there are, or <code>false</code>
- * if there are not.
+ * Checks whether there are any instances of the specified type. The object
+ * store should look for instances of the type represented by <variable>type
+ * </variable> and return <code>true</code> if there are, or
+ * <code>false</code> if there are not.
*/
@Override
public boolean hasInstances(final ObjectSpecification specification) {
@@ -566,8 +570,10 @@ public class PersistenceSessionObjectSto
}
/**
- * Uses the {@link ObjectStore} to {@link ObjectStore#createCreateObjectCommand(ObjectAdapter) create} a
- * {@link CreateObjectCommand}, and adds to the {@link IsisTransactionManager}.
+ * Uses the {@link ObjectStore} to
+ * {@link ObjectStore#createCreateObjectCommand(ObjectAdapter) create} a
+ * {@link CreateObjectCommand}, and adds to the
+ * {@link IsisTransactionManager}.
*/
@Override
public void addPersistedObject(final ObjectAdapter object) {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/PersistAlgorithmAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/PersistAlgorithmAbstract.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/PersistAlgorithmAbstract.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/PersistAlgorithmAbstract.java Sun Jan 22 07:36:07 2012
@@ -47,23 +47,27 @@ public abstract class PersistAlgorithmAb
* There are various reasons why an object should not be persisted:
* <ul>
* <li>it is already persisted
- * <li>its {@link ObjectSpecification specification} indicates instances of its type should not be persisted.
+ * <li>its {@link ObjectSpecification specification} indicates instances of
+ * its type should not be persisted.
* <li>it is {@link ResolveState#VALUE standalone}
* <li>it is a {@link ObjectSpecification#isService() service}.
* </ul>
*
* <p>
- * Implementation note: the only reason that this method has not been combined with the weaker check in
- * {@link #alreadyPersistedOrNotPersistable(ObjectAdapter)} is because of existing code that throws an exception if
- * the latter is not fulfilled. <b><i>REVIEW: should try to combine and remove the other method</i></b>.
+ * Implementation note: the only reason that this method has not been
+ * combined with the weaker check in
+ * {@link #alreadyPersistedOrNotPersistable(ObjectAdapter)} is because of
+ * existing code that throws an exception if the latter is not fulfilled.
+ * <b><i>REVIEW: should try to combine and remove the other method</i></b>.
*/
protected boolean alreadyPersistedOrNotPersistableOrServiceOrStandalone(final ObjectAdapter adapter) {
return objectIsStandalone(adapter) || objectSpecIsService(adapter) || alreadyPersistedOrNotPersistable(adapter);
}
/**
- * If has a {@link ResolveState} that is already persisted or has a {@link ObjectSpecification specification} that
- * indicates instances of its type should not be persisted.
+ * If has a {@link ResolveState} that is already persisted or has a
+ * {@link ObjectSpecification specification} that indicates instances of its
+ * type should not be persisted.
*
* @see #alreadyPersistedOrNotPersistableOrServiceOrStandalone(ObjectAdapter)
*/
@@ -72,13 +76,12 @@ public abstract class PersistAlgorithmAb
}
/**
- * As per {@link #alreadyPersistedOrNotPersistable(ObjectAdapter)}, ensures object can be persisted else throws
- * {@link NotPersistableException}.
+ * As per {@link #alreadyPersistedOrNotPersistable(ObjectAdapter)}, ensures
+ * object can be persisted else throws {@link NotPersistableException}.
*/
protected void assertObjectNotPersistentAndPersistable(final ObjectAdapter object) {
if (alreadyPersistedOrNotPersistable(object)) {
- throw new NotPersistableException("can't make object persistent - either already persistent, "
- + "or transient only: " + object);
+ throw new NotPersistableException("can't make object persistent - either already persistent, " + "or transient only: " + object);
}
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/ToPersistObjectSet.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/ToPersistObjectSet.java?rev=1234456&r1=1234455&r2=1234456&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/ToPersistObjectSet.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/ToPersistObjectSet.java Sun Jan 22 07:36:07 2012
@@ -26,7 +26,8 @@ import org.apache.isis.runtimes.dflt.run
* Set of {@link ObjectAdapter}s that require persisting.
*
* <p>
- * Is consumed by {@link PersistAlgorithm}, and is ultimately implemented by {@link PersistenceSession}.
+ * Is consumed by {@link PersistAlgorithm}, and is ultimately implemented by
+ * {@link PersistenceSession}.
*/
public interface ToPersistObjectSet {