Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew M Finkbeiner2013-08-27 20:53:14 +0000
committerdonald.g.dunne2013-08-28 21:01:45 +0000
commit419c045952758bcd1c7a2aba685d890ea20db86a (patch)
treeaba79c461dc8081649ec34fa4c4aa0b203cf4aef
parent6014b560d17740a0b0fe223d9de01639c9f90dd6 (diff)
downloadorg.eclipse.osee-419c045952758bcd1c7a2aba685d890ea20db86a.tar.gz
org.eclipse.osee-419c045952758bcd1c7a2aba685d890ea20db86a.tar.xz
org.eclipse.osee-419c045952758bcd1c7a2aba685d890ea20db86a.zip
bug[ats_LBJF4]: Clean up dds references of messagedata
-rw-r--r--plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java11
-rw-r--r--plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataWriter.java38
-rw-r--r--plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java1
-rw-r--r--plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java9
-rw-r--r--plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Publisher.java3
5 files changed, 31 insertions, 31 deletions
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java
index 2b1c13e3e5..e81cd8558a 100644
--- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java
+++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataReader.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ote.messaging.dds.entity;
import java.nio.ByteBuffer;
import java.util.Collection;
+
import org.eclipse.osee.ote.messaging.dds.Data;
import org.eclipse.osee.ote.messaging.dds.DataSample;
import org.eclipse.osee.ote.messaging.dds.DataStoreItem;
@@ -41,8 +42,8 @@ import org.eclipse.osee.ote.messaging.dds.status.SubscriptionMatchStatus;
* @author David Diepenbrock
*/
public class DataReader extends DomainEntity {
- private final TopicDescription topicDescription;
- private final Subscriber subscriber;
+ private TopicDescription topicDescription;
+ private Subscriber subscriber;
private ByteBuffer dataBuffer;
private boolean deleted;
private DataStoreItem item;
@@ -588,6 +589,12 @@ public class DataReader extends DomainEntity {
return ReturnCode.ERROR;
}
+ public void dispose(){
+ topicDescription = null;
+ subscriber = null;
+ super.dispose();
+ }
+
/**
* This is intended to be called whenever new data is "published" to the Service. Calls onDataAvailable on the
* attached <code>DataReaderListener</code> as appropriate.
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataWriter.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataWriter.java
index 80095954fa..2dea7f1739 100644
--- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataWriter.java
+++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DataWriter.java
@@ -37,8 +37,8 @@ import org.eclipse.osee.ote.messaging.dds.status.PublicationMatchStatus;
* @author David Diepenbrock
*/
public class DataWriter extends DomainEntity {
- private final Topic topic;
- private final Publisher publisher;
+ private Topic topic;
+ private Publisher publisher;
private boolean deleted;
private boolean publishBackToLocalDDSReaders = true;
@@ -220,18 +220,8 @@ public class DataWriter extends DomainEntity {
* implemented or used.
*/
public ReturnCode dispose(Data data, InstanceHandle handle) {
-
- // UNSURE This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- return ReturnCode.ERROR;
+ dispose();
+ return ReturnCode.UNSUPPORTED;
}
/**
@@ -239,18 +229,14 @@ public class DataWriter extends DomainEntity {
* implemented or used.
*/
public ReturnCode diposeWithTimestamp(Data data, InstanceHandle handle, Time timestamp) {
-
- // DONT_NEED This method has not been implemented, but is called out in the spec
- if (true) {
- throw new NotImplementedException();
- }
-
- // Check that the Entity is enabled before proceeding (See description of enable on the Entity object in the DDS spec)
- if (!isEnabled()) {
- return ReturnCode.NOT_ENABLED;
- }
-
- return ReturnCode.ERROR;
+ dispose();
+ return ReturnCode.UNSUPPORTED;
+ }
+
+ public void dispose(){
+ topic = null;
+ publisher = null;
+ super.dispose();
}
/**
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java
index 33341b7ea9..97425a6312 100644
--- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java
+++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/DomainEntity.java
@@ -25,4 +25,5 @@ public abstract class DomainEntity extends Entity {
public DomainEntity(boolean enabled, Listener listener, EntityFactory parentFactory) {
super(enabled, listener, parentFactory);
}
+
}
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java
index 61263342b9..74b98a0ef4 100644
--- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java
+++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Entity.java
@@ -25,7 +25,7 @@ import org.eclipse.osee.ote.messaging.dds.listener.Listener;
*/
public abstract class Entity {
- private final EntityFactory parentFactory;
+ private EntityFactory parentFactory;
private Listener listener;
@SuppressWarnings("unused")
@@ -128,7 +128,7 @@ public abstract class Entity {
public ReturnCode enable() {
// Check pre-conditions
- if (!parentFactory.isEnabled()) {
+ if (parentFactory != null && !parentFactory.isEnabled()) {
return ReturnCode.PRECONDITION_NOT_MET;
}
@@ -140,4 +140,9 @@ public abstract class Entity {
enabled = true;
return ReturnCode.OK;
}
+
+ protected void dispose() {
+ parentFactory = null;
+ listener = null;
+ }
}
diff --git a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Publisher.java b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Publisher.java
index c88ba8aef4..01f3268288 100644
--- a/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Publisher.java
+++ b/plugins/org.eclipse.osee.ote.messaging.dds/src/org/eclipse/osee/ote/messaging/dds/entity/Publisher.java
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
+
import org.eclipse.osee.ote.messaging.dds.Data;
import org.eclipse.osee.ote.messaging.dds.DataSample;
import org.eclipse.osee.ote.messaging.dds.DataStoreItem;
@@ -157,8 +158,8 @@ public class Publisher extends DomainEntity implements EntityFactory {
return ReturnCode.ALREADY_DELETED;
}
+ dataWriter.markAsDeleted();
if (dataWriters.remove(dataWriter)) {
- dataWriter.markAsDeleted();
return ReturnCode.OK;
} else {
// If the data writer wasn't found, then return PRECONDITION_NOT_MET

Back to the top