cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmen...@apache.org
Subject svn commit: r616432 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote: ./ hessian/ hessian/service/ service/
Date Tue, 29 Jan 2008 16:17:58 GMT
Author: kmenard
Date: Tue Jan 29 08:17:55 2008
New Revision: 616432

URL: http://svn.apache.org/viewvc?rev=616432&view=rev
Log:
Remote package generification.

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/ClientSerializerFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerDataRowSerializer.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerSerializerFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/service/HttpRemoteService.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java?rev=616432&r1=616431&r2=616432&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/RemoteSession.java
Tue Jan 29 08:17:55 2008
@@ -31,6 +31,7 @@
 import org.apache.cayenne.DataChannel;
 import org.apache.cayenne.event.EventBridge;
 import org.apache.cayenne.event.EventBridgeFactory;
+import org.apache.cayenne.event.EventSubject;
 
 /**
  * A descriptor used by default service implementation to pass session parameters to the
@@ -42,7 +43,7 @@
  */
 public class RemoteSession implements Serializable {
 
-    static final Collection SUBJECTS = Arrays.asList(DataChannel.GRAPH_CHANGED_SUBJECT,
+    static final Collection<EventSubject> SUBJECTS = Arrays.asList(DataChannel.GRAPH_CHANGED_SUBJECT,
             DataChannel.GRAPH_FLUSHED_SUBJECT,
             DataChannel.GRAPH_ROLLEDBACK_SUBJECT);
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/ClientSerializerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/ClientSerializerFactory.java?rev=616432&r1=616431&r2=616432&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/ClientSerializerFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/ClientSerializerFactory.java
Tue Jan 29 08:17:55 2008
@@ -39,7 +39,7 @@
  */
 class ClientSerializerFactory extends AbstractSerializerFactory {
 
-    private Map deserializers;
+    private Map<Class, Deserializer> deserializers;
     private Deserializer dataRowDeserializer;
 
     @Override
@@ -56,14 +56,14 @@
             synchronized (this) {
 
                 if (deserializers != null) {
-                    deserializer = (Deserializer) deserializers.get(cl);
+                    deserializer = deserializers.get(cl);
                 }
 
                 if (deserializer == null) {
                     deserializer = new JavaDeserializer(cl);
 
                     if (deserializers == null) {
-                        deserializers = new HashMap();
+                        deserializers = new HashMap<Class, Deserializer>();
                     }
 
                     deserializers.put(cl, deserializer);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerDataRowSerializer.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerDataRowSerializer.java?rev=616432&r1=616431&r2=616432&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerDataRowSerializer.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerDataRowSerializer.java
Tue Jan 29 08:17:55 2008
@@ -49,9 +49,9 @@
         out.writeLong(row.getVersion());
         out.writeLong(row.getReplacesVersion());
 
-        Iterator it = row.entrySet().iterator();
+        Iterator<Map.Entry<String,Object>> it = row.entrySet().iterator();
         while (it.hasNext()) {
-            Map.Entry entry = (Map.Entry) it.next();
+            Map.Entry<String,Object> entry = it.next();
             out.writeObject(entry.getKey());
             out.writeObject(entry.getValue());
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerSerializerFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerSerializerFactory.java?rev=616432&r1=616431&r2=616432&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerSerializerFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/hessian/service/ServerSerializerFactory.java
Tue Jan 29 08:17:55 2008
@@ -44,7 +44,7 @@
 
     private ServerPersistentObjectListSerializer persistentObjectListSerializer;
     private ServerDataRowSerializer dataRowSerilaizer;
-    private Map deserializers;
+    private Map<Class, Deserializer> deserializers;
 
     ServerSerializerFactory() {
         this.persistentObjectListSerializer = new ServerPersistentObjectListSerializer();
@@ -78,7 +78,7 @@
             synchronized (this) {
 
                 if (deserializers != null) {
-                    deserializer = (Deserializer) deserializers.get(cl);
+                    deserializer = deserializers.get(cl);
                 }
 
                 if (deserializer == null) {
@@ -86,7 +86,7 @@
                             .getClientEntityResolver());
 
                     if (deserializers == null) {
-                        deserializers = new HashMap();
+                        deserializers = new HashMap<Class, Deserializer>();
                     }
 
                     deserializers.put(cl, deserializer);

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/service/HttpRemoteService.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/service/HttpRemoteService.java?rev=616432&r1=616431&r2=616432&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/service/HttpRemoteService.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/service/HttpRemoteService.java
Tue Jan 29 08:17:55 2008
@@ -44,7 +44,7 @@
     // keep logger non-static so that it could be garbage collected with this instance..
     private final Log logObj = LogFactory.getLog(HttpRemoteService.class);
 
-    private Map sharedChannels = new HashMap();
+    private Map<String, WeakReference<DataChannel>> sharedChannels = new HashMap<String,
WeakReference<DataChannel>>();
 
     /**
      * Returns an HttpSession associated with the current request in progress.
@@ -117,13 +117,13 @@
     }
 
     protected DataChannel getSharedChannel(String name) {
-        WeakReference ref = (WeakReference) sharedChannels.get(name);
-        return (ref != null) ? (DataChannel) ref.get() : null;
+        WeakReference<DataChannel> ref = sharedChannels.get(name);
+        return (ref != null) ? ref.get() : null;
     }
 
     protected void saveSharedChannel(String name, DataChannel channel) {
         // wrap value in a WeakReference so that channels can be deallocated when all
         // sessions that reference this channel time out...
-        sharedChannels.put(name, new WeakReference(channel));
+        sharedChannels.put(name, new WeakReference<DataChannel>(channel));
     }
 }



Mime
View raw message