[ohla-devel] SF.net SVN: ohla: [86] trunk/rti/src/java/net/sf/ohla/rti1516
Status: Beta
Brought to you by:
mnewcomb
From: <mne...@us...> - 2007-01-17 19:16:37
|
Revision: 86 http://svn.sourceforge.net/ohla/?rev=86&view=rev Author: mnewcomb Date: 2007-01-17 11:16:34 -0800 (Wed, 17 Jan 2007) Log Message: ----------- - removed peer notification messages of retract Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java 2007-01-17 19:14:07 UTC (rev 85) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java 2007-01-17 19:16:34 UTC (rev 86) @@ -2342,7 +2342,17 @@ messageRetractionManager.retract(messageRetractionHandle, timeManager.queryLogicalTime()); - sendToPeers(new Retract(messageRetractionHandle)); + WriteFuture writeFuture = rtiSession.write( + new Retract(messageRetractionHandle)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } } finally { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java 2007-01-17 19:14:07 UTC (rev 85) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java 2007-01-17 19:16:34 UTC (rev 86) @@ -82,6 +82,7 @@ import net.sf.ohla.rti1516.messages.GetRangeBounds; import net.sf.ohla.rti1516.messages.TimeAdvanceRequestAvailable; import net.sf.ohla.rti1516.messages.RequestAttributeValueUpdate; +import net.sf.ohla.rti1516.messages.Retract; import org.apache.mina.common.IoSession; import org.apache.mina.common.WriteFuture; @@ -218,6 +219,10 @@ { process(session, (RequestAttributeValueUpdate) message); } + else if (message instanceof Retract) + { + process(session, (Retract) message); + } else if (message instanceof SubscribeObjectClassAttributes) { process(session, (SubscribeObjectClassAttributes) message); @@ -537,6 +542,19 @@ } } + protected void process(IoSession session, Retract retract) + { + federationExecutionStateLock.readLock().lock(); + try + { + send(retract); + } + finally + { + federationExecutionStateLock.readLock().unlock(); + } + } + protected void process( IoSession session, SubscribeObjectClassAttributes subscribeObjectClassAttributes) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |