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/03 11:58:56 UTC

[isis] 13/24: ISIS-1742: deletes EventPayload and subclasses

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 ab524bce95d0310e9d1b33bbc1733972df14d556
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Oct 3 09:26:48 2017 +0100

    ISIS-1742: deletes EventPayload and subclasses
    
    These being the objects previously created by the payload factories.
---
 .../isis/applib/services/command/Command.java      |   1 -
 .../isis/applib/services/publish/EventPayload.java |  40 ----
 .../publish/EventPayloadForActionInvocation.java   | 218 ---------------------
 .../publish/EventPayloadForObjectChanged.java      |  70 -------
 .../action/ActionAnnotationFacetFactoryTest.java   |   1 -
 .../publish/PublishingServiceInternalDefault.java  |   3 -
 6 files changed, 333 deletions(-)

diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/command/Command.java b/core/applib/src/main/java/org/apache/isis/applib/services/command/Command.java
index a6f458f..2118897 100644
--- a/core/applib/src/main/java/org/apache/isis/applib/services/command/Command.java
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/command/Command.java
@@ -33,7 +33,6 @@ import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
 import org.apache.isis.applib.services.iactn.Interaction;
 import org.apache.isis.applib.services.publish.EventMetadata;
-import org.apache.isis.applib.services.publish.EventPayload;
 import org.apache.isis.applib.services.wrapper.WrapperFactory;
 import org.apache.isis.schema.cmd.v1.CommandDto;
 
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayload.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayload.java
deleted file mode 100644
index 6d03666..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayload.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-import org.apache.isis.applib.annotation.Programmatic;
-
-
-
-
-/**
- * @deprecated - no longer provided to {@link PublishingService#publish(EventMetadata, EventPayload)} (always <tt>null</tt>).
- */
-@Deprecated
-public interface EventPayload {
-
-    /**
-     * Injected by Isis runtime immediately after instantiation.
-     */
-    @Deprecated
-    @Programmatic
-    void withStringifier(ObjectStringifier stringifier);
-
-}
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayloadForActionInvocation.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayloadForActionInvocation.java
deleted file mode 100644
index ced2150..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayloadForActionInvocation.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.isis.applib.Identifier;
-import org.apache.isis.applib.annotation.Programmatic;
-
-/**
- * No longer in use.
- *
- * @deprecated
- */
-@Deprecated
-public class EventPayloadForActionInvocation<T> implements EventPayload {
-    
-    private final Identifier actionIdentifier;
-    private final T target;
-    private final List<? extends Object> arguments;
-    private final Object result;
-    private ObjectStringifier stringifier;
-
-    public EventPayloadForActionInvocation(final Identifier actionIdentifier, final T target, final List<? extends Object> arguments, final Object result) {
-        this.target = target;
-        this.actionIdentifier = actionIdentifier;
-        this.arguments = arguments != null? arguments: Collections.emptyList();
-        this.result = result;
-    }
-
-    /**
-     * Injected by Isis runtime immediately after instantiation.
-     */
-    @Deprecated
-    @Programmatic
-    public void withStringifier(ObjectStringifier stringifier) {
-        this.stringifier = stringifier;
-    }
-
-    @Deprecated
-    @Programmatic
-    public List<? extends Object> getArguments() {
-        return arguments;
-    }
-
-    @Deprecated
-    @Programmatic
-    public T getTarget() {
-        return target;
-    }
-
-    @Deprecated
-    @Programmatic
-    public String getActionName() {
-        return actionIdentifier.toFullIdentityString();
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg0() {
-        return getArg(0);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg0() {
-        return hideArg(0);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg1() {
-        return getArg(1);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg1() {
-        return hideArg(1);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg2() {
-        return getArg(2);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg2() {
-        return hideArg(2);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg3() {
-        return getArg(3);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg3() {
-        return hideArg(3);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg4() {
-        return getArg(4);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg4() {
-        return hideArg(4);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg5() {
-        return getArg(5);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg5() {
-        return hideArg(5);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg6() {
-        return getArg(6);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg6() {
-        return hideArg(6);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg7() {
-        return getArg(7);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg7() {
-        return hideArg(7);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg8() {
-        return getArg(8);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg8() {
-        return hideArg(8);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getArg9() {
-        return getArg(9);
-    }
-    @Deprecated
-    @Programmatic
-    public boolean hideArg9() {
-        return hideArg(9);
-    }
-
-    @Deprecated
-    @Programmatic
-    public Object getResult() {
-        return result;
-    }
-
-    private Object getArg(int paramNum) {
-        return arguments.size()>paramNum?arguments.get(paramNum):null;
-    }
-    private boolean hideArg(int paramNum) {
-        return arguments.size()<=paramNum;
-    }
-    
-    @Override
-    public String toString() {
-        if(stringifier == null) {
-            throw new IllegalStateException("ObjectStringifier has not been injected");
-        }
-
-        final StringBuilder buf = new StringBuilder();
-        buf.append(getActionName());
-        buf.append("\n    target=").append(stringifier.toString(target));
-        buf.append("\n      args=[");
-        for (Object arg : arguments) {
-            buf.append("\n           ").append(stringifier.toString(arg));
-        }
-        buf.append("\n      ]");
-        final String stringifiedResult = stringifier.toString(result);
-        buf.append("\n    result=").append(stringifiedResult != null ? stringifiedResult : "void");
-        return buf.toString();
-    }
-
-}
\ No newline at end of file
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayloadForObjectChanged.java b/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayloadForObjectChanged.java
deleted file mode 100644
index 816e691..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/publish/EventPayloadForObjectChanged.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  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.isis.applib.services.publish;
-
-import org.apache.isis.applib.annotation.Programmatic;
-
-/**
- * No longer in use.
- *
- * @deprecated
- */
-@Deprecated
-public class EventPayloadForObjectChanged<T> implements EventPayload {
-    
-    private final T changed;
-    private ObjectStringifier stringifier;
-
-    public EventPayloadForObjectChanged(T changed) {
-        this.changed = changed;
-    }
-
-    /**
-     * Injected by Isis runtime immediately after instantiation.
-     */
-    @Deprecated
-    @Programmatic
-    public void withStringifier(ObjectStringifier stringifier) {
-        this.stringifier = stringifier;
-    }
-
-    @Deprecated
-    @Programmatic
-    public T getChanged() {
-        return changed;
-    }
-
-    @Deprecated
-    @Programmatic
-    public String getClassName() {
-        if(stringifier == null) {
-            throw new IllegalStateException("ObjectStringifier has not been injected");
-        }
-        return stringifier.classNameOf(changed);
-    }
-
-    @Override
-    public String toString() {
-        if(stringifier == null) {
-            throw new IllegalStateException("ObjectStringifier has not been injected");
-        }
-        return stringifier.toString(changed);
-    }
-}
\ No newline at end of file
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java
index 03d28d9..9993493 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/actions/action/ActionAnnotationFacetFactoryTest.java
@@ -45,7 +45,6 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.annotation.Where;
 import org.apache.isis.applib.services.HasTransactionId;
 import org.apache.isis.applib.services.eventbus.ActionDomainEvent;
-import org.apache.isis.applib.services.publish.EventPayload;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategory;
 import org.apache.isis.core.metamodel.deployment.DeploymentCategoryProvider;
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/publish/PublishingServiceInternalDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/publish/PublishingServiceInternalDefault.java
index aad979c..ba035b5 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/publish/PublishingServiceInternalDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/publish/PublishingServiceInternalDefault.java
@@ -45,7 +45,6 @@ import org.apache.isis.applib.services.iactn.Interaction;
 import org.apache.isis.applib.services.iactn.InteractionContext;
 import org.apache.isis.applib.services.metrics.MetricsService;
 import org.apache.isis.applib.services.publish.EventMetadata;
-import org.apache.isis.applib.services.publish.EventPayload;
 import org.apache.isis.applib.services.publish.EventType;
 import org.apache.isis.applib.services.publish.ObjectStringifier;
 import org.apache.isis.applib.services.publish.PublishedObjects;
@@ -154,8 +153,6 @@ public class PublishingServiceInternalDefault implements PublishingServiceIntern
             return;
         }
 
-        final PublishedObject.PayloadFactory payloadFactory = publishedObjectFacet.value();
-
         final RootOid enlistedAdapterOid = (RootOid) enlistedAdapter.getOid();
         final String enlistedAdapterClass = CommandUtil.targetClassNameFor(enlistedAdapter);
         final Bookmark enlistedTarget = enlistedAdapterOid.asBookmark();

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