diff options
Diffstat (limited to 'plugins/org.eclipse.osee.ote.messaging.dds')
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 2b1c13e3e53..e81cd8558aa 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 80095954fa1..2dea7f17390 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 33341b7ea9d..97425a63121 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 61263342b91..74b98a0ef4d 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 c88ba8aef44..01f32682880 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 |