incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1031974 [2/4] - in /incubator/isis/trunk/alternatives/remoting: common/src/main/java/org/apache/isis/remoting/client/ common/src/main/java/org/apache/isis/remoting/client/authentication/ common/src/main/java/org/apache/isis/remoting/client...
Date Sat, 06 Nov 2010 08:46:39 GMT
Modified: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/ServerFacadeLogger.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/ServerFacadeLogger.java?rev=1031974&r1=1031973&r2=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/ServerFacadeLogger.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/ServerFacadeLogger.java Sat Nov  6 08:46:35 2010
@@ -17,483 +17,479 @@
  *  under the License.
  */
 
+package org.apache.isis.remoting.facade;
 
-package org.apache.isis.remoting.facade;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.Vector;
-
-import org.apache.isis.metamodel.adapter.oid.Oid;
-import org.apache.isis.metamodel.adapter.version.Version;
-import org.apache.isis.metamodel.authentication.AuthenticationSession;
-import org.apache.isis.metamodel.spec.ObjectSpecification;
-import org.apache.isis.metamodel.spec.feature.ObjectActionType;
-import org.apache.isis.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.remoting.client.transaction.ClientTransactionEvent;
-import org.apache.isis.remoting.data.Data;
-import org.apache.isis.remoting.data.common.CollectionData;
-import org.apache.isis.remoting.data.common.EncodableObjectData;
-import org.apache.isis.remoting.data.common.IdentityData;
-import org.apache.isis.remoting.data.common.NullData;
-import org.apache.isis.remoting.data.common.ObjectData;
-import org.apache.isis.remoting.data.common.ReferenceData;
-import org.apache.isis.remoting.data.query.PersistenceQueryData;
-import org.apache.isis.remoting.exchange.AuthorizationRequestUsability;
-import org.apache.isis.remoting.exchange.AuthorizationRequestVisibility;
-import org.apache.isis.remoting.exchange.ClearAssociationRequest;
-import org.apache.isis.remoting.exchange.ClearValueRequest;
-import org.apache.isis.remoting.exchange.CloseSessionRequest;
-import org.apache.isis.remoting.exchange.ExecuteClientActionRequest;
-import org.apache.isis.remoting.exchange.ExecuteServerActionRequest;
-import org.apache.isis.remoting.exchange.FindInstancesRequest;
-import org.apache.isis.remoting.exchange.GetObjectRequest;
-import org.apache.isis.remoting.exchange.GetPropertiesRequest;
-import org.apache.isis.remoting.exchange.GetPropertiesResponse;
-import org.apache.isis.remoting.exchange.HasInstancesRequest;
-import org.apache.isis.remoting.exchange.OidForServiceRequest;
-import org.apache.isis.remoting.exchange.OpenSessionRequest;
-import org.apache.isis.remoting.exchange.OpenSessionResponse;
-import org.apache.isis.remoting.exchange.AuthorizationResponse;
-import org.apache.isis.remoting.exchange.ClearAssociationResponse;
-import org.apache.isis.remoting.exchange.ClearValueResponse;
-import org.apache.isis.remoting.exchange.CloseSessionResponse;
-import org.apache.isis.remoting.exchange.ExecuteClientActionResponse;
-import org.apache.isis.remoting.exchange.ExecuteServerActionResponse;
-import org.apache.isis.remoting.exchange.FindInstancesResponse;
-import org.apache.isis.remoting.exchange.GetObjectResponse;
-import org.apache.isis.remoting.exchange.HasInstancesResponse;
-import org.apache.isis.remoting.exchange.OidForServiceResponse;
-import org.apache.isis.remoting.exchange.ResolveFieldRequest;
-import org.apache.isis.remoting.exchange.ResolveFieldResponse;
-import org.apache.isis.remoting.exchange.ResolveObjectRequest;
-import org.apache.isis.remoting.exchange.ResolveObjectResponse;
-import org.apache.isis.remoting.exchange.SetAssociationRequest;
-import org.apache.isis.remoting.exchange.SetAssociationResponse;
-import org.apache.isis.remoting.exchange.SetValueRequest;
-import org.apache.isis.remoting.exchange.SetValueResponse;
-import org.apache.isis.remoting.protocol.encoding.internal.ObjectEncoderDecoder;
-import org.apache.isis.runtime.context.IsisContext;
-import org.apache.isis.runtime.logging.Logger;
-
-import com.google.inject.internal.Lists;
-
-
-/**
- * previously called <tt>DistributionLogger</tt>.
- */
-public class ServerFacadeLogger extends Logger implements ServerFacade {
-
-    private static String PADDING = "      ";
-
-    private final ObjectEncoderDecoder encoder;
-    private final ServerFacade decorated;
-
-    public ServerFacadeLogger(final ObjectEncoderDecoder encoder, final ServerFacade decorated, final String level) {
-        super(level);
-        this.encoder = encoder;
-        this.decorated = decorated;
-    }
-
-    public ServerFacadeLogger(final ObjectEncoderDecoder encoder, final ServerFacade decorated) {
-        this(encoder, decorated, null);
-    }
-
-
-
-    @Override
-    protected Class getDecoratedClass() {
-        return decorated.getClass();
-    }
-
-    //////////////////////////////////////////////////////////////////
-    // init, shutdown
-    //////////////////////////////////////////////////////////////////
-
-    public void init() {
-        decorated.init();
-    }
-
-    public void shutdown() {
-        decorated.shutdown();
-    }
-
-
-
-    //////////////////////////////////////////////////////////////////
-    // authentication, authorization
-    //////////////////////////////////////////////////////////////////
-
-    public OpenSessionResponse openSession(OpenSessionRequest request) {
-        log("authenticate");
-        return decorated.openSession(request);
-    }
-
-    public AuthorizationResponse authorizeUsability(AuthorizationRequestUsability request) {
-        log("authoriseUsability");
-        return decorated.authorizeUsability(request);
-    }
-
-    public AuthorizationResponse authorizeVisibility(AuthorizationRequestVisibility request) {
-        log("authoriseVisibility");
-        return decorated.authorizeVisibility(request);
-    }
-
-    //////////////////////////////////////////////////////////////////
-    // session
-    //////////////////////////////////////////////////////////////////
-
-    public CloseSessionResponse closeSession(CloseSessionRequest request) {
-    	AuthenticationSession session = request.getSession();
-        log("close session " + session);
-        CloseSessionResponse response = decorated.closeSession(request);
-        return response;
-    }
-
-
-    //////////////////////////////////////////////////////////////////
-    // setAssociation, setValue, clearAssociation, clearValue
-    //////////////////////////////////////////////////////////////////
-
-    public SetAssociationResponse setAssociation(
-            SetAssociationRequest request) {
-
-    	String fieldIdentifier = request.getFieldIdentifier();
-    	IdentityData targetData = request.getTarget();
-    	IdentityData associateData = request.getAssociate();
-
-        log("set association " + fieldIdentifier + indentedNewLine() + "target: " + dump(targetData) + indentedNewLine()
-                + "associate: " + dump(associateData));
-        SetAssociationResponse response = decorated.setAssociation(request);
-		final ObjectData[] changes = response.getUpdates();
-        log("  <-- changes: " + dump(changes));
-        return response;
-    }
-
-    public SetValueResponse setValue(
-            final SetValueRequest request) {
-
-    	String fieldIdentifier = request.getFieldIdentifier();
-    	IdentityData target = request.getTarget();
-    	EncodableObjectData value = request.getValue();
-
-        log("set value " + fieldIdentifier + indentedNewLine() + "target: " + dump(target) + indentedNewLine() + "value: "
-                + value);
-        SetValueResponse response = decorated.setValue(request);
-		final ObjectData[] updates = response.getUpdates();
-        log("  <-- changes: " + dump(updates));
-        return response;
-    }
-
-    public ClearAssociationResponse clearAssociation(
-            final ClearAssociationRequest request) {
-    	String fieldIdentifier = request.getFieldIdentifier();
-    	IdentityData target = request.getTarget();
-    	IdentityData associate = request.getAssociate();
-
-        log("clear association " + fieldIdentifier + indentedNewLine() + "target: " + dump(target) + indentedNewLine()
-                + "associate: " + dump(associate));
-        ClearAssociationResponse response = decorated.clearAssociation(request);
-		final ObjectData[] updates = response.getUpdates();
-        log("  <-- changes: " + dump(updates));
-        return response;
-    }
-
-    public ClearValueResponse clearValue(
-    		final ClearValueRequest request) {
-
-    	String fieldIdentifier = request.getFieldIdentifier();
-    	IdentityData target = request.getTarget();
-
-        log("clear value " + fieldIdentifier + indentedNewLine() + "target: " + dump(target));
-        ClearValueResponse response = decorated.clearValue(request);
-		final ObjectData[] updates = response.getUpdates();
-        log("  <-- changes: " + dump(updates));
-        return response;
-    }
-
-    //////////////////////////////////////////////////////////////////
-    // executeClientAction, executeServerAction
-    //////////////////////////////////////////////////////////////////
-
-    public ExecuteServerActionResponse executeServerAction(
-            final ExecuteServerActionRequest request) {
-
-    	ObjectActionType actionType = request.getActionType();
-    	String actionIdentifier = request.getActionIdentifier();
-    	ReferenceData target = request.getTarget();
-    	Data[] parameters = request.getParameters();
-
-        log("execute action " + actionIdentifier + "/" + actionType + indentedNewLine() + "target: " + dump(target)
-                + indentedNewLine() + "parameters: " + dump(parameters));
-        ExecuteServerActionResponse result;
-        try {
-            result = decorated.executeServerAction(request);
-            log("  <-- returns: " + dump(result.getReturn()));
-            log("  <-- persisted target: " + dump(result.getPersistedTarget()));
-            log("  <-- persisted parameters: " + dump(result.getPersistedParameters()));
-            log("  <-- updates: " + dump(result.getUpdates()));
-            log("  <-- disposed: " + dump(result.getDisposed()));
-        } catch (final RuntimeException e) {
-            log("  <-- exception: " + e.getClass().getName() + " " + e.getMessage());
-            throw e;
-        }
-        return result;
-    }
-
-    public ExecuteClientActionResponse executeClientAction(
-    		ExecuteClientActionRequest request) {
-
-    	ReferenceData[] data = request.getData();
-    	int[] types = request.getTypes();
-
-        List<Data> complete = Lists.newArrayList();
-        StringBuilder str = new StringBuilder();
-        for (int i = 0; i < data.length; i++) {
-            str.append(indentedNewLine());
-            str.append("[");
-            str.append(i + 1);
-            str.append("] ");
-            switch (types[i]) {
-            case ClientTransactionEvent.ADD:
-                str.append("persisted: ");
-                break;
-            case ClientTransactionEvent.CHANGE:
-                str.append("changed: ");
-                break;
-            case ClientTransactionEvent.DELETE:
-                str.append("deleted: ");
-                break;
-            }
-            dump(str, data[i], 3, complete);
-        }
-        log("execute client action " + str);
-
-        final ExecuteClientActionResponse results = decorated.executeClientAction(request);
-
-        complete = new Vector();
-        str = new StringBuilder();
-        final ReferenceData[] persistedUpdates = results.getPersisted();
-        final Version[] changedVersions = results.getChanged();
-        for (int i = 0; i < persistedUpdates.length; i++) {
-            str.append(indentedNewLine());
-            str.append("[");
-            str.append(i + 1);
-            str.append("] ");
-            switch (types[i]) {
-            case ClientTransactionEvent.ADD:
-                str.append("persisted: ");
-                dump(str, persistedUpdates[i], 3, complete);
-                break;
-            case ClientTransactionEvent.CHANGE:
-                str.append("changed: ");
-                str.append(changedVersions[i]);
-                break;
-            }
-        }
-        log(" <--- execute client action results" + str);
-        /*
-         * log(" <-- persisted: " + dump(results.getPersisted())); log(" <-- changed: " +
-         * dump(results.getChanged()));
-         */
-        return results;
-    }
-
-
-    //////////////////////////////////////////////////////////////////
-    // getObject, resolveXxx
-    //////////////////////////////////////////////////////////////////
-
-    public GetObjectResponse getObject(
-    		GetObjectRequest request) {
-
-    	Oid oid = request.getOid();
-
-        log("get object " + oid);
-        GetObjectResponse response = decorated.getObject(request);
-		final ObjectData data = response.getObjectData();
-        log(" <-- data: " + data);
-        return response;
-    }
-
-    public ResolveFieldResponse resolveField(
-    		ResolveFieldRequest request) {
-
-    	IdentityData target = request.getTarget();
-    	String fieldIdentifier = request.getFieldIdentifier();
-
-        log("resolve field " + fieldIdentifier + " - " + dump(target));
-        ResolveFieldResponse response = decorated.resolveField(request);
-		final Data result = response.getData();
-        log(" <-- data: " + dump(result));
-        return response;
-    }
-
-    public ResolveObjectResponse resolveImmediately(
-    		ResolveObjectRequest request) {
-
-    	IdentityData target = request.getTarget();
-
-        log("resolve immediately" + dump(target));
-        ResolveObjectResponse response = decorated.resolveImmediately(request);
-		final ObjectData objectData = response.getObjectData();
-        log("  <-- data: " + dump(objectData));
-        return response;
-    }
-
-
-    //////////////////////////////////////////////////////////////////
-    // findInstances, hasInstances
-    //////////////////////////////////////////////////////////////////
-
-    public FindInstancesResponse findInstances(
-    		FindInstancesRequest request) {
-
-    	PersistenceQueryData criteria = request.getCriteria();
-
-        log("find instances " + criteria);
-        FindInstancesResponse response = decorated.findInstances(request);
-		final ObjectData[] instances = response.getInstances();
-        log(" <-- instances: " + dump(instances));
-        return response;
-    }
-
-    public HasInstancesResponse hasInstances(
-    		HasInstancesRequest request) {
-
-    	String specificationName = request.getSpecificationName();
-
-        log("has instances " + specificationName);
-        HasInstancesResponse response = decorated.hasInstances(request);
-		final boolean hasInstances = response.hasInstances();
-        log(" <-- instances: " + (hasInstances ? "yes" : "no"));
-        return response;
-    }
-
-    //////////////////////////////////////////////////////////////////
-    // getProperties
-    //////////////////////////////////////////////////////////////////
-
-    public GetPropertiesResponse getProperties(GetPropertiesRequest request) {
-        log("get properties");
-        GetPropertiesResponse response = decorated.getProperties(request);
-		final Properties properties = response.getProperties();
-        log(" <-- data: " + properties);
-        return response;
-    }
-
-    //////////////////////////////////////////////////////////////////
-    // services
-    //////////////////////////////////////////////////////////////////
-
-    public OidForServiceResponse oidForService(
-    		OidForServiceRequest request) {
-
-    	String serviceId = request.getServiceId();
-
-        log("oid for resource " + serviceId);
-
-        OidForServiceResponse response = decorated.oidForService(request);
-		final IdentityData oidData = response.getOidData();
-        log(" <-- data: " + dump(oidData));
-        return response;
-    }
-
-
-    //////////////////////////////////////////////////////////////////
-    // Helpers
-    //////////////////////////////////////////////////////////////////
-
-    private String dump(final Data data) {
-        final StringBuilder str = new StringBuilder();
-        dump(str, data, 1, new ArrayList<Data>());
-        return str.toString();
-    }
-
-    private String dump(final Data[] data) {
-        final StringBuilder str = new StringBuilder();
-        for (int i = 0; i < data.length; i++) {
-            str.append("\n    [");
-            str.append(i + 1);
-            str.append("] ");
-            dump(str, data[i], 3, new ArrayList<Data>());
-        }
-        return str.toString();
-    }
-
-    private void dump(final StringBuilder str, final Data data, final int indent, final List<Data> complete) {
-        if (data == null) {
-            str.append("null");
-        } else if (data instanceof NullData) {
-            str.append("NULL (NullData object)");
-        } else if (data instanceof EncodableObjectData) {
-            final EncodableObjectData encodeableObjectData = ((EncodableObjectData) data);
-            str.append("ValueData@" + Integer.toHexString(encodeableObjectData.hashCode()) + " " + encodeableObjectData.getType()
-                    + ":" + encodeableObjectData.getEncodedObjectData());
-        } else if (data instanceof IdentityData) {
-            final IdentityData referenceData = (IdentityData) data;
-            str.append("ReferenceData@" + Integer.toHexString(referenceData.hashCode()) + " " + referenceData.getType() + ":"
-                    + referenceData.getOid() + ":" + referenceData.getVersion());
-        } else if (data instanceof ObjectData) {
-            dumpObjectData(str, data, indent, complete);
-        } else if (data instanceof CollectionData) {
-            dumpCollectionData(str, data, indent, complete);
-        } else {
-            str.append("Unknown: " + data);
-        }
-    }
-
-    private void dumpCollectionData(final StringBuilder str, final Data data, final int indent, final List<Data> complete) {
-        final CollectionData objectData = ((CollectionData) data);
-        str.append("CollectionData@" + Integer.toHexString(objectData.hashCode()) + " " + objectData.getType() + ":"
-                + objectData.getOid() + ":" + (objectData.hasAllElements() ? "A" : "-") + ":" + objectData.getVersion());
-        final Object[] elements = objectData.getElements();
-        for (int i = 0; elements != null && i < elements.length; i++) {
-            str.append("\n");
-            str.append(padding(indent));
-            str.append(i + 1);
-            str.append(") ");
-            dump(str, (Data) elements[i], indent + 1, complete);
-        }
-    }
-
-    private void dumpObjectData(final StringBuilder str, final Data data, final int indent, final List<Data> complete) {
-        final ObjectData objectData = ((ObjectData) data);
-        str.append("ObjectData@" + Integer.toHexString(objectData.hashCode()) + " " + objectData.getType() + ":"
-                + objectData.getOid() + ":" + (objectData.hasCompleteData() ? "C" : "-") + ":" + objectData.getVersion());
-
-        if (complete.contains(objectData)) {
-            str.append(" (already detailed)");
-            return;
-        }
-
-        complete.add(objectData);
-        final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(data.getType());
-        final ObjectAssociation[] fs = encoder.getFieldOrder(spec);
-        final Object[] fields = objectData.getFieldContent();
-        for (int i = 0; fields != null && i < fields.length; i++) {
-            str.append("\n");
-            str.append(padding(indent));
-            str.append(i + 1);
-            str.append(") ");
-            str.append(fs[i].getId());
-            str.append(": ");
-            dump(str, (Data) fields[i], indent + 1, complete);
-        }
-    }
-
-    private String indentedNewLine() {
-        return "\n" + padding(2);
-    }
-
-    private String padding(final int indent) {
-        final int length = indent * 3;
-        while (length > PADDING.length()) {
-            PADDING += PADDING;
-        }
-        return PADDING.substring(0, length);
-    }
-
-
-}
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import java.util.Vector;
+
+import org.apache.isis.metamodel.adapter.oid.Oid;
+import org.apache.isis.metamodel.adapter.version.Version;
+import org.apache.isis.metamodel.authentication.AuthenticationSession;
+import org.apache.isis.metamodel.spec.ObjectSpecification;
+import org.apache.isis.metamodel.spec.feature.ObjectActionType;
+import org.apache.isis.metamodel.spec.feature.ObjectAssociation;
+import org.apache.isis.remoting.client.transaction.ClientTransactionEvent;
+import org.apache.isis.remoting.data.Data;
+import org.apache.isis.remoting.data.common.CollectionData;
+import org.apache.isis.remoting.data.common.EncodableObjectData;
+import org.apache.isis.remoting.data.common.IdentityData;
+import org.apache.isis.remoting.data.common.NullData;
+import org.apache.isis.remoting.data.common.ObjectData;
+import org.apache.isis.remoting.data.common.ReferenceData;
+import org.apache.isis.remoting.data.query.PersistenceQueryData;
+import org.apache.isis.remoting.exchange.AuthorizationRequestUsability;
+import org.apache.isis.remoting.exchange.AuthorizationRequestVisibility;
+import org.apache.isis.remoting.exchange.AuthorizationResponse;
+import org.apache.isis.remoting.exchange.ClearAssociationRequest;
+import org.apache.isis.remoting.exchange.ClearAssociationResponse;
+import org.apache.isis.remoting.exchange.ClearValueRequest;
+import org.apache.isis.remoting.exchange.ClearValueResponse;
+import org.apache.isis.remoting.exchange.CloseSessionRequest;
+import org.apache.isis.remoting.exchange.CloseSessionResponse;
+import org.apache.isis.remoting.exchange.ExecuteClientActionRequest;
+import org.apache.isis.remoting.exchange.ExecuteClientActionResponse;
+import org.apache.isis.remoting.exchange.ExecuteServerActionRequest;
+import org.apache.isis.remoting.exchange.ExecuteServerActionResponse;
+import org.apache.isis.remoting.exchange.FindInstancesRequest;
+import org.apache.isis.remoting.exchange.FindInstancesResponse;
+import org.apache.isis.remoting.exchange.GetObjectRequest;
+import org.apache.isis.remoting.exchange.GetObjectResponse;
+import org.apache.isis.remoting.exchange.GetPropertiesRequest;
+import org.apache.isis.remoting.exchange.GetPropertiesResponse;
+import org.apache.isis.remoting.exchange.HasInstancesRequest;
+import org.apache.isis.remoting.exchange.HasInstancesResponse;
+import org.apache.isis.remoting.exchange.OidForServiceRequest;
+import org.apache.isis.remoting.exchange.OidForServiceResponse;
+import org.apache.isis.remoting.exchange.OpenSessionRequest;
+import org.apache.isis.remoting.exchange.OpenSessionResponse;
+import org.apache.isis.remoting.exchange.ResolveFieldRequest;
+import org.apache.isis.remoting.exchange.ResolveFieldResponse;
+import org.apache.isis.remoting.exchange.ResolveObjectRequest;
+import org.apache.isis.remoting.exchange.ResolveObjectResponse;
+import org.apache.isis.remoting.exchange.SetAssociationRequest;
+import org.apache.isis.remoting.exchange.SetAssociationResponse;
+import org.apache.isis.remoting.exchange.SetValueRequest;
+import org.apache.isis.remoting.exchange.SetValueResponse;
+import org.apache.isis.remoting.protocol.ObjectEncoderDecoder;
+import org.apache.isis.runtime.context.IsisContext;
+import org.apache.isis.runtime.logging.Logger;
+
+import com.google.inject.internal.Lists;
+
+/**
+ * previously called <tt>DistributionLogger</tt>.
+ */
+public class ServerFacadeLogger extends Logger implements ServerFacade {
+
+    private static String PADDING = "      ";
+
+    private final ObjectEncoderDecoder encoder;
+    private final ServerFacade decorated;
+
+    public ServerFacadeLogger(final ObjectEncoderDecoder encoder, final ServerFacade decorated, final String level) {
+        super(level);
+        this.encoder = encoder;
+        this.decorated = decorated;
+    }
+
+    public ServerFacadeLogger(final ObjectEncoderDecoder encoder, final ServerFacade decorated) {
+        this(encoder, decorated, null);
+    }
+
+    @Override
+    protected Class getDecoratedClass() {
+        return decorated.getClass();
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // init, shutdown
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public void init() {
+        decorated.init();
+    }
+
+    @Override
+    public void shutdown() {
+        decorated.shutdown();
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // authentication, authorization
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public OpenSessionResponse openSession(OpenSessionRequest request) {
+        log("authenticate");
+        return decorated.openSession(request);
+    }
+
+    @Override
+    public AuthorizationResponse authorizeUsability(AuthorizationRequestUsability request) {
+        log("authoriseUsability");
+        return decorated.authorizeUsability(request);
+    }
+
+    @Override
+    public AuthorizationResponse authorizeVisibility(AuthorizationRequestVisibility request) {
+        log("authoriseVisibility");
+        return decorated.authorizeVisibility(request);
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // session
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public CloseSessionResponse closeSession(CloseSessionRequest request) {
+        AuthenticationSession session = request.getSession();
+        log("close session " + session);
+        CloseSessionResponse response = decorated.closeSession(request);
+        return response;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // setAssociation, setValue, clearAssociation, clearValue
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public SetAssociationResponse setAssociation(SetAssociationRequest request) {
+
+        String fieldIdentifier = request.getFieldIdentifier();
+        IdentityData targetData = request.getTarget();
+        IdentityData associateData = request.getAssociate();
+
+        log("set association " + fieldIdentifier + indentedNewLine() + "target: " + dump(targetData)
+            + indentedNewLine() + "associate: " + dump(associateData));
+        SetAssociationResponse response = decorated.setAssociation(request);
+        final ObjectData[] changes = response.getUpdates();
+        log("  <-- changes: " + dump(changes));
+        return response;
+    }
+
+    @Override
+    public SetValueResponse setValue(final SetValueRequest request) {
+
+        String fieldIdentifier = request.getFieldIdentifier();
+        IdentityData target = request.getTarget();
+        EncodableObjectData value = request.getValue();
+
+        log("set value " + fieldIdentifier + indentedNewLine() + "target: " + dump(target) + indentedNewLine()
+            + "value: " + value);
+        SetValueResponse response = decorated.setValue(request);
+        final ObjectData[] updates = response.getUpdates();
+        log("  <-- changes: " + dump(updates));
+        return response;
+    }
+
+    @Override
+    public ClearAssociationResponse clearAssociation(final ClearAssociationRequest request) {
+        String fieldIdentifier = request.getFieldIdentifier();
+        IdentityData target = request.getTarget();
+        IdentityData associate = request.getAssociate();
+
+        log("clear association " + fieldIdentifier + indentedNewLine() + "target: " + dump(target) + indentedNewLine()
+            + "associate: " + dump(associate));
+        ClearAssociationResponse response = decorated.clearAssociation(request);
+        final ObjectData[] updates = response.getUpdates();
+        log("  <-- changes: " + dump(updates));
+        return response;
+    }
+
+    @Override
+    public ClearValueResponse clearValue(final ClearValueRequest request) {
+
+        String fieldIdentifier = request.getFieldIdentifier();
+        IdentityData target = request.getTarget();
+
+        log("clear value " + fieldIdentifier + indentedNewLine() + "target: " + dump(target));
+        ClearValueResponse response = decorated.clearValue(request);
+        final ObjectData[] updates = response.getUpdates();
+        log("  <-- changes: " + dump(updates));
+        return response;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // executeClientAction, executeServerAction
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public ExecuteServerActionResponse executeServerAction(final ExecuteServerActionRequest request) {
+
+        ObjectActionType actionType = request.getActionType();
+        String actionIdentifier = request.getActionIdentifier();
+        ReferenceData target = request.getTarget();
+        Data[] parameters = request.getParameters();
+
+        log("execute action " + actionIdentifier + "/" + actionType + indentedNewLine() + "target: " + dump(target)
+            + indentedNewLine() + "parameters: " + dump(parameters));
+        ExecuteServerActionResponse result;
+        try {
+            result = decorated.executeServerAction(request);
+            log("  <-- returns: " + dump(result.getReturn()));
+            log("  <-- persisted target: " + dump(result.getPersistedTarget()));
+            log("  <-- persisted parameters: " + dump(result.getPersistedParameters()));
+            log("  <-- updates: " + dump(result.getUpdates()));
+            log("  <-- disposed: " + dump(result.getDisposed()));
+        } catch (final RuntimeException e) {
+            log("  <-- exception: " + e.getClass().getName() + " " + e.getMessage());
+            throw e;
+        }
+        return result;
+    }
+
+    @Override
+    public ExecuteClientActionResponse executeClientAction(ExecuteClientActionRequest request) {
+
+        ReferenceData[] data = request.getData();
+        int[] types = request.getTypes();
+
+        List<Data> complete = Lists.newArrayList();
+        StringBuilder str = new StringBuilder();
+        for (int i = 0; i < data.length; i++) {
+            str.append(indentedNewLine());
+            str.append("[");
+            str.append(i + 1);
+            str.append("] ");
+            switch (types[i]) {
+                case ClientTransactionEvent.ADD:
+                    str.append("persisted: ");
+                    break;
+                case ClientTransactionEvent.CHANGE:
+                    str.append("changed: ");
+                    break;
+                case ClientTransactionEvent.DELETE:
+                    str.append("deleted: ");
+                    break;
+            }
+            dump(str, data[i], 3, complete);
+        }
+        log("execute client action " + str);
+
+        final ExecuteClientActionResponse results = decorated.executeClientAction(request);
+
+        complete = new Vector();
+        str = new StringBuilder();
+        final ReferenceData[] persistedUpdates = results.getPersisted();
+        final Version[] changedVersions = results.getChanged();
+        for (int i = 0; i < persistedUpdates.length; i++) {
+            str.append(indentedNewLine());
+            str.append("[");
+            str.append(i + 1);
+            str.append("] ");
+            switch (types[i]) {
+                case ClientTransactionEvent.ADD:
+                    str.append("persisted: ");
+                    dump(str, persistedUpdates[i], 3, complete);
+                    break;
+                case ClientTransactionEvent.CHANGE:
+                    str.append("changed: ");
+                    str.append(changedVersions[i]);
+                    break;
+            }
+        }
+        log(" <--- execute client action results" + str);
+        /*
+         * log(" <-- persisted: " + dump(results.getPersisted())); log(" <-- changed: " + dump(results.getChanged()));
+         */
+        return results;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // getObject, resolveXxx
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public GetObjectResponse getObject(GetObjectRequest request) {
+
+        Oid oid = request.getOid();
+
+        log("get object " + oid);
+        GetObjectResponse response = decorated.getObject(request);
+        final ObjectData data = response.getObjectData();
+        log(" <-- data: " + data);
+        return response;
+    }
+
+    @Override
+    public ResolveFieldResponse resolveField(ResolveFieldRequest request) {
+
+        IdentityData target = request.getTarget();
+        String fieldIdentifier = request.getFieldIdentifier();
+
+        log("resolve field " + fieldIdentifier + " - " + dump(target));
+        ResolveFieldResponse response = decorated.resolveField(request);
+        final Data result = response.getData();
+        log(" <-- data: " + dump(result));
+        return response;
+    }
+
+    @Override
+    public ResolveObjectResponse resolveImmediately(ResolveObjectRequest request) {
+
+        IdentityData target = request.getTarget();
+
+        log("resolve immediately" + dump(target));
+        ResolveObjectResponse response = decorated.resolveImmediately(request);
+        final ObjectData objectData = response.getObjectData();
+        log("  <-- data: " + dump(objectData));
+        return response;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // findInstances, hasInstances
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public FindInstancesResponse findInstances(FindInstancesRequest request) {
+
+        PersistenceQueryData criteria = request.getCriteria();
+
+        log("find instances " + criteria);
+        FindInstancesResponse response = decorated.findInstances(request);
+        final ObjectData[] instances = response.getInstances();
+        log(" <-- instances: " + dump(instances));
+        return response;
+    }
+
+    @Override
+    public HasInstancesResponse hasInstances(HasInstancesRequest request) {
+
+        String specificationName = request.getSpecificationName();
+
+        log("has instances " + specificationName);
+        HasInstancesResponse response = decorated.hasInstances(request);
+        final boolean hasInstances = response.hasInstances();
+        log(" <-- instances: " + (hasInstances ? "yes" : "no"));
+        return response;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // getProperties
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public GetPropertiesResponse getProperties(GetPropertiesRequest request) {
+        log("get properties");
+        GetPropertiesResponse response = decorated.getProperties(request);
+        final Properties properties = response.getProperties();
+        log(" <-- data: " + properties);
+        return response;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // services
+    // ////////////////////////////////////////////////////////////////
+
+    @Override
+    public OidForServiceResponse oidForService(OidForServiceRequest request) {
+
+        String serviceId = request.getServiceId();
+
+        log("oid for resource " + serviceId);
+
+        OidForServiceResponse response = decorated.oidForService(request);
+        final IdentityData oidData = response.getOidData();
+        log(" <-- data: " + dump(oidData));
+        return response;
+    }
+
+    // ////////////////////////////////////////////////////////////////
+    // Helpers
+    // ////////////////////////////////////////////////////////////////
+
+    private String dump(final Data data) {
+        final StringBuilder str = new StringBuilder();
+        dump(str, data, 1, new ArrayList<Data>());
+        return str.toString();
+    }
+
+    private String dump(final Data[] data) {
+        final StringBuilder str = new StringBuilder();
+        for (int i = 0; i < data.length; i++) {
+            str.append("\n    [");
+            str.append(i + 1);
+            str.append("] ");
+            dump(str, data[i], 3, new ArrayList<Data>());
+        }
+        return str.toString();
+    }
+
+    private void dump(final StringBuilder str, final Data data, final int indent, final List<Data> complete) {
+        if (data == null) {
+            str.append("null");
+        } else if (data instanceof NullData) {
+            str.append("NULL (NullData object)");
+        } else if (data instanceof EncodableObjectData) {
+            final EncodableObjectData encodeableObjectData = ((EncodableObjectData) data);
+            str.append("ValueData@" + Integer.toHexString(encodeableObjectData.hashCode()) + " "
+                + encodeableObjectData.getType() + ":" + encodeableObjectData.getEncodedObjectData());
+        } else if (data instanceof IdentityData) {
+            final IdentityData referenceData = (IdentityData) data;
+            str.append("ReferenceData@" + Integer.toHexString(referenceData.hashCode()) + " " + referenceData.getType()
+                + ":" + referenceData.getOid() + ":" + referenceData.getVersion());
+        } else if (data instanceof ObjectData) {
+            dumpObjectData(str, data, indent, complete);
+        } else if (data instanceof CollectionData) {
+            dumpCollectionData(str, data, indent, complete);
+        } else {
+            str.append("Unknown: " + data);
+        }
+    }
+
+    private void dumpCollectionData(final StringBuilder str, final Data data, final int indent,
+        final List<Data> complete) {
+        final CollectionData objectData = ((CollectionData) data);
+        str.append("CollectionData@" + Integer.toHexString(objectData.hashCode()) + " " + objectData.getType() + ":"
+            + objectData.getOid() + ":" + (objectData.hasAllElements() ? "A" : "-") + ":" + objectData.getVersion());
+        final Object[] elements = objectData.getElements();
+        for (int i = 0; elements != null && i < elements.length; i++) {
+            str.append("\n");
+            str.append(padding(indent));
+            str.append(i + 1);
+            str.append(") ");
+            dump(str, (Data) elements[i], indent + 1, complete);
+        }
+    }
+
+    private void dumpObjectData(final StringBuilder str, final Data data, final int indent, final List<Data> complete) {
+        final ObjectData objectData = ((ObjectData) data);
+        str.append("ObjectData@" + Integer.toHexString(objectData.hashCode()) + " " + objectData.getType() + ":"
+            + objectData.getOid() + ":" + (objectData.hasCompleteData() ? "C" : "-") + ":" + objectData.getVersion());
+
+        if (complete.contains(objectData)) {
+            str.append(" (already detailed)");
+            return;
+        }
+
+        complete.add(objectData);
+        final ObjectSpecification spec = IsisContext.getSpecificationLoader().loadSpecification(data.getType());
+        final ObjectAssociation[] fs = encoder.getFieldOrder(spec);
+        final Object[] fields = objectData.getFieldContent();
+        for (int i = 0; fields != null && i < fields.length; i++) {
+            str.append("\n");
+            str.append(padding(indent));
+            str.append(i + 1);
+            str.append(") ");
+            str.append(fs[i].getId());
+            str.append(": ");
+            dump(str, (Data) fields[i], indent + 1, complete);
+        }
+    }
+
+    private String indentedNewLine() {
+        return "\n" + padding(2);
+    }
+
+    private String padding(final int indent) {
+        final int length = indent * 3;
+        while (length > PADDING.length()) {
+            PADDING += PADDING;
+        }
+        return PADDING.substring(0, length);
+    }
+
+}

Modified: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/impl/ServerFacadeImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/impl/ServerFacadeImpl.java?rev=1031974&r1=1031973&r2=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/impl/ServerFacadeImpl.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/facade/impl/ServerFacadeImpl.java Sat Nov  6 08:46:35 2010
@@ -93,7 +93,7 @@ import org.apache.isis.remoting.exchange
 import org.apache.isis.remoting.exchange.SetValueRequest;
 import org.apache.isis.remoting.exchange.SetValueResponse;
 import org.apache.isis.remoting.facade.ServerFacade;
-import org.apache.isis.remoting.protocol.encoding.internal.ObjectEncoderDecoder;
+import org.apache.isis.remoting.protocol.ObjectEncoderDecoder;
 import org.apache.isis.runtime.authentication.AuthenticationManager;
 import org.apache.isis.runtime.authentication.AuthenticationRequestPassword;
 import org.apache.isis.runtime.context.IsisContext;

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ClientMarshaller.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ClientMarshaller.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ClientMarshaller.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ClientMarshaller.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ClientMarshaller.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ClientMarshaller.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ClientMarshaller.java Sat Nov  6 08:46:35 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.remoting.protocol;
+package org.apache.isis.remoting.marshalling;
 
 import java.io.IOException;
 

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/Marshaller.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/Marshaller.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/Marshaller.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/Marshaller.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/Marshaller.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/Marshaller.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/Marshaller.java Sat Nov  6 08:46:35 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.remoting.protocol;
+package org.apache.isis.remoting.marshalling;
 
 import org.apache.isis.commons.components.ApplicationScopedComponent;
 

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallerAbstract.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/MarshallerAbstract.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallerAbstract.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallerAbstract.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/MarshallerAbstract.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/MarshallerAbstract.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallerAbstract.java Sat Nov  6 08:46:35 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.remoting.protocol;
+package org.apache.isis.remoting.marshalling;
 
 import java.io.IOException;
 
@@ -49,7 +49,7 @@ public abstract class MarshallerAbstract
 
     public void init() {
     	transport.init();
-        keepAlive = getConfiguration().getBoolean(ProtocolConstants.KEEPALIVE_KEY, ProtocolConstants.KEEPALIVE_DEFAULT);
+        keepAlive = getConfiguration().getBoolean(MarshallingConstants.KEEPALIVE_KEY, MarshallingConstants.KEEPALIVE_DEFAULT);
         if (LOG.isInfoEnabled()) {
         	LOG.info("keepAlive=" + keepAlive);
         }

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingConstants.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/EncodingProtocolConstants.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingConstants.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingConstants.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/EncodingProtocolConstants.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/EncodingProtocolConstants.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingConstants.java Sat Nov  6 08:46:35 2010
@@ -17,16 +17,23 @@
  *  under the License.
  */
 
+package org.apache.isis.remoting.marshalling;
 
-package org.apache.isis.remoting.protocol.encoding;
-
-import org.apache.isis.metamodel.config.ConfigurationConstants;
-
-public final class EncodingProtocolConstants {
-	
-	public static final String ENCODER_CLASS_NAME_LIST_DEPRECATED = ConfigurationConstants.ROOT + "criteria.encoders";
-	public static final String ENCODER_CLASS_NAME_LIST = ConfigurationConstants.ROOT + "persistence-query.encoders";
-
-	private EncodingProtocolConstants() {}
-
-}
+import org.apache.isis.metamodel.config.ConfigurationConstants;
+import org.apache.isis.remoting.protocol.ProtocolConstants;
+import org.apache.isis.remoting.protocol.ProtocolInstaller;
+
+public final class MarshallingConstants {
+
+    public static final String ROOT = ConfigurationConstants.ROOT + ProtocolInstaller.TYPE + ".";
+
+    public static final String KEEPALIVE_KEY = MarshallingConstants.ROOT + "keepalive";
+    public static final boolean KEEPALIVE_DEFAULT = false;
+
+    public static final String DEBUGGING_KEY = ProtocolConstants.ROOT + "debugging";
+    public static final boolean DEBUGGING_DEFAULT = false;
+
+    private MarshallingConstants() {
+    }
+
+}

Added: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingInstaller.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingInstaller.java?rev=1031974&view=auto
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingInstaller.java (added)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/MarshallingInstaller.java Sat Nov  6 08:46:35 2010
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.remoting.marshalling;
+
+import org.apache.isis.commons.components.Installer;
+
+/**
+ * TODO: not yet in use, but holds the {@link #TYPE} constant.
+ */
+public interface MarshallingInstaller extends Installer {
+
+    public static String TYPE = "marshalling";
+}

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ServerMarshaller.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ServerMarshaller.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ServerMarshaller.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ServerMarshaller.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ServerMarshaller.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ServerMarshaller.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/marshalling/ServerMarshaller.java Sat Nov  6 08:46:35 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.remoting.protocol;
+package org.apache.isis.remoting.marshalling;
 
 import java.io.IOException;
 

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ObjectEncoderDecoder.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectEncoderDecoder.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ObjectEncoderDecoder.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ObjectEncoderDecoder.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectEncoderDecoder.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectEncoderDecoder.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ObjectEncoderDecoder.java Sat Nov  6 08:46:35 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.isis.remoting.protocol.encoding.internal;
+package org.apache.isis.remoting.protocol;
 
 import org.apache.isis.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.metamodel.adapter.version.Version;

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/PersistenceQueryEncoder.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/PersistenceQueryEncoder.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/PersistenceQueryEncoder.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/PersistenceQueryEncoder.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/PersistenceQueryEncoder.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/PersistenceQueryEncoder.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/PersistenceQueryEncoder.java Sat Nov  6 08:46:35 2010
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
-package org.apache.isis.remoting.protocol.encoding.internal;
+package org.apache.isis.remoting.protocol;
 
 import org.apache.isis.metamodel.config.IsisConfiguration;
 import org.apache.isis.remoting.data.query.PersistenceQueryData;
-import org.apache.isis.remoting.protocol.encoding.EncodingProtocolConstants;
 import org.apache.isis.runtime.persistence.query.PersistenceQuery;
 
 /**
@@ -31,16 +29,14 @@ import org.apache.isis.runtime.persisten
 public interface PersistenceQueryEncoder {
 
     Class<?> getPersistenceQueryClass();
-    
+
     /**
-     * Injected directly after instantiation (note that encoders can potentially be loaded
-     * reflectively, from the {@link IsisConfiguration configuration} using the
-     * {@value EncodingProtocolConstants#ENCODER_CLASS_NAME_LIST} key.
+     * Injected directly after instantiation (note that encoders can potentially be loaded reflectively, from the
+     * {@link IsisConfiguration configuration} using the {@value ProtocolConstants#ENCODER_CLASS_NAME_LIST} key.
      */
     void setObjectEncoder(ObjectEncoderDecoder objectEncoder);
-    
+
     PersistenceQueryData encode(PersistenceQuery persistenceQuery);
 
     PersistenceQuery decode(PersistenceQueryData persistenceQueryData);
 }
-

Modified: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ProtocolConstants.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ProtocolConstants.java?rev=1031974&r1=1031973&r2=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ProtocolConstants.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/ProtocolConstants.java Sat Nov  6 08:46:35 2010
@@ -25,15 +25,10 @@ import org.apache.isis.metamodel.config.
 
 public final class ProtocolConstants {
 
-	private static final String ROOT = 
-		ConfigurationConstants.ROOT + ProtocolInstaller.TYPE + ".";
-	
-	public static final String KEEPALIVE_KEY = ROOT + "keepalive";
-	public static final boolean KEEPALIVE_DEFAULT = false;
-	
-	public static final String DEBUGGING_KEY = ROOT + "debugging";
-	public static final boolean DEBUGGING_DEFAULT = false;
-
+	public static final String ROOT = 
+		ConfigurationConstants.ROOT + ProtocolInstaller.TYPE + ".";
+    public static final String ENCODER_CLASS_NAME_LIST = ConfigurationConstants.ROOT + "persistence-query.encoders";
+    public static final String ENCODER_CLASS_NAME_LIST_DEPRECATED = ConfigurationConstants.ROOT + "criteria.encoders";
 	
 	private ProtocolConstants() {}
 

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/FieldOrderCache.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/FieldOrderCache.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/FieldOrderCache.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/FieldOrderCache.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/FieldOrderCache.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/FieldOrderCache.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/FieldOrderCache.java Sat Nov  6 08:46:35 2010
@@ -18,13 +18,13 @@
  */
 
 
-package org.apache.isis.remoting.protocol.encoding.internal;
+package org.apache.isis.remoting.protocol.internal;
 
-import java.util.Hashtable;
-import java.util.Vector;
-
-import org.apache.isis.metamodel.spec.ObjectSpecification;
-import org.apache.isis.metamodel.spec.feature.ObjectAssociation;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import org.apache.isis.metamodel.spec.ObjectSpecification;
+import org.apache.isis.metamodel.spec.feature.ObjectAssociation;
 
 /**
  * Caches a sorted version of the fields for a specified ObjectSpecification. This is used to counteract

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectDeserializer.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectDeserializer.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectDeserializer.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectDeserializer.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectDeserializer.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectDeserializer.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectDeserializer.java Sat Nov  6 08:46:35 2010
@@ -18,11 +18,10 @@
  */
 
 
-package org.apache.isis.remoting.protocol.encoding.internal;
+package org.apache.isis.remoting.protocol.internal;
 
 import java.util.Enumeration;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.commons.exceptions.UnknownTypeException;
 import org.apache.isis.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.metamodel.adapter.ResolveState;
@@ -53,6 +52,7 @@ import org.apache.isis.runtime.persisten
 import org.apache.isis.runtime.persistence.adaptermanager.AdapterManager;
 import org.apache.isis.runtime.persistence.objectstore.PersistenceSessionObjectStore;
 import org.apache.isis.runtime.transaction.updatenotifier.UpdateNotifier;
+import org.apache.log4j.Logger;
 
 public class ObjectDeserializer {
     

Copied: incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectEncoderDecoderDefault.java (from r1031826, incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectEncoderDecoderDefault.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectEncoderDecoderDefault.java?p2=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectEncoderDecoderDefault.java&p1=incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectEncoderDecoderDefault.java&r1=1031826&r2=1031974&rev=1031974&view=diff
==============================================================================
--- incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/encoding/internal/ObjectEncoderDecoderDefault.java (original)
+++ incubator/isis/trunk/alternatives/remoting/common/src/main/java/org/apache/isis/remoting/protocol/internal/ObjectEncoderDecoderDefault.java Sat Nov  6 08:46:35 2010
@@ -17,14 +17,12 @@
  *  under the License.
  */
 
-
-package org.apache.isis.remoting.protocol.encoding.internal;
+package org.apache.isis.remoting.protocol.internal;
 
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.commons.ensure.Assert;
 import org.apache.isis.commons.exceptions.UnknownTypeException;
 import org.apache.isis.commons.factory.InstanceFactory;
@@ -67,105 +65,108 @@ import org.apache.isis.remoting.exchange
 import org.apache.isis.remoting.exchange.SetAssociationRequest;
 import org.apache.isis.remoting.exchange.SetValueRequest;
 import org.apache.isis.remoting.facade.impl.ServerFacadeImpl;
-import org.apache.isis.remoting.protocol.encoding.EncodingProtocolConstants;
+import org.apache.isis.remoting.protocol.ObjectEncoderDecoder;
+import org.apache.isis.remoting.protocol.PersistenceQueryEncoder;
+import org.apache.isis.remoting.protocol.ProtocolConstants;
 import org.apache.isis.runtime.context.IsisContext;
 import org.apache.isis.runtime.persistence.PersistorUtil;
 import org.apache.isis.runtime.persistence.query.PersistenceQuery;
+import org.apache.log4j.Logger;
 
 public class ObjectEncoderDecoderDefault implements ObjectEncoderDecoder {
-	
-	private final static Logger LOG = Logger.getLogger(ObjectEncoderDecoderDefault.class);
-	
-	public static final int DEFAULT_CLIENT_SIDE_ADD_OBJECT_GRAPH_DEPTH = 1;
-	public static final int DEFAULT_CLIENT_SIDE_UPDATE_OBJECT_GRAPH_DEPTH = 1;
-	public static final int DEFAULT_CLIENT_SIDE_ACTION_TARGET_GRAPH_DEPTH = 0;
-	public static final int DEFAULT_CLIENT_SIDE_ACTION_PARAMETER_GRAPH_DEPTH = 0;
-	
-	public static final int DEFAULT_SERVER_SIDE_RETRIEVED_OBJECT_GRAPH_DEPTH = 100;
-	public static final int DEFAULT_SERVER_SIDE_TOUCHED_OBJECT_GRAPH_DEPTH = 1;
+
+    private final static Logger LOG = Logger.getLogger(ObjectEncoderDecoderDefault.class);
+
+    public static final int DEFAULT_CLIENT_SIDE_ADD_OBJECT_GRAPH_DEPTH = 1;
+    public static final int DEFAULT_CLIENT_SIDE_UPDATE_OBJECT_GRAPH_DEPTH = 1;
+    public static final int DEFAULT_CLIENT_SIDE_ACTION_TARGET_GRAPH_DEPTH = 0;
+    public static final int DEFAULT_CLIENT_SIDE_ACTION_PARAMETER_GRAPH_DEPTH = 0;
+
+    public static final int DEFAULT_SERVER_SIDE_RETRIEVED_OBJECT_GRAPH_DEPTH = 100;
+    public static final int DEFAULT_SERVER_SIDE_TOUCHED_OBJECT_GRAPH_DEPTH = 1;
 
     private final ObjectSerializer serializer;
     private final ObjectDeserializer deserializer;
     private final FieldOrderCache fieldOrderCache;
     private final DataFactory dataFactory;
-    
-    private final Map<Class<?>, PersistenceQueryEncoder> persistenceEncoderByClass = new HashMap<Class<?>, PersistenceQueryEncoder>();
-    
-    private int clientSideAddGraphDepth = DEFAULT_CLIENT_SIDE_ADD_OBJECT_GRAPH_DEPTH;
-    private int clientSideUpdateGraphDepth = DEFAULT_CLIENT_SIDE_UPDATE_OBJECT_GRAPH_DEPTH;
-    private int clientSideActionTargetRemotelyGraphDepth = DEFAULT_CLIENT_SIDE_ACTION_TARGET_GRAPH_DEPTH;
-    private int clientSideActionParameterGraphDepth = DEFAULT_CLIENT_SIDE_ACTION_PARAMETER_GRAPH_DEPTH;
-    
-    private int serverSideTouchedObjectGraphDepth = DEFAULT_SERVER_SIDE_TOUCHED_OBJECT_GRAPH_DEPTH;
-    private int serverSideRetrievedObjectGraphDepth = DEFAULT_SERVER_SIDE_RETRIEVED_OBJECT_GRAPH_DEPTH;
 
+    private final Map<Class<?>, PersistenceQueryEncoder> persistenceEncoderByClass =
+        new HashMap<Class<?>, PersistenceQueryEncoder>();
+
+    private final int clientSideAddGraphDepth = DEFAULT_CLIENT_SIDE_ADD_OBJECT_GRAPH_DEPTH;
+    private final int clientSideUpdateGraphDepth = DEFAULT_CLIENT_SIDE_UPDATE_OBJECT_GRAPH_DEPTH;
+    private final int clientSideActionTargetRemotelyGraphDepth = DEFAULT_CLIENT_SIDE_ACTION_TARGET_GRAPH_DEPTH;
+    private final int clientSideActionParameterGraphDepth = DEFAULT_CLIENT_SIDE_ACTION_PARAMETER_GRAPH_DEPTH;
+
+    private final int serverSideTouchedObjectGraphDepth = DEFAULT_SERVER_SIDE_TOUCHED_OBJECT_GRAPH_DEPTH;
+    private final int serverSideRetrievedObjectGraphDepth = DEFAULT_SERVER_SIDE_RETRIEVED_OBJECT_GRAPH_DEPTH;
 
     /**
      * Factory method.
      */
-	public static ObjectEncoderDecoderDefault create(final IsisConfiguration configuration) {
-		
-		ObjectEncoderDecoderDefault encoderDecoder = new ObjectEncoderDecoderDefault();
-		addPersistenceEncoders(configuration, encoderDecoder, EncodingProtocolConstants.ENCODER_CLASS_NAME_LIST);
-		addPersistenceEncoders(configuration, encoderDecoder, EncodingProtocolConstants.ENCODER_CLASS_NAME_LIST_DEPRECATED);
-		return encoderDecoder;
-	}
-	
-	private static void addPersistenceEncoders(
-			final IsisConfiguration configuration,
-			final ObjectEncoderDecoderDefault encoder, String encoderClassNameList) {
-		String[] encoders = configuration.getList(encoderClassNameList);
-	    for (int i = 0; i < encoders.length; i++) {
-	        final PersistenceQueryEncoder encoding = InstanceFactory.createInstance(encoders[i], PersistenceQueryEncoder.class);
-	        encoder.addPersistenceQueryEncoder(encoding);
-	    }
-	}
-
-	/**
-	 * Package-level visibility (for tests to use only)
-	 */
-    public ObjectEncoderDecoderDefault(){
-    	this.fieldOrderCache = new FieldOrderCache();
-    	this.dataFactory = new DataFactoryDefault();
+    public static ObjectEncoderDecoderDefault create(final IsisConfiguration configuration) {
+
+        ObjectEncoderDecoderDefault encoderDecoder = new ObjectEncoderDecoderDefault();
+        addPersistenceEncoders(configuration, encoderDecoder, ProtocolConstants.ENCODER_CLASS_NAME_LIST);
+        addPersistenceEncoders(configuration, encoderDecoder,
+            ProtocolConstants.ENCODER_CLASS_NAME_LIST_DEPRECATED);
+        return encoderDecoder;
+    }
+
+    private static void addPersistenceEncoders(final IsisConfiguration configuration,
+        final ObjectEncoderDecoderDefault encoder, String encoderClassNameList) {
+        String[] encoders = configuration.getList(encoderClassNameList);
+        for (int i = 0; i < encoders.length; i++) {
+            final PersistenceQueryEncoder encoding =
+                InstanceFactory.createInstance(encoders[i], PersistenceQueryEncoder.class);
+            encoder.addPersistenceQueryEncoder(encoding);
+        }
+    }
+
+    /**
+     * Package-level visibility (for tests to use only)
+     */
+    public ObjectEncoderDecoderDefault() {
+        this.fieldOrderCache = new FieldOrderCache();
+        this.dataFactory = new DataFactoryDefault();
         this.serializer = new ObjectSerializer(dataFactory, fieldOrderCache);
         this.deserializer = new ObjectDeserializer(fieldOrderCache);
 
-        
         addPersistenceQueryEncoder(new PersistenceQueryFindAllInstancesEncoder());
         addPersistenceQueryEncoder(new PersistenceQueryFindByTitleEncoder());
         addPersistenceQueryEncoder(new PersistenceQueryFindByPatternEncoder());
         addPersistenceQueryEncoder(new PersistenceQueryFindUsingApplibQueryDefaultEncoder());
         addPersistenceQueryEncoder(new PersistenceQueryFindUsingApplibQuerySerializableEncoder());
-        
+
         // TODO: look up overrides of depths from Configuration.
     }
-    
+
     public void addPersistenceQueryEncoder(final PersistenceQueryEncoder encoder) {
-    	encoder.setObjectEncoder(this);
+        encoder.setObjectEncoder(this);
         persistenceEncoderByClass.put(encoder.getPersistenceQueryClass(), encoder);
     }
 
-    
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
     // called both client- and server-side only
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
 
     /**
-     * Creates a ReferenceData that contains the type, version and OID for the specified object. This can only
-     * be used for persistent objects.
+     * Creates a ReferenceData that contains the type, version and OID for the specified object. This can only be used
+     * for persistent objects.
      * 
      * <p>
-     * Called both client and server-side, in multiple locations. 
+     * Called both client and server-side, in multiple locations.
      */
+    @Override
     public final IdentityData encodeIdentityData(final ObjectAdapter object) {
         Assert.assertNotNull("OID needed for reference", object, object.getOid());
-        return dataFactory.createIdentityData(object.getSpecification().getFullName(), object.getOid(), object.getVersion());
+        return dataFactory.createIdentityData(object.getSpecification().getFullName(), object.getOid(),
+            object.getVersion());
     }
 
-
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
     // client-side encoding
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
 
     /**
      * Called client-side only:
@@ -173,6 +174,7 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link ClientSideTransactionManager#endTransaction()}
      * </ul>
      */
+    @Override
     public ObjectData encodeMakePersistentGraph(final ObjectAdapter adapter, final KnownObjectsRequest knownObjects) {
         Assert.assertTrue("transient", adapter.isTransient());
         return (ObjectData) encode(adapter, clientSideAddGraphDepth, knownObjects);
@@ -184,6 +186,7 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link ClientSideTransactionManager#endTransaction()}
      * </ul>
      */
+    @Override
     public ObjectData encodeGraphForChangedObject(final ObjectAdapter object, final KnownObjectsRequest knownObjects) {
         return (ObjectData) encode(object, clientSideUpdateGraphDepth, knownObjects);
     }
@@ -194,6 +197,7 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link PropertySetterFacetWrapProxy#setProperty(ObjectAdapter, ObjectAdapter)}
      * </ul>
      */
+    @Override
     public EncodableObjectData encodeAsValue(final ObjectAdapter value) {
         return serializer.serializeEncodeable(value);
     }
@@ -201,9 +205,10 @@ public class ObjectEncoderDecoderDefault
     /**
      * Called client-side only:
      * <ul>
-     * <li> by {@link ActionInvocationFacetWrapProxy#invoke(ObjectAdapter, ObjectAdapter[])} (calling remotely)
+     * <li>by {@link ActionInvocationFacetWrapProxy#invoke(ObjectAdapter, ObjectAdapter[])} (calling remotely)
      * </ul>
      */
+    @Override
     public ReferenceData encodeActionTarget(final ObjectAdapter target, final KnownObjectsRequest knownObjects) {
         return serializer.serializeAdapter(target, clientSideActionTargetRemotelyGraphDepth, knownObjects);
     }
@@ -216,10 +221,9 @@ public class ObjectEncoderDecoderDefault
      * <li>by hibernate's equivalent encoder
      * </ul>
      */
-    public final Data[] encodeActionParameters(
-            final ObjectSpecification[] parameterTypes,
-            final ObjectAdapter[] parameters,
-            final KnownObjectsRequest knownObjects) {
+    @Override
+    public final Data[] encodeActionParameters(final ObjectSpecification[] parameterTypes,
+        final ObjectAdapter[] parameters, final KnownObjectsRequest knownObjects) {
         final Data parameterData[] = new Data[parameters.length];
         for (int i = 0; i < parameters.length; i++) {
             final ObjectAdapter parameter = parameters[i];
@@ -235,15 +239,15 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link PersistenceSessionProxy#findInstances(PersistenceQuery)}
      * </ul>
      */
+    @Override
     public PersistenceQueryData encodePersistenceQuery(final PersistenceQuery criteria) {
         final PersistenceQueryEncoder strategy = findPersistenceQueryEncoder(criteria.getClass());
         return strategy.encode(criteria);
     }
 
-    
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
     // client-side decoding
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
 
     /**
      * Called client-side only:
@@ -251,6 +255,7 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link ActionInvocationFacetWrapProxy#invoke(ObjectAdapter, ObjectAdapter[])}
      * </ul>
      */
+    @Override
     public void madePersistent(final ObjectAdapter target, final ObjectData persistedTarget) {
         deserializer.madePersistent(target, persistedTarget);
     }
@@ -258,31 +263,32 @@ public class ObjectEncoderDecoderDefault
     /**
      * Called client-side only, in multiple locations.
      */
+    @Override
     public ObjectAdapter decode(final Data data) {
         return deserializer.deserialize(data);
     }
 
+    @Override
     public void decode(final ObjectData[] dataArray) {
         for (int i = 0; i < dataArray.length; i++) {
-			if (LOG.isDebugEnabled()) {
-				LOG.debug("update " + dataArray[i].getOid());
-			}
-		    this.decode(dataArray[i]);
-		}
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("update " + dataArray[i].getOid());
+            }
+            this.decode(dataArray[i]);
+        }
     }
 
-
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
     // server-side decoding
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
 
     /**
      * Called server-side only:
      * <ul>
      * <li>by {@link ServerFacadeImpl#executeClientAction(ExecuteClientActionRequest)}
-     * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)
-     * </ul>
+     * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest) </ul>
      */
+    @Override
     public ObjectAdapter decode(final Data data, final KnownObjectsRequest knownObjects) {
         return deserializer.deserialize(data, knownObjects);
     }
@@ -290,9 +296,9 @@ public class ObjectEncoderDecoderDefault
     /**
      * Called server-side only:
      * <ul>
-     * <li>by {@link ServerFacadeImpl#findInstances(FindInstancesRequest)
-     * </ul>
+     * <li>by {@link ServerFacadeImpl#findInstances(FindInstancesRequest) </ul>
      */
+    @Override
     public PersistenceQuery decodePersistenceQuery(final PersistenceQueryData persistenceQueryData) {
         final Class<?> criteriaClass = persistenceQueryData.getPersistenceQueryClass();
         final PersistenceQueryEncoder encoderDecoder = findPersistenceQueryEncoder(criteriaClass);
@@ -307,26 +313,25 @@ public class ObjectEncoderDecoderDefault
         return encoder;
     }
 
-
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
     // server-side encoding
-    ///////////////////////////////////////////////////////////
+    // /////////////////////////////////////////////////////////
 
-	public AuthorizationResponse encodeAuthorizeResponse(boolean authorized) {
-		return new AuthorizationResponse(authorized);
-	}
+    @Override
+    public AuthorizationResponse encodeAuthorizeResponse(boolean authorized) {
+        return new AuthorizationResponse(authorized);
+    }
 
     /**
      * Called server-side only:
      * <ul>
-     * <li> by {@link ServerFacadeImpl#executeClientAction(ExecuteClientActionRequest)}
+     * <li>by {@link ServerFacadeImpl#executeClientAction(ExecuteClientActionRequest)}
      * </ul>
      */
-    public ExecuteClientActionResponse encodeClientActionResult(
-            final ReferenceData[] madePersistent,
-            final Version[] changedVersion,
-            final ObjectData[] updates) {
-    	return new ExecuteClientActionResponse(madePersistent, changedVersion, updates);
+    @Override
+    public ExecuteClientActionResponse encodeClientActionResult(final ReferenceData[] madePersistent,
+        final Version[] changedVersion, final ObjectData[] updates) {
+        return new ExecuteClientActionResponse(madePersistent, changedVersion, updates);
     }
 
     /**
@@ -335,11 +340,12 @@ public class ObjectEncoderDecoderDefault
      * <p>
      * Called server-side only, in several locations:
      * <ul>
-     * <li> by {@link ServerFacadeImpl#findInstances(FindInstancesRequest)}
-     * <li> by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)}
-     * <li> by {@link ServerFacadeImpl#resolveImmediately(ResolveObjectRequest)}
+     * <li>by {@link ServerFacadeImpl#findInstances(FindInstancesRequest)}
+     * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)}
+     * <li>by {@link ServerFacadeImpl#resolveImmediately(ResolveObjectRequest)}
      * </ul>
      */
+    @Override
     public final ObjectData encodeCompletePersistentGraph(final ObjectAdapter object) {
         return encode(object, serverSideRetrievedObjectGraphDepth);
     }
@@ -351,14 +357,14 @@ public class ObjectEncoderDecoderDefault
      * Called server-side only:
      * <ul>
      * <li>by {@link ServerFacadeImpl#getObject(GetObjectRequest)}
-     * <li>by {@link ServerFacadeImpl#clearAssociation(ClearAssociationRequest)
-     * <li>by {@link ServerFacadeImpl#clearValue(ClearValueRequest)
-     * <li>by {@link ServerFacadeImpl#executeClientAction(ExecuteClientActionRequest)
-     * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)
-     * <li>by {@link ServerFacadeImpl#setAssociation(SetAssociationRequest)
-     * <li>by {@link ServerFacadeImpl#setValue(SetValueRequest)
-     * </ul>
+     * <li>by {@link ServerFacadeImpl#clearAssociation(ClearAssociationRequest) <li><li> by
+     * {@link ServerFacadeImpl#clearValue(ClearValueRequest) <li><li> by
+     * {@link ServerFacadeImpl#executeClientAction(ExecuteClientActionRequest) <li><li> by
+     * {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest) <li><li> by
+     * {@link ServerFacadeImpl#setAssociation(SetAssociationRequest) <li><li> by
+     * {@link ServerFacadeImpl#setValue(SetValueRequest) </ul>
      */
+    @Override
     public ObjectData encodeForUpdate(final ObjectAdapter object) {
         final ResolveState resolveState = object.getResolveState();
         if (resolveState.isSerializing() || resolveState.isGhost()) {
@@ -373,6 +379,7 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link ServerFacadeImpl#resolveField(ResolveFieldRequest)}
      * </ul>
      */
+    @Override
     public Data encodeForResolveField(final ObjectAdapter adapter, final String fieldName) {
         final Oid oid = adapter.getOid();
         final ObjectSpecification specification = adapter.getSpecification();
@@ -393,10 +400,12 @@ public class ObjectEncoderDecoderDefault
                 } else if (fields[i].getSpecification().isEncodeable()) {
                     fieldContent[i] = serializer.serializeEncodeable(field);
                 } else if (fields[i].isOneToManyAssociation()) {
-                    fieldContent[i] = serializer.serializeCollection(field, serverSideRetrievedObjectGraphDepth, knownObjects);
+                    fieldContent[i] =
+                        serializer.serializeCollection(field, serverSideRetrievedObjectGraphDepth, knownObjects);
                 } else {
                     IsisContext.getPersistenceSession().resolveImmediately(field);
-                    fieldContent[i] = serializer.serializeAdapter(field, serverSideRetrievedObjectGraphDepth, knownObjects);
+                    fieldContent[i] =
+                        serializer.serializeAdapter(field, serverSideRetrievedObjectGraphDepth, knownObjects);
                 }
                 break;
             }
@@ -407,7 +416,8 @@ public class ObjectEncoderDecoderDefault
         // resolving (is not a ghost) yet it has no version number
         // return createObjectData(oid, type, fieldContent, resolveState.isResolved(),
         // !resolveState.isGhost(), object.getVersion());
-        final ObjectData data = dataFactory.createObjectData(type, oid, resolveState.isResolved(), adapter.getVersion());
+        final ObjectData data =
+            dataFactory.createObjectData(type, oid, resolveState.isResolved(), adapter.getVersion());
         data.setFieldContent(fieldContent);
         return data;
         // return createObjectData(oid, type, fieldContent, resolveState.isResolved(), object.getVersion());
@@ -419,6 +429,7 @@ public class ObjectEncoderDecoderDefault
      * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)}
      * </ul>
      */
+    @Override
     public ObjectData encodeMadePersistentGraph(final ObjectData data, final ObjectAdapter object) {
         final Oid objectsOid = object.getOid();
         Assert.assertNotNull(objectsOid);
@@ -445,7 +456,8 @@ public class ObjectEncoderDecoderDefault
                         }
                     } else if (fields[i].isOneToManyAssociation()) {
                         final ObjectAdapter fieldReference = fields[i].get(object);
-                        persistentContents[i] = createMadePersistentCollection((CollectionData) fieldData, fieldReference);
+                        persistentContents[i] =
+                            createMadePersistentCollection((CollectionData) fieldData, fieldReference);
                     }
                 }
                 persistedData.setFieldContent(persistentContents);
@@ -470,52 +482,49 @@ public class ObjectEncoderDecoderDefault
         return collectionData;
     }
 
-
     /**
      * Called server-side only:
      * <ul>
      * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)}
      * </ul>
      */
-    public ExecuteServerActionResponse encodeServerActionResult(
-            final ObjectAdapter result,
-            final ObjectData[] updatesData,
-            final ReferenceData[] disposedData,
-            final ObjectData persistedTargetData,
-            final ObjectData[] persistedParametersData,
-            final String[] messages,
-            final String[] warnings) {
+    @Override
+    public ExecuteServerActionResponse encodeServerActionResult(final ObjectAdapter result,
+        final ObjectData[] updatesData, final ReferenceData[] disposedData, final ObjectData persistedTargetData,
+        final ObjectData[] persistedParametersData, final String[] messages, final String[] warnings) {
         Data resultData;
         if (result == null) {
             resultData = dataFactory.createNullData("");
         } else if (result.getSpecification().isCollection()) {
-            resultData = serializer.serializeCollection(result, serverSideRetrievedObjectGraphDepth, new KnownObjectsRequest());
+            resultData =
+                serializer.serializeCollection(result, serverSideRetrievedObjectGraphDepth, new KnownObjectsRequest());
         } else if (result.getSpecification().isNotCollection()) {
             resultData = encodeCompletePersistentGraph(result);
         } else {
             throw new UnknownTypeException(result);
         }
 
-        return new ExecuteServerActionResponse(resultData, updatesData, disposedData, persistedTargetData, persistedParametersData, messages, warnings);
+        return new ExecuteServerActionResponse(resultData, updatesData, disposedData, persistedTargetData,
+            persistedParametersData, messages, warnings);
     }
 
     /**
      * Called server-side only:
      * <ul>
      * <li>by {@link ServerFacadeImpl#resolveField(ResolveFieldRequest)}
-     * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest)
-     * </ul>
+     * <li>by {@link ServerFacadeImpl#executeServerAction(ExecuteServerActionRequest) </ul>
      */
+    @Override
     public ObjectAssociation[] getFieldOrder(final ObjectSpecification specification) {
         return fieldOrderCache.getFields(specification);
     }
 
-
-    /////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////
     // Helpers
-    /////////////////////////////////////////////////////////////////
+    // ///////////////////////////////////////////////////////////////
 
-    private final Data createParameter(final String type, final ObjectAdapter adapter, final KnownObjectsRequest knownObjects) {
+    private final Data createParameter(final String type, final ObjectAdapter adapter,
+        final KnownObjectsRequest knownObjects) {
         if (adapter == null) {
             return dataFactory.createNullData(type);
         }
@@ -523,22 +532,20 @@ public class ObjectEncoderDecoderDefault
         if (!adapter.getSpecification().isNotCollection()) {
             throw new UnknownTypeException(adapter.getSpecification());
         }
-        
+
         if (adapter.getSpecification().isEncodeable()) {
-		    return serializer.serializeEncodeable(adapter);
-		} else {
-			return encode(adapter, clientSideActionParameterGraphDepth, knownObjects);
-		}
+            return serializer.serializeEncodeable(adapter);
+        } else {
+            return encode(adapter, clientSideActionParameterGraphDepth, knownObjects);
+        }
     }
 
     private ObjectData encode(final ObjectAdapter adapter, int depth) {
-    	return (ObjectData) encode(adapter, depth, new KnownObjectsRequest());
+        return (ObjectData) encode(adapter, depth, new KnownObjectsRequest());
     }
-    
-	private ReferenceData encode(final ObjectAdapter adapter,
-			int depth, final KnownObjectsRequest knownObjects) {
-		return serializer.serializeAdapter(adapter, depth, knownObjects);
-	}
 
-}
+    private ReferenceData encode(final ObjectAdapter adapter, int depth, final KnownObjectsRequest knownObjects) {
+        return serializer.serializeAdapter(adapter, depth, knownObjects);
+    }
 
+}



Mime
View raw message