cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmen...@apache.org
Subject svn commit: r441230 [9/10] - in /incubator/cayenne/soc/trunk/cayenne-ropwsdl: cayenne-axis-dist/ cayenne-axis-server/ cayenne-axis-server/.externalToolBuilders/ cayenne-axis-server/.settings/ cayenne-axis-server/ant/ cayenne-axis-server/ant/lib/ cayenn...
Date Thu, 07 Sep 2006 21:28:15 GMT
Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/ArcOperationSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/ArcOperationSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/ArcOperationSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/ArcOperationSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,74 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.ArcCreateOperation;
+import org.apache.cayenne.graph.NodeDiff;
+import org.w3c.dom.Element;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class ArcOperationSerializer extends NodeDiffSerializer {
+
+	@Override
+	protected void serializeChildren(QName name, Object value,
+			SerializationContext context) throws IOException {
+		super.serializeChildren(name, value, context);
+		ArcCreateOperation op = (ArcCreateOperation) value;
+		QName typeQName = context.getQNameForClass(op.getArcId().getClass());
+		context.serialize(new QName(name.getNamespaceURI(), "arc-id"), null, op
+				.getArcId(), typeQName, op.getArcId().getClass());
+
+		typeQName = context.getQNameForClass(op.getTargetNodeId().getClass());
+		context.serialize(new QName(name.getNamespaceURI(), "target-node-id"),
+				null, op.getTargetNodeId(), typeQName, op.getTargetNodeId()
+						.getClass());
+
+	}
+
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		extension.setAttribute("base", types.writeType(NodeDiff.class));
+		complexContent.appendChild(extension);
+		String sObject = types.writeType(Object.class);
+		Element seq = (Element) extension.appendChild(types
+				.createElement("sequence"));
+		seq.appendChild(types.createElement("arc-id", sObject, true,
+				false, extension.getOwnerDocument()));
+		seq.appendChild(types.createElement("target-node-id", sObject, true,
+				false, extension.getOwnerDocument()));
+		type.appendChild(complexContent);
+		return type;
+	}
+	
+	
+	
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,72 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.axis.encoding.Callback;
+import org.apache.axis.encoding.CallbackTarget;
+import org.apache.axis.encoding.Target;
+import org.apache.cayenne.graph.CompoundDiff;
+import org.apache.cayenne.graph.GraphDiff;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class CompoundDiffDeserializer extends GraphDiffDeserializer<CompoundDiff> {
+	
+	
+
+	@Override
+	protected Map<String, ? extends Target> assignChildTargets() {
+		Map<String, CallbackTarget> map = new HashMap<String, CallbackTarget>();
+
+		Callback callback = new Callback() {
+
+			public void setValue(Object value, Object hint) throws SAXException {
+				Object[] array = (Object[]) value;
+				for (int i = 0; i < array.length; i++) {
+					Object obj = array[i];
+					if ((obj.getClass().isArray()) && (((Object[]) obj).length > 0)) {
+						obj = ((Object[]) obj)[0];
+					}
+					getValue().add((GraphDiff) obj);
+				}
+				
+			}
+
+		};
+
+		map.put("list", new CallbackTarget(callback, null));
+
+		return map;
+	}
+
+	@Override
+	protected CompoundDiff createValue(String namespace, Attributes attributes) {
+		return new CompoundDiff(null);
+	}
+
+	
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/CompoundDiffSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,75 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.CompoundDiff;
+import org.apache.cayenne.graph.GraphDiff;
+import org.apache.cayenne.remote.axis.ser.common.ComplexTypeSerializer;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class CompoundDiffSerializer extends ComplexTypeSerializer {
+
+	@Override
+	protected Attributes fillAttributes(QName name, Attributes attributes,
+			Object value, SerializationContext context) throws IOException {
+		return attributes;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void serializeChildren(QName name, Object value,
+			SerializationContext context) throws IOException {
+		CompoundDiff diff = (CompoundDiff) value;
+		Object[] list = diff.getDiffs().toArray();
+		QName arrayQName = context.getQNameForClass(GraphDiff[].class);
+		context.serialize(new QName(name.getNamespaceURI(), "list"), null,
+				list, arrayQName, GraphDiff[].class);
+	}
+
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		extension.setAttribute("base", types.writeType(GraphDiff.class));
+		complexContent.appendChild(extension);
+		Element seq = (Element) extension.appendChild(types
+				.createElement("sequence"));
+		seq.appendChild(types.createElement("list", types
+				.writeType(GraphDiff[].class), true, false, type
+				.getOwnerDocument()));
+		
+		type.appendChild(complexContent);
+		return type;
+	}
+	
+	
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,45 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.util.Map;
+
+import org.apache.axis.encoding.Target;
+import org.apache.cayenne.graph.GraphDiff;
+import org.apache.cayenne.remote.axis.ser.common.ComplexTypeDeserializer;
+import org.xml.sax.Attributes;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class GraphDiffDeserializer<T extends GraphDiff> extends
+		ComplexTypeDeserializer<T> {
+
+	@Override
+	protected Map<String, ? extends Target> assignChildTargets() {
+		return null;
+	}
+
+	@Override
+	protected T createValue(String namespace, Attributes attributes) {
+		return null;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/GraphDiffSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,73 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.ArcCreateOperation;
+import org.apache.cayenne.graph.ArcDeleteOperation;
+import org.apache.cayenne.graph.CompoundDiff;
+import org.apache.cayenne.graph.NodeCreateOperation;
+import org.apache.cayenne.graph.NodeDeleteOperation;
+import org.apache.cayenne.graph.NodeDiff;
+import org.apache.cayenne.graph.NodeIdChangeOperation;
+import org.apache.cayenne.graph.NodePropertyChangeOperation;
+import org.apache.cayenne.remote.axis.ser.common.ComplexTypeSerializer;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class GraphDiffSerializer extends ComplexTypeSerializer {
+
+	@Override
+	protected Attributes fillAttributes(QName name, Attributes attributes,
+			Object value, SerializationContext context) throws IOException {
+		return attributes;
+	}
+
+	@Override
+	protected void serializeChildren(QName name, Object value,
+			SerializationContext context) throws IOException {
+	}
+
+	private final static Class[] CHILDREN = new Class[] { NodeDiff.class,
+			NodeCreateOperation.class, NodeDeleteOperation.class,
+			NodeCreateOperation.class, NodeIdChangeOperation.class,
+			NodePropertyChangeOperation.class, ArcCreateOperation.class,
+			ArcDeleteOperation.class, CompoundDiff.class
+
+	};
+
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		//Just printing out all nested class schemes
+		for (int i = 0; i < CHILDREN.length; i++) {
+			types.writeType(CHILDREN[i]);			
+		}
+		return super.writeSchema(javaType, types);
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,38 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.graph.NodeCreateOperation;
+import org.xml.sax.Attributes;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeCreateOperationDeserializer extends
+		NodeDiffDeserializer<NodeCreateOperation> {
+
+	@Override
+	protected NodeCreateOperation createValue(String namespace,
+			Attributes attributes) {
+		return new NodeCreateOperation(new ObjectId(""), diffId);
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeCreateOperationSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,41 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.NodeDiff;
+import org.w3c.dom.Element;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeCreateOperationSerializer extends NodeDiffSerializer {
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		extension.setAttribute("base", types.writeType(NodeDiff.class));
+		complexContent.appendChild(extension);
+		type.appendChild(complexContent);
+		return type;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,37 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.graph.NodeDeleteOperation;
+import org.xml.sax.Attributes;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeDeleteOperationDeserializer extends
+		NodeDiffDeserializer<NodeDeleteOperation> {
+	@Override
+	protected NodeDeleteOperation createValue(String namespace,
+			Attributes attributes) {
+		return new NodeDeleteOperation(new ObjectId(""), diffId);
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDeleteOperationSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,41 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.NodeDiff;
+import org.w3c.dom.Element;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeDeleteOperationSerializer extends NodeDiffSerializer {
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		extension.setAttribute("base", types.writeType(NodeDiff.class));
+		complexContent.appendChild(extension);
+		type.appendChild(complexContent);
+		return type;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,69 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.axis.encoding.Callback;
+import org.apache.axis.encoding.CallbackTarget;
+import org.apache.axis.encoding.DeserializationContext;
+import org.apache.axis.encoding.Target;
+import org.apache.cayenne.graph.NodeDiff;
+import org.apache.cayenne.remote.axis.ser.common.FieldAccessor;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeDiffDeserializer<T extends NodeDiff> extends
+		GraphDiffDeserializer<T> {
+	protected int diffId;
+
+	@Override
+	protected Map<String, ? extends Target> assignChildTargets() {
+		Map<String, CallbackTarget> map = new HashMap<String, CallbackTarget>();
+
+		Callback callback = new Callback() {
+
+			public void setValue(Object value, Object hint) throws SAXException {
+				// TODO Remove private field access
+				FieldAccessor.getInstance().setFieldValue(NodeDiff.class, "nodeId",
+						getValue(), value);
+			}
+
+		};
+
+		map.put("node-id", new CallbackTarget(callback, null));
+
+		return map;
+	}
+
+	
+	@Override
+	public void onStartElement(String namespace, String localName,
+			String prefix, Attributes attributes, DeserializationContext context)
+			throws SAXException {
+		diffId = Integer.valueOf(attributes.getValue(namespace, "diff-id"));
+		super.onStartElement(namespace, localName, prefix, attributes, context);
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeDiffSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,85 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.encoding.XMLType;
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.GraphDiff;
+import org.apache.cayenne.graph.NodeDiff;
+import org.apache.cayenne.remote.axis.ser.common.ComplexTypeSerializer;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeDiffSerializer extends ComplexTypeSerializer {
+
+	@Override
+	protected Attributes fillAttributes(QName name, Attributes attributes,
+			Object value, SerializationContext context) throws IOException {
+		NodeDiff diff = (NodeDiff) value;
+		AttributesImpl attrs = new AttributesImpl();
+		if (attributes != null)
+			attrs.setAttributes(attributes);
+		String uri = name.getNamespaceURI();
+		attrs.addAttribute(uri, "diff-id", "", "xsd:integer", String.valueOf(diff.getDiffId()));		
+		return attrs;
+	}
+
+	@Override
+	protected void serializeChildren(QName name, Object value,
+			SerializationContext context) throws IOException {
+		NodeDiff diff = (NodeDiff) value;
+		QName nodeIdQName = context.getQNameForClass(diff.getNodeId().getClass());
+		context.serialize(new QName(name.getNamespaceURI(), "node-id"), null,
+				diff.getNodeId(), nodeIdQName, diff.getNodeId().getClass());
+	}
+
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		Element seq = (Element) extension.appendChild(types
+				.createElement("sequence"));
+		String sObjectId = types.writeType(Object.class);		
+		seq.appendChild(types.createElement("node-id", sObjectId, true,
+				false, type.getOwnerDocument()));
+		extension.setAttribute("base", types.writeType(GraphDiff.class));
+		extension.appendChild(types.createAttributeElement("diff-id", Integer.class,
+				XMLType.XSD_INTEGER, false, type.getOwnerDocument()));
+		complexContent.appendChild(extension);
+		type.appendChild(complexContent);
+		
+		
+		return type;
+	}
+	
+	
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,66 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.util.Map;
+
+import org.apache.axis.encoding.Callback;
+import org.apache.axis.encoding.CallbackTarget;
+import org.apache.axis.encoding.Target;
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.graph.NodeIdChangeOperation;
+import org.apache.cayenne.remote.axis.ser.common.FieldAccessor;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeIdChangeOperationDeserializer extends
+		NodeDiffDeserializer<NodeIdChangeOperation> {
+
+	@SuppressWarnings("unchecked")
+	@Override
+	protected Map<String, ? extends Target> assignChildTargets() {
+		Map<String, CallbackTarget> map = (Map<String, CallbackTarget>) super
+				.assignChildTargets();
+
+		Callback callback = new Callback() {
+
+			public void setValue(Object value, Object hint) throws SAXException {
+				FieldAccessor.getInstance().setFieldValue(
+						NodeIdChangeOperation.class, "newNodeId", getValue(),
+						value);
+			}
+
+		};
+
+		map.put("new-node-id", new CallbackTarget(callback, null));
+
+		return map;
+	}
+
+	@Override
+	protected NodeIdChangeOperation createValue(String namespace,
+			Attributes attributes) {
+		return new NodeIdChangeOperation(new ObjectId(""), new ObjectId(""));
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodeIdChangeOperationSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,67 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.graph.NodeDiff;
+import org.apache.cayenne.graph.NodeIdChangeOperation;
+import org.apache.cayenne.remote.axis.ser.common.FieldAccessor;
+import org.w3c.dom.Element;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodeIdChangeOperationSerializer extends NodeDiffSerializer {
+	@Override
+	protected void serializeChildren(QName name, Object value,
+			SerializationContext context) throws IOException {
+		super.serializeChildren(name, value, context);
+		NodeIdChangeOperation op = (NodeIdChangeOperation) value;
+		// TODO Remove private field access
+		ObjectId newId = (ObjectId) FieldAccessor.getInstance().getFieldValue(
+				NodeIdChangeOperation.class, "newNodeId", op);
+		QName typeQName = context.getQNameForClass(newId.getClass());
+		context.serialize(new QName(name.getNamespaceURI(), "new-node-id"),
+				null, newId, typeQName, newId.getClass());
+	}
+
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		extension.setAttribute("base", types.writeType(NodeDiff.class));
+		complexContent.appendChild(extension);
+		String sObject = types.writeType(Object.class);
+		Element seq = (Element) extension.appendChild(types
+				.createElement("sequence"));
+		seq.appendChild(types.createElement("new-node-id", sObject, true, false,
+				extension.getOwnerDocument()));
+		type.appendChild(complexContent);
+		return type;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationDeserializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationDeserializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationDeserializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationDeserializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,95 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.util.Map;
+
+import org.apache.axis.encoding.Callback;
+import org.apache.axis.encoding.CallbackTarget;
+import org.apache.axis.encoding.DeserializationContext;
+import org.apache.axis.encoding.Target;
+import org.apache.cayenne.ObjectId;
+import org.apache.cayenne.graph.NodePropertyChangeOperation;
+import org.apache.cayenne.remote.axis.ser.common.FieldAccessor;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * AXIS deserializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodePropertyChangeOperationDeserializer extends
+		NodeDiffDeserializer<NodePropertyChangeOperation> {
+	protected String property;
+
+	@SuppressWarnings("unchecked")
+	@Override
+	protected Map<String, ? extends Target> assignChildTargets() {
+		Map<String, CallbackTarget> map = (Map<String, CallbackTarget>) super
+				.assignChildTargets();
+
+		Callback callback = new Callback() {
+
+			public void setValue(Object value, Object hint) throws SAXException {
+				/*Object val = value;
+				if (val instanceof Calendar)
+					val = ((Calendar) val).getTime();
+				*/FieldAccessor.getInstance().setFieldValue(
+						NodePropertyChangeOperation.class, "newValue",
+						getValue(), value);
+			}
+
+		};
+
+		map.put("new-value", new CallbackTarget(callback, null));
+
+		callback = new Callback() {
+
+			public void setValue(Object value, Object hint) throws SAXException {
+				/*Object val = value;
+				if (val instanceof Calendar)
+					val = ((Calendar) val).getTime();
+				*/FieldAccessor.getInstance().setFieldValue(
+						NodePropertyChangeOperation.class, "oldValue",
+						getValue(), value);
+			}
+
+		};
+
+		map.put("old-value", new CallbackTarget(callback, null));
+
+		return map;
+	}
+
+	@Override
+	protected NodePropertyChangeOperation createValue(String namespace,
+			Attributes attributes) {
+		return new NodePropertyChangeOperation(new ObjectId(""), property,
+				null, null);
+	}
+
+	@Override
+	public void onStartElement(String namespace, String localName,
+			String prefix, Attributes attributes, DeserializationContext context)
+			throws SAXException {
+		property = attributes.getValue("property");
+		super.onStartElement(namespace, localName, prefix, attributes, context);
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationSerializer.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationSerializer.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationSerializer.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/ser/sync/NodePropertyChangeOperationSerializer.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,101 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.ser.sync;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.encoding.SerializationContext;
+import org.apache.axis.wsdl.fromJava.Types;
+import org.apache.cayenne.graph.NodeDiff;
+import org.apache.cayenne.graph.NodePropertyChangeOperation;
+import org.apache.cayenne.remote.axis.ser.common.FieldAccessor;
+import org.w3c.dom.Element;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * AXIS serializer for Cayenne class.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ */
+@SuppressWarnings("serial")
+public class NodePropertyChangeOperationSerializer extends NodeDiffSerializer {
+
+	@Override
+	protected Attributes fillAttributes(QName name, Attributes attributes,
+			Object value, SerializationContext context) throws IOException {
+		AttributesImpl attrs = (AttributesImpl) super.fillAttributes(name,
+				attributes, value, context);
+		NodePropertyChangeOperation op = (NodePropertyChangeOperation) value;
+
+		// TODO Remove private field access
+		String property = (String) FieldAccessor.getInstance().getFieldValue(
+				NodePropertyChangeOperation.class, "property", op);
+
+		String uri = name.getNamespaceURI();
+		attrs.addAttribute(uri, "property", "", "xsd:string", property);
+
+		return attrs;
+	}
+
+	@Override
+	protected void serializeChildren(QName name, Object value,
+			SerializationContext context) throws IOException {
+		super.serializeChildren(name, value, context);
+		NodePropertyChangeOperation op = (NodePropertyChangeOperation) value;
+		// TODO Remove Private field access
+		Object oldValue = FieldAccessor.getInstance().getFieldValue(
+				NodePropertyChangeOperation.class, "oldValue", op);
+		Object newValue = FieldAccessor.getInstance().getFieldValue(
+				NodePropertyChangeOperation.class, "newValue", op);
+
+		QName typeQName;
+		if (oldValue != null) {
+			typeQName = context.getQNameForClass(oldValue.getClass());
+			context.serialize(new QName(name.getNamespaceURI(), "old-value"),
+					null, oldValue, typeQName, oldValue.getClass());
+
+		}
+
+		if (newValue != null) {
+			typeQName = context.getQNameForClass(newValue.getClass());
+			context.serialize(new QName(name.getNamespaceURI(), "new-value"),
+					null, newValue, typeQName, newValue.getClass());
+		}
+	}
+
+	@Override
+	public Element writeSchema(Class javaType, Types types) throws Exception {
+		Element type = types.createElement("complexType");
+		Element complexContent = types.createElement("complexContent");
+		Element extension = types.createElement("extension");
+		extension.setAttribute("base", types.writeType(NodeDiff.class));
+		complexContent.appendChild(extension);
+		String sObject = types.writeType(Object.class);
+		Element seq = (Element) extension.appendChild(types
+				.createElement("sequence"));
+		seq.appendChild(types.createElement("old-value", sObject, true, false,
+				extension.getOwnerDocument()));
+		seq.appendChild(types.createElement("new-value", sObject, true, false,
+				extension.getOwnerDocument()));
+		type.appendChild(complexContent);
+		return type;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/service/AxisService.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/service/AxisService.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/service/AxisService.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/service/AxisService.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,129 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.service;
+
+import java.lang.reflect.Method;
+import java.rmi.RemoteException;
+import java.util.Map;
+
+import org.apache.axis.MessageContext;
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.QueryResponse;
+import org.apache.cayenne.access.DataContext;
+import org.apache.cayenne.access.DataDomain;
+import org.apache.cayenne.conf.Configuration;
+import org.apache.cayenne.graph.GraphDiff;
+import org.apache.cayenne.map.EntityResolver;
+import org.apache.cayenne.query.Query;
+import org.apache.cayenne.remote.axis.CayenneROP;
+import org.apache.log4j.Logger;
+
+/**
+ * Generic implementation of CayenneAxisService.
+ * 
+ * The service works with instance of DataContext created by DataDomain of local
+ * (for server-side) Configuration. It does not use ClientServerChannel. All
+ * work on converting between client and server objects done at the level of
+ * serialization/deserialization process.
+ * 
+ * @author Michael Victorov (m_victorov@mail.ru)
+ * 
+ */
+public class AxisService implements CayenneROP {
+
+	private final Logger logObj = Logger.getLogger(AxisService.class);
+
+	protected DataDomain domain;
+
+	protected DataContext context;
+
+	protected EntityResolver resolver;
+
+	protected void initService(Map properties) throws CayenneRuntimeException {
+
+		logObj.debug(this.getClass().getName() + " is starting");
+
+		initCayenneStack(properties);
+
+		logObj.debug(getClass().getName() + " started");
+
+	}
+
+	public AxisService() {
+		super();
+		initService(null);
+	}
+
+	public QueryResponse processQuery(Query query) throws RemoteException {
+
+		if (context == null) {
+			throw new CayenneRuntimeException("Service did not init correctly.");
+		}
+		QueryResponse resp = null;
+		try {
+			resp = context.onQuery(null, query);
+		} catch (Exception e) {
+			throw new RemoteException(e.getMessage() + "\n Cause: "
+					+ e.getCause().getMessage(), e);
+		}
+
+		return resp;
+
+	}
+
+	public GraphDiff processSync(int syncType, GraphDiff changes)
+			throws RemoteException {
+		if (context == null) {
+			throw new CayenneRuntimeException("Service did not init correctly.");
+		}
+		GraphDiff diff = null;
+		try {
+			diff = (context.onSync(null, changes, syncType));
+		} catch (Exception e) {
+			throw new RemoteException(e.getMessage() + "\n Cause: "
+					+ e.getCause().getMessage(), e);
+		}
+		return diff;
+
+	}
+
+	protected void initCayenneStack(Map properties) {
+		domain = Configuration.getSharedConfiguration().getDomain();
+
+		context = domain.createDataContext();
+
+		resolver = domain.getEntityResolver();
+
+	}
+
+	public EntityResolver getEntityResolver() throws RemoteException {
+		return resolver;
+	}
+
+	public Object invokeMethod(MessageContext msgContext, Method method,
+			Object obj, Object[] argValues) throws Exception {
+		if (method.equals("processQuery")) {
+			return processQuery((Query) argValues[0]);
+		} else if (method.equals("processSync")) {
+			return processSync((Integer) argValues[0], (GraphDiff) argValues[1]);
+		} else if (method.equals("getEntityResolver")) {
+			return getEntityResolver();
+		} else
+			return null;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ClientSessionHandler.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ClientSessionHandler.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ClientSessionHandler.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ClientSessionHandler.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,110 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.sessions;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisEngine;
+import org.apache.axis.AxisFault;
+import org.apache.axis.Constants;
+import org.apache.axis.Message;
+import org.apache.axis.MessageContext;
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.handlers.BasicHandler;
+import org.apache.axis.handlers.SimpleSessionHandler;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.axis.message.SOAPHeaderElement;
+import org.apache.axis.utils.Messages;
+import org.apache.commons.logging.Log;
+
+@SuppressWarnings("serial")
+public class ClientSessionHandler extends BasicHandler {
+
+	
+	protected static Log log = LogFactory.getLog(SimpleSessionHandler.class
+			.getName());
+
+	public static final String SESSION_ID = "CayenneSession";
+
+	public static final String SESSION_LOCALPART = "sessionID";
+
+	public static final String SESSION_NS = org.apache.cayenne.remote.axis.Constants.CAYENNE_NS;
+
+	public static final QName sessionHeaderName = new QName(SESSION_NS,
+			SESSION_LOCALPART);
+
+	
+
+	public void invoke(MessageContext msgContext) throws AxisFault {
+		doClient(msgContext);		
+	}
+
+
+
+	/**
+	 * Client side of processing.
+	 */
+	public void doClient(MessageContext context) throws AxisFault {
+		if (context.getPastPivot()) {
+			// This is a response. Check it for the session header.
+			Message msg = context.getResponseMessage();
+			if (msg == null)
+				return;
+			SOAPEnvelope env = msg.getSOAPEnvelope();
+			SOAPHeaderElement header = env.getHeaderByName(SESSION_NS,
+					SESSION_LOCALPART);
+			if (header == null)
+				return;
+
+			// Got one!
+			try {
+				String id = (String) header.getValueAsType(Constants.XSD_STRING);
+				// Store it away.
+				AxisEngine engine = context.getAxisEngine();
+				engine.setOption(SESSION_ID, id);
+				// Note that we processed this header!
+				header.setProcessed(true);
+				
+				System.out.println("Response - " + id);
+			} catch (Exception e) {
+				throw AxisFault.makeFault(e);
+			}
+			
+			
+		} else {
+			AxisEngine engine = context.getAxisEngine();
+			String id = (String) engine.getOption(SESSION_ID);
+			if (id == null)
+				return;
+
+			// We have a session ID, so insert the header
+			Message msg = context.getRequestMessage();
+			if (msg == null)
+				throw new AxisFault(Messages.getMessage("noRequest00"));
+
+			SOAPEnvelope env = msg.getSOAPEnvelope();
+			SOAPHeaderElement header = new SOAPHeaderElement(SESSION_NS,
+					SESSION_LOCALPART, id);
+			env.addHeader(header);
+			
+			System.out.println("Rquest - " + id);
+		}
+	}
+
+
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/EventQueueEntry.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/EventQueueEntry.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/EventQueueEntry.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/EventQueueEntry.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,49 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.sessions;
+
+public class EventQueueEntry<E> {
+
+	private long absId;
+
+	private E object;
+
+	public long getAbsId() {
+		return absId;
+	}
+
+	public void setAbsId(long absId) {
+		this.absId = absId;
+	}
+
+	public E getObject() {
+		return object;
+	}
+
+	public void setObject(E object) {
+		this.object = object;
+	}
+
+	public EventQueueEntry(long absId, E object) {
+		super();
+		this.absId = absId;
+		this.object = object;
+	}
+	
+	
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerEventManager.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerEventManager.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerEventManager.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerEventManager.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,62 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.sessions;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+@SuppressWarnings("serial")
+public class ServerEventManager<E> extends LinkedList<EventQueueEntry<E>> {
+
+	public List<EventQueueEntry<E>> getNewEvents(ServerSession session) {
+		List<EventQueueEntry<E>> newEvents = new LinkedList<EventQueueEntry<E>>();
+
+		for (EventQueueEntry<E> entry : this) {
+			if (entry.getAbsId() < session.getLastEventAbsId())
+				newEvents.add(entry);
+		}
+
+		return newEvents;
+	}
+
+	/**
+	 * Removes all events from this list, except needed for provided sessions.
+	 * 
+	 * @param sessions
+	 * @return
+	 */
+	public int removeUnneededEvents(Collection<ServerSession> sessions) {
+		int count = 0;
+
+		long minEventAbsId = Long.MAX_VALUE;
+
+		// Find min lastEventAbsId
+		for (ServerSession session : sessions) {
+			if (session.getLastEventAbsId() < minEventAbsId)
+				minEventAbsId = session.getLastEventAbsId();
+		}
+
+		// Delete all events from start to element with minLastEventAbsId
+		while ((size() > 0) && (get(0).getAbsId() <= minEventAbsId)) {
+			remove(0);
+		}
+
+		return count;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSession.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSession.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSession.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSession.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,74 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.sessions;
+
+import java.util.UUID;
+
+import org.apache.axis.session.SimpleSession;
+
+public class ServerSession extends SimpleSession {
+	private String id;
+
+	private long lastEventAbsId;
+
+	private ServerSessionManager manager;
+
+	public ServerSessionManager getManager() {
+		return manager;
+	}
+
+	public void setManager(ServerSessionManager manager) {
+		this.manager = manager;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public ServerSession() {
+		super();
+		randomizeId();
+	}
+
+	public void randomizeId() {
+		String oldId = id;
+		id = UUID.randomUUID().toString();
+		if (manager != null) {
+			manager.remove(oldId);
+			manager.put(id, this);
+		}
+
+	}
+
+	public ServerSession(ServerSessionManager manager) {
+		super();
+		setManager(manager);
+	}
+
+	public long getLastEventAbsId() {
+		return lastEventAbsId;
+	}
+
+	public void setLastEventAbsId(long lastEventAbsId) {
+		this.lastEventAbsId = lastEventAbsId;
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionHandler.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionHandler.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionHandler.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionHandler.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,125 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.sessions;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisFault;
+import org.apache.axis.Constants;
+import org.apache.axis.Message;
+import org.apache.axis.MessageContext;
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.handlers.BasicHandler;
+import org.apache.axis.handlers.SimpleSessionHandler;
+import org.apache.axis.message.SOAPEnvelope;
+import org.apache.axis.message.SOAPHeaderElement;
+import org.apache.axis.utils.Messages;
+import org.apache.commons.logging.Log;
+
+@SuppressWarnings("serial")
+public class ServerSessionHandler extends BasicHandler {
+	private ServerSessionManager manager = new ServerSessionManager();
+
+	protected static Log log = LogFactory.getLog(SimpleSessionHandler.class
+			.getName());
+
+	public static final String SESSION_ID = "CayenneSession";
+
+	public static final String SESSION_LOCALPART = "sessionID";
+
+	public static final String SESSION_NS = org.apache.cayenne.remote.axis.Constants.CAYENNE_NS;
+
+	public static final QName sessionHeaderName = new QName(SESSION_NS,
+			SESSION_LOCALPART);
+
+	public void invoke(MessageContext msgContext) throws AxisFault {
+		manager.removeDeadSessions();
+	}
+
+	public void doServer(MessageContext context) throws AxisFault {
+		if (context.getPastPivot()) {
+
+			// This is a response. Add the session header if we have an
+			// ID.
+			ServerSession session = (ServerSession) context
+					.getProperty(SESSION_ID);
+			if (session == null)
+				throw new AxisFault(
+						"Can not set up session header for response. "
+								+ SESSION_ID
+								+ " property not found in message context.");
+
+			Message msg = context.getResponseMessage();
+			if (msg == null)
+				return;
+
+			SOAPEnvelope env = msg.getSOAPEnvelope();
+			SOAPHeaderElement header = new SOAPHeaderElement(SESSION_NS,
+					SESSION_LOCALPART, session.getId());
+			env.addHeader(header);
+			
+			System.out.println("Serverside - response - " + session.getId());
+
+		} else {
+			// Request. Set up the session if we find the header.
+			Message msg = context.getRequestMessage();
+			if (msg == null)
+				throw new AxisFault(Messages.getMessage("noRequest00"));
+
+			SOAPEnvelope env = msg.getSOAPEnvelope();
+			SOAPHeaderElement header = env.getHeaderByName(SESSION_NS,
+					SESSION_LOCALPART);
+			String id;
+			ServerSession session;
+
+			if (header != null) {
+				// Got one!
+				try {
+					id = (String) header.getValueAsType(Constants.XSD_STRING);
+					session = manager.get(id);
+				} catch (Exception e) {
+					throw AxisFault.makeFault(e);
+				}
+			} else {
+				session = manager.createServerSession();
+			}
+
+			if (session == null) {
+				// Must have timed out, get a new one.
+				session = manager.createServerSession();
+			}
+
+			// This session is still active...
+			session.touch();
+
+			// Store it away in the MessageContext.
+			context.setSession(session);
+			context.setProperty(SESSION_ID, session.getId());
+			
+			System.out.println("Serverside - request - " + session.getId());
+		}
+	}
+
+	public long getSessionTimeout() {
+		return manager.getSessionTimeout();
+	}
+
+	public void setSessionTimeout(long sessionTimeout) {
+		manager.setSessionTimeout(sessionTimeout);
+	}
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionManager.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionManager.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionManager.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/sessions/ServerSessionManager.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,68 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.sessions;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+@SuppressWarnings("serial")
+public class ServerSessionManager extends HashMap<String, ServerSession> {
+	private long lastDeadRemove = 0;
+
+	private long sessionTimeout = 300000;
+
+	public long getSessionTimeout() {
+		return sessionTimeout;
+	}
+
+	public void setSessionTimeout(long sessionTimeout) {
+		this.sessionTimeout = sessionTimeout;
+	}
+
+	public ServerSession createServerSession() {
+		ServerSession session = new ServerSession();
+		put(session.getId(), session);
+		return session;
+	}
+
+	public int removeDeadSessions() {
+		synchronized (this) {
+
+			if (System.currentTimeMillis() - lastDeadRemove >= sessionTimeout) {
+				Set<Map.Entry<String, ServerSession>> dead = new HashSet<Map.Entry<String, ServerSession>>();
+
+				Set<Map.Entry<String, ServerSession>> entrySet = entrySet();
+				for (Map.Entry<String, ServerSession> entry : entrySet) {
+					if (System.currentTimeMillis()
+							- entry.getValue().getLastAccessTime() > sessionTimeout) {
+						dead.add(entry);
+					}
+				}
+
+				if (dead.size() > 0)
+					entrySet.removeAll(dead);
+
+				return dead.size();
+			} else
+				return 0;
+
+		}
+
+	}
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCService.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCService.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCService.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCService.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,28 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.util;
+
+import java.lang.reflect.Method;
+
+import org.apache.axis.MessageContext;
+
+public interface SelfInvokingRPCService {
+
+	public Object invokeMethod(MessageContext msgContext, Method method,
+			Object obj, Object[] argValues) throws Exception;
+
+}

Added: incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCServiceProvider.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCServiceProvider.java?view=auto&rev=441230
==============================================================================
--- incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCServiceProvider.java (added)
+++ incubator/cayenne/soc/trunk/cayenne-ropwsdl/cayenne-axis/src/org/apache/cayenne/remote/axis/util/SelfInvokingRPCServiceProvider.java Thu Sep  7 14:28:04 2006
@@ -0,0 +1,37 @@
+/****************************************************************************
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.cayenne.remote.axis.util;
+
+import java.lang.reflect.Method;
+
+import org.apache.axis.MessageContext;
+import org.apache.axis.providers.java.RPCProvider;
+
+@SuppressWarnings("serial")
+public class SelfInvokingRPCServiceProvider extends RPCProvider {
+
+	@Override
+	protected Object invokeMethod(MessageContext msgContext, Method method,
+			Object obj, Object[] argValues) throws Exception {
+		if (obj instanceof SelfInvokingRPCService)
+			return ((SelfInvokingRPCService) obj).invokeMethod(msgContext,
+					method, obj, argValues);
+		else
+			return super.invokeMethod(msgContext, method, obj, argValues);
+	}
+
+}



Mime
View raw message