chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r1039369 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-client: chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/ chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/cl...
Date Fri, 26 Nov 2010 14:21:02 GMT
Author: fguillaume
Date: Fri Nov 26 14:21:01 2010
New Revision: 1039369

URL: http://svn.apache.org/viewvc?rev=1039369&view=rev
Log:
Simplify adapters: no CmisObjectAdapter base class needed.

Removed:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObjectAdapter.java
Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java?rev=1039369&r1=1039368&r2=1039369&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObject.java
Fri Nov 26 14:21:01 2010
@@ -229,7 +229,7 @@ public interface CmisObject extends Obje
     /**
      * Returns an adapter based on the given interface.
      */
-    CmisObjectAdapter getAdapter(Class<? extends CmisObjectAdapter> adapterInterface);
+    <T> T getAdapter(Class<T> adapterInterface);
 
     /**
      * Returns a transient object adapter.

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java?rev=1039369&r1=1039368&r2=1039369&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/TransientCmisObject.java
Fri Nov 26 14:21:01 2010
@@ -28,7 +28,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
 import org.apache.chemistry.opencmis.commons.enums.ExtensionLevel;
 
-public interface TransientCmisObject extends CmisObjectAdapter, ObjectId {
+public interface TransientCmisObject extends ObjectId {
 
     // CMIS properties
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java?rev=1039369&r1=1039368&r2=1039369&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/AbstractCmisObject.java
Fri Nov 26 14:21:01 2010
@@ -30,7 +30,6 @@ import java.util.Set;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.chemistry.opencmis.client.api.CmisObject;
-import org.apache.chemistry.opencmis.client.api.CmisObjectAdapter;
 import org.apache.chemistry.opencmis.client.api.ObjectFactory;
 import org.apache.chemistry.opencmis.client.api.ObjectId;
 import org.apache.chemistry.opencmis.client.api.ObjectType;
@@ -528,15 +527,14 @@ public abstract class AbstractCmisObject
 
     // --- adapters ---
 
-    public CmisObjectAdapter getAdapter(Class<? extends CmisObjectAdapter> adapterInterface)
{
+    @SuppressWarnings("unchecked")
+    public <T> T getAdapter(Class<T> adapterInterface) {
         if (adapterInterface == null) {
             return null;
         }
-
         if (adapterInterface.equals(TransientCmisObject.class)) {
-            return createTransientCmisObject();
+            return (T) createTransientCmisObject();
         }
-
         return null;
     }
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java?rev=1039369&r1=1039368&r2=1039369&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/test/java/org/apache/chemistry/opencmis/client/runtime/CmisObjectMock.java
Fri Nov 26 14:21:01 2010
@@ -24,7 +24,6 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.chemistry.opencmis.client.api.CmisObject;
-import org.apache.chemistry.opencmis.client.api.CmisObjectAdapter;
 import org.apache.chemistry.opencmis.client.api.ItemIterable;
 import org.apache.chemistry.opencmis.client.api.ObjectId;
 import org.apache.chemistry.opencmis.client.api.ObjectType;
@@ -154,7 +153,7 @@ public class CmisObjectMock implements C
     public List<CmisExtensionElement> getExtensions(ExtensionLevel level) {
         return null;
     }
-    
+
     public void refresh() {
 
     }
@@ -174,13 +173,13 @@ public class CmisObjectMock implements C
     public CmisObject updateProperties(Map<String, ?> properties) {
         return null;
     }
-    
+
     public ObjectId updateProperties(Map<String, ?> properties, boolean refresh) {
         return null;
     }
 
     public void applyPolicy(ObjectId... policyIds) {
-        
+
     }
 
     public void removePolicy(ObjectId... policyIds) {
@@ -190,7 +189,7 @@ public class CmisObjectMock implements C
         return this.id;
     }
 
-    public CmisObjectAdapter getAdapter(Class<? extends CmisObjectAdapter> adapterInterface)
{
+    public <T> T getAdapter(Class<T> adapterInterface) {
         return null;
     }
 



Mime
View raw message