polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soelvs...@apache.org
Subject [1/2] polygene-java git commit: Simplified inheritance hierarchy for ModelDescriptor(s) that are also part of a VisitableHierarchy
Date Sun, 21 Jan 2018 21:01:11 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 8d0d8dcc7 -> e1cc8a6e0


Simplified inheritance hierarchy for ModelDescriptor(s) that are also part of a VisitableHierarchy


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/468bd3db
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/468bd3db
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/468bd3db

Branch: refs/heads/develop
Commit: 468bd3dbc31fa0b4047e29dadb303ea0746f638d
Parents: 8d0d8dc
Author: soelvsten <kent.soelvsten@gmail.com>
Authored: Sun Jan 21 20:20:36 2018 +0100
Committer: soelvsten <kent.soelvsten@gmail.com>
Committed: Sun Jan 21 20:20:36 2018 +0100

----------------------------------------------------------------------
 .../api/composite/CompositeDescriptor.java      |  4 ++-
 .../polygene/api/object/ObjectDescriptor.java   |  3 +-
 .../api/service/ImportedServiceDescriptor.java  |  3 +-
 .../api/util/VisitableModelDescriptor.java      | 30 ++++++++++++++++++++
 .../runtime/composite/CompositeModel.java       |  2 +-
 .../polygene/runtime/object/ObjectModel.java    |  2 +-
 .../runtime/service/ImportedServiceModel.java   |  2 +-
 .../skeletons/SQLCompatEntityStateWrapper.java  |  7 +++++
 8 files changed, 47 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/api/src/main/java/org/apache/polygene/api/composite/CompositeDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/composite/CompositeDescriptor.java
b/core/api/src/main/java/org/apache/polygene/api/composite/CompositeDescriptor.java
index bd5d65e..4f8f39d 100644
--- a/core/api/src/main/java/org/apache/polygene/api/composite/CompositeDescriptor.java
+++ b/core/api/src/main/java/org/apache/polygene/api/composite/CompositeDescriptor.java
@@ -20,13 +20,15 @@
 
 package org.apache.polygene.api.composite;
 
+import org.apache.polygene.api.util.VisitableModelDescriptor;
+
 import java.util.stream.Stream;
 
 /**
  * Composite Descriptor.
  */
 public interface CompositeDescriptor
-    extends ModelDescriptor
+    extends VisitableModelDescriptor
 {
     Class<?> primaryType();
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/api/src/main/java/org/apache/polygene/api/object/ObjectDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/object/ObjectDescriptor.java b/core/api/src/main/java/org/apache/polygene/api/object/ObjectDescriptor.java
index 81ee90b..64edfd3 100644
--- a/core/api/src/main/java/org/apache/polygene/api/object/ObjectDescriptor.java
+++ b/core/api/src/main/java/org/apache/polygene/api/object/ObjectDescriptor.java
@@ -21,11 +21,12 @@
 package org.apache.polygene.api.object;
 
 import org.apache.polygene.api.composite.ModelDescriptor;
+import org.apache.polygene.api.util.VisitableModelDescriptor;
 
 /**
  * Object Descriptor.
  */
 public interface ObjectDescriptor
-    extends ModelDescriptor
+    extends VisitableModelDescriptor
 {
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/api/src/main/java/org/apache/polygene/api/service/ImportedServiceDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/service/ImportedServiceDescriptor.java
b/core/api/src/main/java/org/apache/polygene/api/service/ImportedServiceDescriptor.java
index 558b7ed..f981e7f 100644
--- a/core/api/src/main/java/org/apache/polygene/api/service/ImportedServiceDescriptor.java
+++ b/core/api/src/main/java/org/apache/polygene/api/service/ImportedServiceDescriptor.java
@@ -22,12 +22,13 @@ package org.apache.polygene.api.service;
 
 import org.apache.polygene.api.composite.ModelDescriptor;
 import org.apache.polygene.api.identity.Identifiable;
+import org.apache.polygene.api.util.VisitableModelDescriptor;
 
 /**
  * {@code ServiceDescriptor} provides meta information of a service.
  */
 public interface ImportedServiceDescriptor
-    extends ModelDescriptor, Identifiable
+    extends VisitableModelDescriptor, Identifiable
 {
     Class<? extends ServiceImporter> serviceImporter();
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/api/src/main/java/org/apache/polygene/api/util/VisitableModelDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/util/VisitableModelDescriptor.java
b/core/api/src/main/java/org/apache/polygene/api/util/VisitableModelDescriptor.java
new file mode 100644
index 0000000..e8d93b1
--- /dev/null
+++ b/core/api/src/main/java/org/apache/polygene/api/util/VisitableModelDescriptor.java
@@ -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.polygene.api.util;
+
+import org.apache.polygene.api.composite.ModelDescriptor;
+
+/**
+ * A modeldescriptor, that is also part of a VisitableHierarchy
+ */
+public interface VisitableModelDescriptor
+        extends ModelDescriptor, VisitableHierarchy<Object, Object>
+{
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositeModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositeModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositeModel.java
index 72ab757..29d49f0 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositeModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositeModel.java
@@ -47,7 +47,7 @@ import static org.apache.polygene.api.composite.InvalidCompositeException.handle
  * JAVADOC
  */
 public abstract class CompositeModel
-    implements VisitableHierarchy<Object, Object>, Dependencies, CompositeDescriptor
+    implements Dependencies, CompositeDescriptor
 {
     protected final ModuleDescriptor module;
     protected final MixinsModel mixinsModel;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectModel.java
index c1a3dbf..6efdc02 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectModel.java
@@ -39,7 +39,7 @@ import org.apache.polygene.runtime.injection.InjectionContext;
  * JAVADOC
  */
 public final class ObjectModel
-    implements ObjectDescriptor, VisitableHierarchy<Object, Object>
+    implements ObjectDescriptor
 {
     private final ModuleDescriptor module;
     private final Class<?> objectType;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceModel.java
index 174735f..50495ef 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceModel.java
@@ -38,7 +38,7 @@ import org.apache.polygene.runtime.activation.ActivatorsModel;
  * JAVADOC
  */
 public final class ImportedServiceModel
-    implements ImportedServiceDescriptor, VisitableHierarchy<Object, Object>
+    implements ImportedServiceDescriptor
 {
     private final ModuleDescriptor module;
     private final Class<?> type;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/468bd3db/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
index 4b1d9a2..49bff4f 100644
--- a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
+++ b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/support/skeletons/SQLCompatEntityStateWrapper.java
@@ -35,6 +35,7 @@ import org.apache.polygene.api.structure.ModuleDescriptor;
 import org.apache.polygene.api.type.CollectionType;
 import org.apache.polygene.api.type.EntityCompositeType;
 import org.apache.polygene.api.type.ValueType;
+import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.value.ValueComposite;
 import org.apache.polygene.spi.entity.EntityState;
 import org.apache.polygene.spi.entity.EntityStatus;
@@ -279,6 +280,12 @@ class SQLCompatEntityStateWrapper
         {
             return wrappedEntityDescriptor.hashCode();
         }
+
+        @Override
+        public <ThrowableType extends Throwable> boolean accept(HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> visitor) throws ThrowableType
+        {
+            return wrappedEntityDescriptor.accept(visitor);
+        }
     }
 
     private static class CompatAssociationStateDescriptorWrapper


Mime
View raw message