You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/10/16 16:01:23 UTC

[isis] 01/09: ISIS-1742: deletes DomainObjectContainer#getProperty, getPropertyNames ... use ConfigurationService instead.

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

danhaywood pushed a commit to branch dev/2.0.0/ISIS-1742-remove-deprecations
in repository https://gitbox.apache.org/repos/asf/isis.git

commit ac2308c0bd3168b234f9936cfaf422ffa050480c
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Oct 16 15:48:47 2017 +0100

    ISIS-1742: deletes DomainObjectContainer#getProperty, getPropertyNames ... use ConfigurationService instead.
---
 ...rgsvc_core-domain-api_ConfigurationService.adoc |  4 --
 ...gsvc_core-domain-api_DomainObjectContainer.adoc |  1 -
 ...n-api_DomainObjectContainer_properties-api.adoc | 50 ----------------------
 .../apache/isis/applib/DomainObjectContainer.java  | 25 -----------
 .../container/DomainObjectContainerDefault.java    | 28 ------------
 todo-deprecation-list.txt                          |  3 +-
 6 files changed, 2 insertions(+), 109 deletions(-)

diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_ConfigurationService.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_ConfigurationService.adoc
index e69062b..c5e1cbc 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_ConfigurationService.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_ConfigurationService.adoc
@@ -13,10 +13,6 @@ The `ConfigurationService` allows domain objects to read the configuration prope
 Only configuration properties with the prefix "application" are be exposed.
 ====
 
-[NOTE]
-====
-The methods in this service replace similar methods (now deprecated) in xref:../rgsvc/rgsvc.adoc#_rgsvc_core-domain-api_DomainObjectContainer[`DomainObjectContainer`].
-====
 
 
 == API and Usage
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer.adoc
index 5e495e1..b67a741 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer.adoc
@@ -23,7 +23,6 @@ The sections below discuss the functions provided by the service, broken out int
 
 include::_rgsvc_core-domain-api_DomainObjectContainer_object-creation-api.adoc[leveloffset=+2]
 include::_rgsvc_core-domain-api_DomainObjectContainer_object-persistence-api.adoc[leveloffset=+2]
-include::_rgsvc_core-domain-api_DomainObjectContainer_properties-api.adoc[leveloffset=+2]
 include::_rgsvc_core-domain-api_DomainObjectContainer_services-api.adoc[leveloffset=+2]
 include::_rgsvc_core-domain-api_DomainObjectContainer_validation-api.adoc[leveloffset=+2]
 
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer_properties-api.adoc b/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer_properties-api.adoc
deleted file mode 100644
index 1d3cb3c..0000000
--- a/adocs/documentation/src/main/asciidoc/guides/rgsvc/_rgsvc_core-domain-api_DomainObjectContainer_properties-api.adoc
+++ /dev/null
@@ -1,50 +0,0 @@
-[[_rgsvc_core-domain-api_DomainObjectContainer_properties-api]]
-:Notice: 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 ag [...]
-:_basedir: ../../
-:_imagesdir: images/
-
-
-
-
-= Properties API
-
-The properties API allows domain objects to read the configuration properties aggregated from the various xref:../rgcfg/rgcfg.adoc#_rgcfg_configuration-files[configuration files].
-
-[source,java]
-----
-public interface DomainObjectContainer {
-    String getProperty(String name);                        // <1>
-    String getProperty(String name, String defaultValue);   // <2>
-    List<String> getPropertyNames();                        // <3>
-}
-----
-<1> Return the configuration property with the specified name; else return null.
-<2> Return the configuration property with the specified name; if it doesn't exist then return the specified default value.
-<3> Return the names of all the available properties.
-
-For example, here's a fictitious service that might wrap link:http://twitter4j.org/en/configuration.html[Twitter4J]. say:
-
-[source,java]
-----
-@DomainService(nature=NatureOfService.DOMAIN)
-public class TweetService {
-    @Programmatic
-    @PostConstruct
-    public void init() {
-        this.oauthConsumerKey = container.getProperty("tweetservice.oauth.consumerKey");
-        this.oauthConsumerSecret = container.getProperty("tweetservice.oauth.consumerSecret");
-        this.oauthAccessToken = container.getProperty("tweetservice.oauth.accessToken");
-        this.oauthAccessTokenSecret = container.getProperty("tweetservice.oauth.accessTokenSecret");
-    }
-    ...
-    @Inject
-    DomainObjectContainer container;
-}
-----
-
-[TIP]
-====
-If you _do_ have a domain service that needs to access properties, then note that an alternative is to define a xref:../rgant/rgant.adoc#_rgant-PostConstruct[`@PostConstruct`] method and pass in a `Map<String,String>` of properties.  The two techniques are almost identical; it's mostly a matter of taste.
-====
-
-
diff --git a/core/applib/src/main/java/org/apache/isis/applib/DomainObjectContainer.java b/core/applib/src/main/java/org/apache/isis/applib/DomainObjectContainer.java
index 3c00033..f8e19da 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/DomainObjectContainer.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/DomainObjectContainer.java
@@ -272,30 +272,5 @@ public interface DomainObjectContainer {
 
     //endregion
 
-    //region > properties (DEPRECATED)
-
-    /**
-     * @deprecated - use {@link org.apache.isis.applib.services.config.ConfigurationService#getProperty(String)} instead.
-     */
-    @Deprecated
-    @Programmatic
-    String getProperty(String name);
-
-    /**
-     * @deprecated - use {@link org.apache.isis.applib.services.config.ConfigurationService#getProperty(String, String)} instead.
-     */
-    @Deprecated
-    @Programmatic
-    String getProperty(String name, String defaultValue);
-
-    /**
-     * @deprecated - use {@link org.apache.isis.applib.services.config.ConfigurationService#getPropertyNames()} instead.
-     */
-    @Deprecated
-    @Programmatic
-    List<String> getPropertyNames();
-
-    //endregion
-
 
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
index b4c8884..dc2815e 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/container/DomainObjectContainerDefault.java
@@ -331,31 +331,6 @@ public class DomainObjectContainerDefault
     //endregion
 
 
-    //region > properties
-
-    @Deprecated
-    @Programmatic
-    @Override
-    public String getProperty(final String name) {
-        return configurationService.getProperty(name);
-    }
-
-    @Deprecated
-    @Programmatic
-    @Override
-    public String getProperty(final String name, final String defaultValue) {
-        return configurationService.getProperty(name, defaultValue);
-    }
-
-    @Deprecated
-    @Programmatic
-    @Override
-    public List<String> getPropertyNames() {
-        return configurationService.getPropertyNames();
-    }
-
-    //endregion
-
 
 
     // //////////////////////////////////////////////////////////////////
@@ -429,9 +404,6 @@ public class DomainObjectContainerDefault
     SpecificationLoader specificationLoader;
 
     @javax.inject.Inject
-    org.apache.isis.applib.services.config.ConfigurationService configurationService;
-
-    @javax.inject.Inject
     FactoryService factoryService;
 
     @javax.inject.Inject
diff --git a/todo-deprecation-list.txt b/todo-deprecation-list.txt
index 86986fe..13aa29c 100644
--- a/todo-deprecation-list.txt
+++ b/todo-deprecation-list.txt
@@ -463,4 +463,5 @@ org.apache.isis.applib
     - iconNameOf    ... use TitleService#iconNameOf(...) instead
     - flush()       ... use TransactionService#flushTransaction instead
     - informUser, warnUser, raiseError ... use MessageService
-    - getUser ... use UserService
\ No newline at end of file
+    - getUser                          ... use UserService
+    - getProperty, getPropertyNames    ... use ConfigurationService
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.