You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/01/21 13:14:41 UTC

[isis] branch master updated: ISIS-2270: sync adoc

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f0de56  ISIS-2270: sync adoc
5f0de56 is described below

commit 5f0de56b363ff83dc23af4198b4b81ff7a0fc2b7
Author: Andi Huber <ah...@apache.org>
AuthorDate: Tue Jan 21 14:14:29 2020 +0100

    ISIS-2270: sync adoc
---
 .../examples/annotation/DomainObject.java          |  3 ++-
 .../applib-ant/examples/annotation/Mixin.java      |  3 ++-
 .../applib-ant/examples/annotation/ViewModel.java  |  3 ++-
 .../examples/services/factory/FactoryService.java  | 31 +++++++++++++++-------
 4 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/DomainObject.java b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/DomainObject.java
index 391e992..785446f 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/DomainObject.java
+++ b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/DomainObject.java
@@ -24,6 +24,7 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
 import org.apache.isis.applib.events.domain.ActionDomainEvent;
@@ -47,7 +48,7 @@ import org.apache.isis.applib.events.lifecycle.ObjectUpdatingEvent;
 @Inherited
 @Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
 @Retention(RetentionPolicy.RUNTIME)
-@Component
+@Component @Scope("prototype")
 public @interface DomainObject {
 
     /**
diff --git a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Mixin.java b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Mixin.java
index 7568045..5e47907 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Mixin.java
+++ b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Mixin.java
@@ -25,6 +25,7 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
 /**
@@ -38,7 +39,7 @@ import org.springframework.stereotype.Component;
 @Inherited
 @Target({ ElementType.TYPE })
 @Retention(RetentionPolicy.RUNTIME)
-@Component
+@Component @Scope("prototype")
 public @interface Mixin {
 
     /**
diff --git a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/ViewModel.java b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/ViewModel.java
index 3c61bbc..e76c9d2 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/ViewModel.java
+++ b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/ViewModel.java
@@ -27,6 +27,7 @@ import java.lang.annotation.Target;
 
 import javax.xml.bind.annotation.XmlRootElement;
 
+import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Component;
 
 /**
@@ -56,7 +57,7 @@ import org.springframework.stereotype.Component;
 @Inherited
 @Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE })
 @Retention(RetentionPolicy.RUNTIME)
-@Component
+@Component @Scope("prototype")
 public @interface ViewModel {
 
 
diff --git a/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java b/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java
index 2b2fa70..f13919e 100644
--- a/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java
+++ b/api/applib/src/main/adoc/modules/applib-svc/examples/services/factory/FactoryService.java
@@ -19,22 +19,33 @@
 
 package org.apache.isis.applib.services.factory;
 
+import java.util.NoSuchElementException;
+
 import javax.annotation.Nullable;
 
 import org.apache.isis.applib.services.repository.RepositoryService;
+import org.apache.isis.core.commons.exceptions.IsisException;
 
 public interface FactoryService {
-    
+
     /**
-     * Gets an instance of the specified type, with injection points resolved 
-     * and life-cycle callbacks processed.
+     * Gets an instance (possibly shared or independent) of the specified {@code requiredType}, 
+     * with injection points resolved 
+     * and any life-cycle callback processed.
      * 
      * @param <T>
-     * @param type
-     * @return
+     * @param requiredType
+     * @return (non-null), an instance of {@code requiredType}, if available and unique
+     * (i.e. not multiple candidates found with none marked as primary)
+     * 
+     * @throws NoSuchElementException if result is empty
+     * @throws IsisException if instance creation failed
+     * 
+     * @apiNote does not force the requiredType to be added to the meta-model
+     * 
      * @since 2.0
      */
-    <T> T get(Class<T> type);
+    <T> T get(Class<T> requiredType);
 
     /**
      * Creates a new Mixin instance.
@@ -50,7 +61,6 @@ public interface FactoryService {
      * @param viewModelClass
      * @param mementoStr - ignored if {@code null}
      * @since 2.0
-     * @apiNote EXPERIMENTAL
      */
     <T> T viewModel(Class<T> viewModelClass, @Nullable String mementoStr);
 
@@ -58,7 +68,6 @@ public interface FactoryService {
      * Creates a new ViewModel instance 
      * @param viewModelClass
      * @since 2.0
-     * @apiNote EXPERIMENTAL
      */
     default <T> T viewModel(Class<T> viewModelClass) {
         return viewModel(viewModelClass, /*mementoStr*/null);
@@ -93,9 +102,11 @@ public interface FactoryService {
      * alternatively just <i>new()</i> up the object rather than call this
      * method.
      * </p>
-     * @deprecated with sematic changes since 2.0 previous behavior is no longer guaranteed
+     * @deprecated with semantic changes since 2.0 previous behavior is no longer guaranteed, 
+     * instead consider use of {@link #get(Class)} if applicable
      */
     @Deprecated
     <T> T instantiate(Class<T> domainClass);
-    
+
+
 }