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 2014/05/11 19:41:47 UTC
[02/16] git commit: ISIS-550: renaming classes
ISIS-550: renaming classes
to be consistent with current convention..
* AddToCollectionEvent -> CollectionAddToEvent
* RemoveFromCollectionEvent -> CollectionRemoveFromEvent
etc.
Also commented out some unit test that was incomplete.
Also:
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/43c50c46
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/43c50c46
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/43c50c46
Branch: refs/heads/master
Commit: 43c50c463b5d664f1558dfa92752c2483654e738
Parents: 548cb14
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed May 7 05:31:56 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed May 7 05:31:56 2014 +0100
----------------------------------------------------------------------
.../annotation/PostsAddedToCollectionEvent.java | 59 ------------------
.../annotation/PostsCollectionAddedToEvent.java | 63 ++++++++++++++++++++
.../PostsCollectionRemovedFromEvent.java | 63 ++++++++++++++++++++
.../PostsRemovedFromCollectionEvent.java | 59 ------------------
.../eventbus/AddedToCollectionEvent.java | 55 -----------------
.../eventbus/CollectionAddedToEvent.java | 55 +++++++++++++++++
.../eventbus/CollectionRemovedFromEvent.java | 54 +++++++++++++++++
.../eventbus/RemovedFromCollectionEvent.java | 54 -----------------
...lectionAddToEventAnnotationFacetFactory.java | 8 +--
...ostsCollectionAddToEventFacetAnnotation.java | 18 +++---
...nAddedEventFacetAnnotationTest_newEvent.java | 20 +++----
11 files changed, 258 insertions(+), 250 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsAddedToCollectionEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsAddedToCollectionEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsAddedToCollectionEvent.java
deleted file mode 100644
index 28fa7c2..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsAddedToCollectionEvent.java
+++ /dev/null
@@ -1,59 +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.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.apache.isis.applib.services.eventbus.AddedToCollectionEvent;
-
-/**
- * Applies only to collections; any changes should be propagated as events to subscribers.
- * Only posted after a successful validation.
- *
- * <p>For example:
- * <pre>
- * public static class DomainEntityAddedToCollectionEvent extends AddedToCollectionEvent {}
- *
- * @PostsAddedToCollectionEvent(DomainEntityAddedToCollectionEvent.class)
- * public DomainEntity getDomainEntity() { ...}
- * </pre>
- *
- * <p>
- * It is highly advisable that only domain services - not domain entities - are registered as subscribers.
- * Domain services are guaranteed to be instantiated and resident in memory, whereas the same is not true
- * of domain entities. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface PostsAddedToCollectionEvent {
-
- /**
- * The subclass of {@link AddedToCollectionEvent event} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
- */
- Class<? extends AddedToCollectionEvent<?,?>> value();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
new file mode 100644
index 0000000..e67be7f
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionAddedToEvent.java
@@ -0,0 +1,63 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
+
+/**
+ * Applies only to collections; any changes should be propagated as events to subscribers.
+ * Only posted after a successful validation.
+ *
+ * <p>For example:
+ * <pre>
+ * public class Order {
+ * public static class OrderLineItemsAddedToEvent extends CollectionAddedToEvent {}
+ *
+ * @PostsCollectionAddedToEvent(OrderLineItemsAddedToEvent.class)
+ * public SortedSet<OrderLine> getLineItems() { ...}
+ * }
+ * </pre>
+ *
+ * <p>
+ * It is highly advisable that only domain services - not domain entities - are registered as subscribers.
+ * Domain services are guaranteed to be instantiated and resident in memory, whereas the same is not true
+ * of domain entities. The typical implementation of a domain service subscriber is to identify the impacted entities,
+ * load them using a repository, and then to delegate to the event to them.
+ *
+ * @see PostsCollectionRemovedFromEvent
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+public @interface PostsCollectionAddedToEvent {
+
+ /**
+ * The subclass of {@link CollectionAddedToEvent event} to be instantiated and posted.
+ *
+ * <p>
+ * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ */
+ Class<? extends CollectionAddedToEvent<?,?>> value();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
new file mode 100644
index 0000000..f560434
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsCollectionRemovedFromEvent.java
@@ -0,0 +1,63 @@
+/*
+ * 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.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.isis.applib.services.eventbus.CollectionRemovedFromEvent;
+
+/**
+ * Applies only to collections; any changes should be propagated as events to subscribers.
+ * Only posted after a successful validation.
+ *
+ * <p>For example:
+ * <pre>
+ * public class Order {
+ * public static class OrderLineItemsRemovedFromEvent extends CollectionRemovedFromEvent {}
+ *
+ * @PostsCollectionRemovedFromEvent(OrderLineItemsRemovedFromEvent.class)
+ * public SortedSet<OrderLine> getLineItems() { ...}
+ * }
+ * </pre>
+ *
+ * <p>
+ * It is highly advisable that only domain services - not domain entities - are registered as subscribers.
+ * Domain services are guaranteed to be instantiated and resident in memory, whereas the same is not true
+ * of domain entities. The typical implementation of a domain service subscriber is to identify the impacted entities,
+ * load them using a repository, and then to delegate to the event to them.
+ *
+ * @see PostsCollectionAddedToEvent
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.METHOD})
+public @interface PostsCollectionRemovedFromEvent {
+
+ /**
+ * The subclass of {@link CollectionRemovedFromEvent event} to be instantiated and posted.
+ *
+ * <p>
+ * This subclass must provide a no-arg constructor; the fields are set reflectively.
+ */
+ Class<? extends CollectionRemovedFromEvent<?,?>> value();
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsRemovedFromCollectionEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsRemovedFromCollectionEvent.java b/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsRemovedFromCollectionEvent.java
deleted file mode 100644
index 4198ce6..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/annotation/PostsRemovedFromCollectionEvent.java
+++ /dev/null
@@ -1,59 +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.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.apache.isis.applib.services.eventbus.RemovedFromCollectionEvent;
-
-/**
- * Applies only to collections; any changes should be propagated as events to subscribers.
- * Only posted after a successful validation.
- *
- * <p>For example:
- * <pre>
- * public static class DomainEntityRemovedFromCollectionEvent extends RemovedFromCollectionEvent {}
- *
- * @PostsRemovedFromCollectionEvent(DomainEntityRemovedFromCollectionEvent.class)
- * public DomainEntity getDomainEntity() { ...}
- * </pre>
- *
- * <p>
- * It is highly advisable that only domain services - not domain entities - are registered as subscribers.
- * Domain services are guaranteed to be instantiated and resident in memory, whereas the same is not true
- * of domain entities. The typical implementation of a domain service subscriber is to identify the impacted entities,
- * load them using a repository, and then to delegate to the event to them.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.METHOD})
-public @interface PostsRemovedFromCollectionEvent {
-
- /**
- * The subclass of {@link RemovedFromCollectionEvent event} to be instantiated and posted.
- *
- * <p>
- * This subclass must provide a no-arg constructor; the fields are set reflectively.
- */
- Class<? extends RemovedFromCollectionEvent<?,?>> value();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AddedToCollectionEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AddedToCollectionEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AddedToCollectionEvent.java
deleted file mode 100644
index 6b6bb02..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/AddedToCollectionEvent.java
+++ /dev/null
@@ -1,55 +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.eventbus;
-
-import org.apache.isis.applib.annotation.PostsPropertyChangedEvent;
-import org.apache.isis.applib.util.ObjectContracts;
-
-public abstract class AddedToCollectionEvent<S,T> {
- private final S source;
- private final T addedValue;
-
- /**
- * To instantiate reflectively when the {@link PostsPropertyChangedEvent} annotation
- * is used.
- *
- * <p>
- * The fields ({@link #source} and {@link #addedValue} are then set reflectively.
- */
- public AddedToCollectionEvent() {
- this(null, null);
- }
- public AddedToCollectionEvent(S source, T addedValue) {
- this.source = source;
- this.addedValue = addedValue;
- }
-
- public S getSource() {
- return source;
- }
-
- public T getAddedValue() {
- return addedValue;
- }
-
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "source,addedValue");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionAddedToEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionAddedToEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionAddedToEvent.java
new file mode 100644
index 0000000..10229f7
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionAddedToEvent.java
@@ -0,0 +1,55 @@
+/*
+ * 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.eventbus;
+
+import org.apache.isis.applib.annotation.PostsPropertyChangedEvent;
+import org.apache.isis.applib.util.ObjectContracts;
+
+public abstract class CollectionAddedToEvent<S,T> {
+ private final S source;
+ private final T addedValue;
+
+ /**
+ * To instantiate reflectively when the {@link PostsPropertyChangedEvent} annotation
+ * is used.
+ *
+ * <p>
+ * The fields ({@link #source} and {@link #addedValue} are then set reflectively.
+ */
+ public CollectionAddedToEvent() {
+ this(null, null);
+ }
+ public CollectionAddedToEvent(S source, T addedValue) {
+ this.source = source;
+ this.addedValue = addedValue;
+ }
+
+ public S getSource() {
+ return source;
+ }
+
+ public T getAddedValue() {
+ return addedValue;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectContracts.toString(this, "source,addedValue");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionRemovedFromEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionRemovedFromEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionRemovedFromEvent.java
new file mode 100644
index 0000000..84289da
--- /dev/null
+++ b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/CollectionRemovedFromEvent.java
@@ -0,0 +1,54 @@
+/*
+ * 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.eventbus;
+
+import org.apache.isis.applib.util.ObjectContracts;
+
+public abstract class CollectionRemovedFromEvent<S,T> {
+ private final S source;
+ private final T removedValue;
+
+ /**
+ * To instantiate reflectively when the {@link PostsCollectionAddedToEvent} annotation
+ * is used.
+ *
+ * <p>
+ * The fields ({@link #source} and {@link #removedValue} are then set reflectively.
+ */
+ public CollectionRemovedFromEvent() {
+ this(null, null);
+ }
+ public CollectionRemovedFromEvent(S source, T removedValue) {
+ this.source = source;
+ this.removedValue = removedValue;
+ }
+
+ public S getSource() {
+ return source;
+ }
+
+ public T getRemovedValue() {
+ return removedValue;
+ }
+
+ @Override
+ public String toString() {
+ return ObjectContracts.toString(this, "source,removedValue");
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/RemovedFromCollectionEvent.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/RemovedFromCollectionEvent.java b/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/RemovedFromCollectionEvent.java
deleted file mode 100644
index e33ed95..0000000
--- a/core/applib/src/main/java/org/apache/isis/applib/services/eventbus/RemovedFromCollectionEvent.java
+++ /dev/null
@@ -1,54 +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.eventbus;
-
-import org.apache.isis.applib.util.ObjectContracts;
-
-public abstract class RemovedFromCollectionEvent<S,T> {
- private final S source;
- private final T removedValue;
-
- /**
- * To instantiate reflectively when the {@link PostsAddedToCollectionEvent} annotation
- * is used.
- *
- * <p>
- * The fields ({@link #source} and {@link #removedValue} are then set reflectively.
- */
- public RemovedFromCollectionEvent() {
- this(null, null);
- }
- public RemovedFromCollectionEvent(S source, T removedValue) {
- this.source = source;
- this.removedValue = removedValue;
- }
-
- public S getSource() {
- return source;
- }
-
- public T getRemovedValue() {
- return removedValue;
- }
-
- @Override
- public String toString() {
- return ObjectContracts.toString(this, "source,removedValue");
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventAnnotationFacetFactory.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventAnnotationFacetFactory.java
index e68b05c..408a144 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventAnnotationFacetFactory.java
@@ -23,8 +23,8 @@ import java.lang.reflect.Method;
import java.util.Comparator;
import java.util.List;
-import org.apache.isis.applib.annotation.PostsAddedToCollectionEvent;
-import org.apache.isis.applib.services.eventbus.AddedToCollectionEvent;
+import org.apache.isis.applib.annotation.PostsCollectionAddedToEvent;
+import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.metamodel.adapter.ServicesProvider;
import org.apache.isis.core.metamodel.adapter.ServicesProviderAware;
@@ -61,7 +61,7 @@ public class PostsCollectionAddToEventAnnotationFacetFactory extends FacetFactor
}
private PostsAddedToCollectionEventFacet create(Method method, final FacetHolder holder) {
- final PostsAddedToCollectionEvent annotation = Annotations.getAnnotation(method, PostsAddedToCollectionEvent.class);
+ final PostsCollectionAddedToEvent annotation = Annotations.getAnnotation(method, PostsCollectionAddedToEvent.class);
if(annotation == null) {
return null;
}
@@ -80,7 +80,7 @@ public class PostsCollectionAddToEventAnnotationFacetFactory extends FacetFactor
if(collectionFacet != null) {
holder.removeFacet(collectionFacet);
}
- final Class<? extends AddedToCollectionEvent<?,?>> changedEventType = annotation.value();
+ final Class<? extends CollectionAddedToEvent<?,?>> changedEventType = annotation.value();
return new PostsCollectionAddToEventFacetAnnotation(changedEventType, postsAddedToCollectionEventFacet, collectionAddToFacet, collectionFacet, servicesProvider, holder);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventFacetAnnotation.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventFacetAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventFacetAnnotation.java
index 6c59633..8318cdb 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventFacetAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddToEventFacetAnnotation.java
@@ -26,7 +26,7 @@ import java.util.List;
import com.google.common.collect.Lists;
import org.apache.isis.applib.FatalException;
-import org.apache.isis.applib.services.eventbus.AddedToCollectionEvent;
+import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
import org.apache.isis.applib.services.eventbus.EventBusService;
import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
import org.apache.isis.core.metamodel.adapter.ServicesProvider;
@@ -47,10 +47,10 @@ public class PostsCollectionAddToEventFacetAnnotation extends
private EventBusService eventBusService;
private boolean searchedForEventBusService = false;
- private Class<? extends AddedToCollectionEvent<?, ?>> addedToCollectionEventType;
+ private Class<? extends CollectionAddedToEvent<?, ?>> addedToCollectionEventType;
public PostsCollectionAddToEventFacetAnnotation(
- Class<? extends AddedToCollectionEvent<?, ?>> addedToCollectionEventType,
+ Class<? extends CollectionAddedToEvent<?, ?>> addedToCollectionEventType,
CollectionAddToFacet collectionAddToFacet,
CollectionFacet collectionFacet,
ServicesProvider servicesProvider, FacetHolder holder) {
@@ -86,7 +86,7 @@ public class PostsCollectionAddToEventFacetAnnotation extends
final Object source = inObject.getObject();
try {
final Class type = addedToCollectionEventType;
- final AddedToCollectionEvent<?, ?> event = newEvent(type, addedValue, source);
+ final CollectionAddedToEvent<?, ?> event = newEvent(type, addedValue, source);
eventBusService.post(event);
} catch (Exception e) {
@@ -95,12 +95,12 @@ public class PostsCollectionAddToEventFacetAnnotation extends
}
- static <S, T> AddedToCollectionEvent<S, T> newEvent(
- final Class<? extends AddedToCollectionEvent<S, T>> type,
+ static <S, T> CollectionAddedToEvent<S, T> newEvent(
+ final Class<? extends CollectionAddedToEvent<S, T>> type,
final T addedValue, final S source)
throws InstantiationException, IllegalAccessException,
NoSuchFieldException {
- final AddedToCollectionEvent<S, T> event = type.newInstance();
+ final CollectionAddedToEvent<S, T> event = type.newInstance();
setField("source", event, source);
setField("addedValue", event, addedValue);
@@ -108,9 +108,9 @@ public class PostsCollectionAddToEventFacetAnnotation extends
}
private static void setField(final String name,
- final AddedToCollectionEvent<?, ?> event, final Object sourceValue)
+ final CollectionAddedToEvent<?, ?> event, final Object sourceValue)
throws NoSuchFieldException, IllegalAccessException {
- final Field sourceField = AddedToCollectionEvent.class
+ final Field sourceField = CollectionAddedToEvent.class
.getDeclaredField(name);
sourceField.setAccessible(true);
sourceField.set(event, sourceValue);
http://git-wip-us.apache.org/repos/asf/isis/blob/43c50c46/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddedEventFacetAnnotationTest_newEvent.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddedEventFacetAnnotationTest_newEvent.java b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddedEventFacetAnnotationTest_newEvent.java
index ab89c44..5f22cc4 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddedEventFacetAnnotationTest_newEvent.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/progmodel/facets/collections/event/PostsCollectionAddedEventFacetAnnotationTest_newEvent.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.isis.core.progmodel.facets.properties.event;
+package org.apache.isis.core.progmodel.facets.collections.event;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
@@ -28,14 +28,14 @@ public class PostsCollectionAddedEventFacetAnnotationTest_newEvent {
public static class SomeDomainObject {}
- public static class SomeDomainObjectCollectionAddedEvent extends AddToCollectionEvent<SomeDomainObject, SomeDomainObject> {}
-
- @Test
- public void test() throws Exception {
- SomeDomainObject sdo = new SomeDomainObject();
- final PropertyChangedEvent<SomeDomainObject, LocalDate> ev = PostsPropertyChangedEventFacetAnnotation.newEvent(SomeDatePropertyChangedEvent.class, new SomeDomainObject(), sdo);
- assertThat(ev.getSource(), is(sdo));
- assertThat(ev.getNewValue(), is(new LocalDate(2013,4,1)));
- }
+// public static class SomeDomainObjectCollectionAddedEvent extends AddToCollectionEvent<SomeDomainObject, SomeDomainObject> {}
+//
+// @Test
+// public void test() throws Exception {
+// SomeDomainObject sdo = new SomeDomainObject();
+// final PropertyChangedEvent<SomeDomainObject, LocalDate> ev = PostsPropertyChangedEventFacetAnnotation.newEvent(SomeDatePropertyChangedEvent.class, new SomeDomainObject(), sdo);
+// assertThat(ev.getSource(), is(sdo));
+// assertThat(ev.getNewValue(), is(new LocalDate(2013,4,1)));
+// }
}