ohla-devel Mailing List for Open HLA
Status: Beta
Brought to you by:
mnewcomb
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(5) |
Apr
(8) |
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
(6) |
Oct
(7) |
Nov
(65) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(13) |
Feb
(34) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Michael N. <mic...@gm...> - 2013-12-23 10:15:28
|
Lots of updates and bug fixes in this release. - Completed Time Management implementation - Completed Save/Restore implementation - Updated 3rd party libraries - Added example Circles JavaFX application that has HLA 1.3, IEEE 1516, and IEEE 1516e federates Thanks, Michael |
From: Michael N. <mic...@gm...> - 2011-03-22 02:18:37
|
Lots of updates in this release. - Added IEEE 1516 Evolved API support. HLA 1.3, IEEE 1516, and IEEE 1516 Evolved are all interoperable with each other. - Migrated to Netty from MINA. - Implemented custom encoding for performance increases. - Implemented Data Distribution Management. - Completed Ownership Management - Added Internationalization support I have yet to thoroughly test Time Management, but I will be working on that for a 0.5.1 release. I will also be working on a set of performance tests to put OHLA up against some of the other RTIs out there. Feel free to download and check it out: https://sourceforge.net/projects/ohla/files/ohla Thanks, Michael |
From: SourceForge.net <no...@so...> - 2007-02-21 14:16:00
|
Bugs item #1664382, was opened at 2007-02-20 09:42 Message generated for change (Settings changed) made by mnewcomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664382&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Time Management >Group: 0.4.0 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) >Assigned to: Michael Newcomb (mnewcomb) Summary: NullPointerException in TAR Initial Comment: When I call timeAdvanceRequest I get this error on the server side: java.lang.NullPointerException at net.sf.ohla.rti1516.Integer64Time.compareTo(Integer64Time.java:123) at net.sf.ohla.rti1516.Integer64Time.compareTo(Integer64Time.java:118) at net.sf.ohla.rti1516.federation.FederateProxy.timeAdvanceRequest(FederateProxy.java:327) at net.sf.ohla.rti1516.federation.FederationExecutionTimeManager.timeAdvanceRequest(FederationExecutionTimeManager.java:118) at net.sf.ohla.rti1516.federation.FederationExecution.timeAdvanceRequest(FederationExecution.java:1352) at net.sf.ohla.rti1516.federation.FederateProxyIoFilter.messageReceived(FederateProxyIoFilter.java:369) The galt variable is not initialised. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:12 Message: Logged In: YES user_id=382427 Originator: NO Should have only occured on federates that requested a time advance when regulation/constrained was not enabled? Can you verify this was your case? That is what looked like was happening because GALT is sent to the federate on join but it is not recorded in the federate proxy when the proxy was created. Fixed as of version 126. Thanks Jerome! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664382&group_id=134950 |
From: SourceForge.net <no...@so...> - 2007-02-21 14:15:40
|
Bugs item #1664378, was opened at 2007-02-20 09:37 Message generated for change (Settings changed) made by mnewcomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Time Management >Group: 0.4.0 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) >Assigned to: Michael Newcomb (mnewcomb) Summary: NullPointerException in updateAttributeValues Initial Comment: When I call updateAttributeValues after receiving a timeRegulationEnabled or timeAdvanceGrant callback, I get this exception: java.lang.NullPointerException at net.sf.ohla.rti1516.federate.FederateTimeManager.checkIfInvalidTimestamp(FederateTimeManager.java:819) at net.sf.ohla.rti1516.federate.FederateTimeManager.updateAttributeValues(FederateTimeManager.java:797) at net.sf.ohla.rti1516.federate.Federate.updateAttributeValues(Federate.java:1481) at net.sf.ohla.rti1516.OHLARTIambassador.updateAttributeValues(OHLARTIambassador.java:907) For one reason the advanceRequestTimeType enum is null. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:53 Message: Logged In: YES user_id=382427 Originator: NO Should be fixed in revision 127. ---------------------------------------------------------------------- Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:53 Message: Logged In: YES user_id=382427 Originator: NO There was nothing indicating that a time advance request was not in progress when performing the checks for invalid logical time. Added a NONE enumeration to indicate that there is not time advance request in progress. So, if you are in the time granted state, it should behave in the same way in that it will verify that the time being passed in is >= current time + lookahead. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 |
From: SourceForge.net <no...@so...> - 2007-02-20 17:53:28
|
Bugs item #1664378, was opened at 2007-02-20 09:37 Message generated for change (Comment added) made by mnewcomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in updateAttributeValues Initial Comment: When I call updateAttributeValues after receiving a timeRegulationEnabled or timeAdvanceGrant callback, I get this exception: java.lang.NullPointerException at net.sf.ohla.rti1516.federate.FederateTimeManager.checkIfInvalidTimestamp(FederateTimeManager.java:819) at net.sf.ohla.rti1516.federate.FederateTimeManager.updateAttributeValues(FederateTimeManager.java:797) at net.sf.ohla.rti1516.federate.Federate.updateAttributeValues(Federate.java:1481) at net.sf.ohla.rti1516.OHLARTIambassador.updateAttributeValues(OHLARTIambassador.java:907) For one reason the advanceRequestTimeType enum is null. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- >Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:53 Message: Logged In: YES user_id=382427 Originator: NO Should be fixed in revision 127. ---------------------------------------------------------------------- Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:53 Message: Logged In: YES user_id=382427 Originator: NO There was nothing indicating that a time advance request was not in progress when performing the checks for invalid logical time. Added a NONE enumeration to indicate that there is not time advance request in progress. So, if you are in the time granted state, it should behave in the same way in that it will verify that the time being passed in is >= current time + lookahead. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 |
From: SourceForge.net <no...@so...> - 2007-02-20 17:53:11
|
Bugs item #1664378, was opened at 2007-02-20 09:37 Message generated for change (Comment added) made by mnewcomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in updateAttributeValues Initial Comment: When I call updateAttributeValues after receiving a timeRegulationEnabled or timeAdvanceGrant callback, I get this exception: java.lang.NullPointerException at net.sf.ohla.rti1516.federate.FederateTimeManager.checkIfInvalidTimestamp(FederateTimeManager.java:819) at net.sf.ohla.rti1516.federate.FederateTimeManager.updateAttributeValues(FederateTimeManager.java:797) at net.sf.ohla.rti1516.federate.Federate.updateAttributeValues(Federate.java:1481) at net.sf.ohla.rti1516.OHLARTIambassador.updateAttributeValues(OHLARTIambassador.java:907) For one reason the advanceRequestTimeType enum is null. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- >Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:53 Message: Logged In: YES user_id=382427 Originator: NO There was nothing indicating that a time advance request was not in progress when performing the checks for invalid logical time. Added a NONE enumeration to indicate that there is not time advance request in progress. So, if you are in the time granted state, it should behave in the same way in that it will verify that the time being passed in is >= current time + lookahead. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 |
From: SourceForge.net <no...@so...> - 2007-02-20 17:13:01
|
Bugs item #1664382, was opened at 2007-02-20 09:42 Message generated for change (Comment added) made by mnewcomb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664382&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in TAR Initial Comment: When I call timeAdvanceRequest I get this error on the server side: java.lang.NullPointerException at net.sf.ohla.rti1516.Integer64Time.compareTo(Integer64Time.java:123) at net.sf.ohla.rti1516.Integer64Time.compareTo(Integer64Time.java:118) at net.sf.ohla.rti1516.federation.FederateProxy.timeAdvanceRequest(FederateProxy.java:327) at net.sf.ohla.rti1516.federation.FederationExecutionTimeManager.timeAdvanceRequest(FederationExecutionTimeManager.java:118) at net.sf.ohla.rti1516.federation.FederationExecution.timeAdvanceRequest(FederationExecution.java:1352) at net.sf.ohla.rti1516.federation.FederateProxyIoFilter.messageReceived(FederateProxyIoFilter.java:369) The galt variable is not initialised. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- >Comment By: Michael Newcomb (mnewcomb) Date: 2007-02-20 12:12 Message: Logged In: YES user_id=382427 Originator: NO Should have only occured on federates that requested a time advance when regulation/constrained was not enabled? Can you verify this was your case? That is what looked like was happening because GALT is sent to the federate on join but it is not recorded in the federate proxy when the proxy was created. Fixed as of version 126. Thanks Jerome! ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664382&group_id=134950 |
From: SourceForge.net <no...@so...> - 2007-02-20 14:42:45
|
Bugs item #1664382, was opened at 2007-02-20 15:42 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664382&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in TAR Initial Comment: When I call timeAdvanceRequest I get this error on the server side: java.lang.NullPointerException at net.sf.ohla.rti1516.Integer64Time.compareTo(Integer64Time.java:123) at net.sf.ohla.rti1516.Integer64Time.compareTo(Integer64Time.java:118) at net.sf.ohla.rti1516.federation.FederateProxy.timeAdvanceRequest(FederateProxy.java:327) at net.sf.ohla.rti1516.federation.FederationExecutionTimeManager.timeAdvanceRequest(FederationExecutionTimeManager.java:118) at net.sf.ohla.rti1516.federation.FederationExecution.timeAdvanceRequest(FederationExecution.java:1352) at net.sf.ohla.rti1516.federation.FederateProxyIoFilter.messageReceived(FederateProxyIoFilter.java:369) The galt variable is not initialised. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664382&group_id=134950 |
From: SourceForge.net <no...@so...> - 2007-02-20 14:37:52
|
Bugs item #1664378, was opened at 2007-02-20 15:37 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jerome Robert (jeromerobert) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException in updateAttributeValues Initial Comment: When I call updateAttributeValues after receiving a timeRegulationEnabled or timeAdvanceGrant callback, I get this exception: java.lang.NullPointerException at net.sf.ohla.rti1516.federate.FederateTimeManager.checkIfInvalidTimestamp(FederateTimeManager.java:819) at net.sf.ohla.rti1516.federate.FederateTimeManager.updateAttributeValues(FederateTimeManager.java:797) at net.sf.ohla.rti1516.federate.Federate.updateAttributeValues(Federate.java:1481) at net.sf.ohla.rti1516.OHLARTIambassador.updateAttributeValues(OHLARTIambassador.java:907) For one reason the advanceRequestTimeType enum is null. This is with revision 124 of the subversion repository. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=731457&aid=1664378&group_id=134950 |
From: Newcomb, Michael-P. <Mic...@gd...> - 2007-02-13 14:30:53
|
You can subscribe to the ohl...@li... list if you wish to receive SVN commit messages. Thanks, Michael |
From: <mne...@us...> - 2007-02-13 03:55:52
|
Revision: 122 http://svn.sourceforge.net/ohla/?rev=122&view=rev Author: mnewcomb Date: 2007-02-12 19:55:52 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/build/intellij/OHLA.iws trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java Modified: trunk/build/intellij/OHLA.iws =================================================================== --- trunk/build/intellij/OHLA.iws 2007-02-13 03:53:01 UTC (rev 121) +++ trunk/build/intellij/OHLA.iws 2007-02-13 03:55:52 UTC (rev 122) @@ -20,24 +20,11 @@ </component> <component name="ChangeListManager"> <list default="true" name="Default" comment=""> - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalRegionManager.java" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalMessageRetractionManager.java" afterPath="" /> - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java" /> <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\AttributeInstance.java" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalTimeManager.java" afterPath="" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectManager.java" afterPath="" /> - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java" /> - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalSynchronizationPoint.java" afterPath="" /> <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectInstance.java" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OHLA.iws" afterPath="$PROJECT_DIR$/OHLA.iws" /> - <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalFederate.java" afterPath="" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectManager.java" afterPath="" /> </list> <list name="Failed commit: Default" comment="- removed log4j" /> <list name="Failed commit: Default (2)" comment="- refactoring" /> @@ -238,7 +225,7 @@ <file leaf-file-name="FederateRestore.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="18" column="13" selection-start="658" selection-end="658" vertical-scroll-proportion="0.12431444"> + <state line="18" column="13" selection-start="658" selection-end="658" vertical-scroll-proportion="0.12854442"> <folding /> </state> </provider> @@ -247,16 +234,16 @@ <file leaf-file-name="FederateSave.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="16" column="13" selection-start="619" selection-end="619" vertical-scroll-proportion="0.06390978"> + <state line="20" column="13" selection-start="694" selection-end="694" vertical-scroll-proportion="0.19844358"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="Federate.java" pinned="false" current="true" current-in-tab="true"> + <file leaf-file-name="Federate.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="265" column="33" selection-start="11524" selection-end="11524" vertical-scroll-proportion="0.15413533"> + <state line="218" column="13" selection-start="9939" selection-end="9939" vertical-scroll-proportion="0.34435797"> <folding> <element signature="imports" expanded="true" /> </folding> @@ -264,19 +251,37 @@ </provider> </entry> </file> - <file leaf-file-name="FederateMessageRetractionManager.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java"> + <file leaf-file-name="AttributeOwnershipAcquisition.java" pinned="false" current="true" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/AttributeOwnershipAcquisition.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> + <state line="21" column="13" selection-start="739" selection-end="739" vertical-scroll-proportion="0.19281663"> <folding /> </state> </provider> </entry> </file> + <file leaf-file-name="ObjectInstance.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectInstance.java"> + <provider selected="true" editor-type-id="text-editor"> + <state line="1139" column="0" selection-start="32599" selection-end="32599" vertical-scroll-proportion="0.34435797"> + <folding /> + </state> + </provider> + </entry> + </file> + <file leaf-file-name="ObjectManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java"> + <provider selected="true" editor-type-id="text-editor"> + <state line="1643" column="0" selection-start="48863" selection-end="48863" vertical-scroll-proportion="0.34435797"> + <folding /> + </state> + </provider> + </entry> + </file> <file leaf-file-name="FederateRegionManager.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="36" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0"> + <state line="673" column="0" selection-start="19845" selection-end="19845" vertical-scroll-proportion="0.34435797"> <folding /> </state> </provider> @@ -285,7 +290,7 @@ <file leaf-file-name="FederateSynchronizationPoint.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> + <state line="22" column="13" selection-start="809" selection-end="809" vertical-scroll-proportion="0.19844358"> <folding /> </state> </provider> @@ -294,7 +299,7 @@ <file leaf-file-name="FederateTimeManager.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="21" column="35" selection-start="788" selection-end="788" vertical-scroll-proportion="0.2236842"> + <state line="21" column="0" selection-start="753" selection-end="753" vertical-scroll-proportion="0.23151751"> <folding> <element signature="imports" expanded="true" /> </folding> @@ -305,7 +310,7 @@ <file leaf-file-name="SubscriptionManager.java" pinned="false" current="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> + <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06614786"> <folding /> </state> </provider> @@ -465,14 +470,6 @@ <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> @@ -495,33 +492,7 @@ <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="RTI" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> </subPane> </component> <component name="ProjectReloadState"> @@ -1018,13 +989,6 @@ <option name="myLastEditedConfigurable" /> </component> <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java"> - <provider selected="true" editor-type-id="text-editor"> - <state line="265" column="38" selection-start="9856" selection-end="9856" vertical-scroll-proportion="0.029929578"> - <folding /> - </state> - </provider> - </entry> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/Federate.java"> <provider selected="true" editor-type-id="text-editor"> <state line="150" column="0" selection-start="4647" selection-end="4647" vertical-scroll-proportion="0.029929578"> @@ -1053,66 +1017,87 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="16" column="13" selection-start="619" selection-end="619" vertical-scroll-proportion="0.06390978"> + <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> + <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06614786"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectInstance.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="36" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0"> + <state line="1139" column="0" selection-start="32599" selection-end="32599" vertical-scroll-proportion="0.34435797"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> + <state line="1643" column="0" selection-start="48863" selection-end="48863" vertical-scroll-proportion="0.34435797"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> + <state line="673" column="0" selection-start="19845" selection-end="19845" vertical-scroll-proportion="0.34435797"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="21" column="35" selection-start="788" selection-end="788" vertical-scroll-proportion="0.2236842"> - <folding> - <element signature="imports" expanded="true" /> - </folding> + <state line="18" column="13" selection-start="658" selection-end="658" vertical-scroll-proportion="0.12854442"> + <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="18" column="13" selection-start="658" selection-end="658" vertical-scroll-proportion="0.12431444"> + <state line="20" column="13" selection-start="694" selection-end="694" vertical-scroll-proportion="0.19844358"> <folding /> </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java"> + <provider selected="true" editor-type-id="text-editor"> + <state line="22" column="13" selection-start="809" selection-end="809" vertical-scroll-proportion="0.19844358"> + <folding /> + </state> + </provider> + </entry> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java"> + <provider selected="true" editor-type-id="text-editor"> + <state line="21" column="0" selection-start="753" selection-end="753" vertical-scroll-proportion="0.23151751"> + <folding> + <element signature="imports" expanded="true" /> + </folding> + </state> + </provider> + </entry> <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="265" column="33" selection-start="11524" selection-end="11524" vertical-scroll-proportion="0.15413533"> + <state line="218" column="13" selection-start="9939" selection-end="9939" vertical-scroll-proportion="0.34435797"> <folding> <element signature="imports" expanded="true" /> </folding> </state> </provider> </entry> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/AttributeOwnershipAcquisition.java"> + <provider selected="true" editor-type-id="text-editor"> + <state line="21" column="13" selection-start="739" selection-end="739" vertical-scroll-proportion="0.19281663"> + <folding /> + </state> + </provider> + </entry> </component> <component name="org.intellij.plugins.ExcludedPathsFromVcsConfiguration" /> </project> Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java 2007-02-13 03:53:01 UTC (rev 121) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java 2007-02-13 03:55:52 UTC (rev 122) @@ -19,8 +19,6 @@ import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import net.sf.ohla.rti1516.federate.Federate; -import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; import net.sf.ohla.rti1516.messages.DisableTimeConstrained; import net.sf.ohla.rti1516.messages.DisableTimeRegulation; import net.sf.ohla.rti1516.messages.EnableTimeConstrained; @@ -28,6 +26,7 @@ import net.sf.ohla.rti1516.messages.ModifyLookahead; import net.sf.ohla.rti1516.messages.TimeAdvanceRequest; import net.sf.ohla.rti1516.messages.TimeAdvanceRequestAvailable; +import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; import org.apache.mina.common.WriteFuture; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 03:53:01
|
Revision: 121 http://svn.sourceforge.net/ohla/?rev=121&view=rev Author: mnewcomb Date: 2007-02-12 19:53:01 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/build/intellij/OHLA.iws trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java Modified: trunk/build/intellij/OHLA.iws =================================================================== --- trunk/build/intellij/OHLA.iws 2007-02-13 03:51:11 UTC (rev 120) +++ trunk/build/intellij/OHLA.iws 2007-02-13 03:53:01 UTC (rev 121) @@ -20,21 +20,24 @@ </component> <component name="ChangeListManager"> <list default="true" name="Default" comment=""> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\FederateRestoreState.java" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalRegionManager.java" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalMessageRetractionManager.java" afterPath="" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java" /> <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\AttributeInstance.java" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalTimeManager.java" afterPath="" /> <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectManager.java" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java" /> - <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\FederateSaveState.java" afterPath="" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalSynchronizationPoint.java" afterPath="" /> <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectInstance.java" afterPath="" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../build.xml" afterPath="$PROJECT_DIR$/../build.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OHLA.iws" afterPath="$PROJECT_DIR$/OHLA.iws" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java" /> + <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\LocalFederate.java" afterPath="" /> </list> <list name="Failed commit: Default" comment="- removed log4j" /> <list name="Failed commit: Default (2)" comment="- refactoring" /> @@ -250,10 +253,10 @@ </provider> </entry> </file> - <file leaf-file-name="LocalFederate.java" pinned="false" current="true" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java"> + <file leaf-file-name="Federate.java" pinned="false" current="true" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="1040" column="50" selection-start="33230" selection-end="33230" vertical-scroll-proportion="0.7612782"> + <state line="265" column="33" selection-start="11524" selection-end="11524" vertical-scroll-proportion="0.15413533"> <folding> <element signature="imports" expanded="true" /> </folding> @@ -261,8 +264,8 @@ </provider> </entry> </file> - <file leaf-file-name="LocalMessageRetractionManager.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java"> + <file leaf-file-name="FederateMessageRetractionManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java"> <provider selected="true" editor-type-id="text-editor"> <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> @@ -270,8 +273,8 @@ </provider> </entry> </file> - <file leaf-file-name="LocalRegionManager.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java"> + <file leaf-file-name="FederateRegionManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java"> <provider selected="true" editor-type-id="text-editor"> <state line="0" column="36" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> @@ -279,8 +282,8 @@ </provider> </entry> </file> - <file leaf-file-name="LocalSynchronizationPoint.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java"> + <file leaf-file-name="FederateSynchronizationPoint.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java"> <provider selected="true" editor-type-id="text-editor"> <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> <folding /> @@ -288,8 +291,8 @@ </provider> </entry> </file> - <file leaf-file-name="LocalTimeManager.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java"> + <file leaf-file-name="FederateTimeManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java"> <provider selected="true" editor-type-id="text-editor"> <state line="21" column="35" selection-start="788" selection-end="788" vertical-scroll-proportion="0.2236842"> <folding> @@ -462,6 +465,14 @@ <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> @@ -484,7 +495,33 @@ <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> </PATH> + <PATH> + <PATH_ELEMENT> + <option name="myItemId" value="OHLA.ipr" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="RTI" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + <PATH_ELEMENT> + <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> + <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> + </PATH_ELEMENT> + </PATH> </subPane> </component> <component name="ProjectReloadState"> @@ -1023,21 +1060,21 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateMessageRetractionManager.java"> <provider selected="true" editor-type-id="text-editor"> <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRegionManager.java"> <provider selected="true" editor-type-id="text-editor"> <state line="0" column="36" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java"> <provider selected="true" editor-type-id="text-editor"> <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> <folding /> @@ -1051,7 +1088,7 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateTimeManager.java"> <provider selected="true" editor-type-id="text-editor"> <state line="21" column="35" selection-start="788" selection-end="788" vertical-scroll-proportion="0.2236842"> <folding> @@ -1067,9 +1104,9 @@ </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="1040" column="50" selection-start="33230" selection-end="33230" vertical-scroll-proportion="0.7612782"> + <state line="265" column="33" selection-start="11524" selection-end="11524" vertical-scroll-proportion="0.15413533"> <folding> <element signature="imports" expanded="true" /> </folding> Modified: trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 03:51:11 UTC (rev 120) +++ trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 03:53:01 UTC (rev 121) @@ -36,7 +36,7 @@ import net.sf.ohla.rti1516.OHLAObjectInstanceHandle; import net.sf.ohla.rti1516.OHLAParameterHandle; import net.sf.ohla.rti1516.OHLARegionHandleSet; -import net.sf.ohla.rti1516.federate.LocalFederate; +import net.sf.ohla.rti1516.federate.Federate; import net.sf.ohla.rti1516.fdd.ObjectClass; import org.slf4j.Logger; @@ -215,7 +215,7 @@ protected LogicalTimeIntervalFactory logicalTimeIntervalFactory; protected hla.rti1516.LogicalTimeIntervalFactory ieee1516LogicalTimeIntervalFactory; - public LocalFederate getJoinedFederate() + public Federate getJoinedFederate() { return rtiAmbassador.getJoinedFederate(); } Modified: trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 03:51:11 UTC (rev 120) +++ trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 03:53:01 UTC (rev 121) @@ -29,7 +29,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.federate.LocalFederate; +import net.sf.ohla.rti1516.federate.Federate; import net.sf.ohla.rti1516.filter.RequestResponseFilter; import net.sf.ohla.rti1516.messages.CreateFederationExecution; import net.sf.ohla.rti1516.messages.DestroyFederationExecution; @@ -193,9 +193,9 @@ */ protected Semaphore callbackSemaphore = new Semaphore(1, true); - protected LocalFederate federate; + protected Federate federate; - public LocalFederate getJoinedFederate() + public Federate getJoinedFederate() { return federate; } @@ -332,7 +332,7 @@ checkIfFederateAlreadyExecutionMember(); federate = - new LocalFederate(federateType, federationName, federateAmbassador, + new Federate(federateType, federationName, federateAmbassador, mobileFederateServices, rtiSession); return federate.getFederateHandle(); Copied: trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java (from rev 120, trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java) =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java (rev 0) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java 2007-02-13 03:53:01 UTC (rev 121) @@ -0,0 +1,4052 @@ +/* + * Copyright (c) 2006, Michael Newcomb + * + * Licensed 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 net.sf.ohla.rti1516.federate; + +import java.util.HashMap; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.Queue; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.FutureTask; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +import net.sf.ohla.rti1516.OHLAAttributeHandleFactory; +import net.sf.ohla.rti1516.OHLAAttributeHandleSetFactory; +import net.sf.ohla.rti1516.OHLAAttributeHandleValueMapFactory; +import net.sf.ohla.rti1516.OHLAAttributeSetRegionSetPairListFactory; +import net.sf.ohla.rti1516.OHLADimensionHandleFactory; +import net.sf.ohla.rti1516.OHLADimensionHandleSetFactory; +import net.sf.ohla.rti1516.OHLAFederateHandleFactory; +import net.sf.ohla.rti1516.OHLAFederateHandleSetFactory; +import net.sf.ohla.rti1516.OHLAInteractionClassHandleFactory; +import net.sf.ohla.rti1516.OHLAObjectClassHandleFactory; +import net.sf.ohla.rti1516.OHLAObjectInstanceHandleFactory; +import net.sf.ohla.rti1516.OHLAParameterHandleFactory; +import net.sf.ohla.rti1516.OHLAParameterHandleValueMapFactory; +import net.sf.ohla.rti1516.OHLARegionHandleSetFactory; +import net.sf.ohla.rti1516.fdd.FDD; +import net.sf.ohla.rti1516.federate.objects.ObjectManager; +import net.sf.ohla.rti1516.messages.FederateRestoreComplete; +import net.sf.ohla.rti1516.messages.FederateRestoreNotComplete; +import net.sf.ohla.rti1516.messages.FederateSaveBegun; +import net.sf.ohla.rti1516.messages.FederateSaveComplete; +import net.sf.ohla.rti1516.messages.FederateSaveNotComplete; +import net.sf.ohla.rti1516.messages.GALTAdvanced; +import net.sf.ohla.rti1516.messages.JoinFederationExecution; +import net.sf.ohla.rti1516.messages.JoinFederationExecutionResponse; +import net.sf.ohla.rti1516.messages.QueryFederationRestoreStatus; +import net.sf.ohla.rti1516.messages.QueryFederationSaveStatus; +import net.sf.ohla.rti1516.messages.RegisterFederationSynchronizationPoint; +import net.sf.ohla.rti1516.messages.RequestAttributeValueUpdate; +import net.sf.ohla.rti1516.messages.RequestFederationRestore; +import net.sf.ohla.rti1516.messages.RequestFederationSave; +import net.sf.ohla.rti1516.messages.Retract; +import net.sf.ohla.rti1516.messages.SendInteraction; +import net.sf.ohla.rti1516.messages.SubscribeObjectClassAttributes; +import net.sf.ohla.rti1516.messages.SynchronizationPointAchieved; +import net.sf.ohla.rti1516.messages.UnsubscribeObjectClassAttributes; +import net.sf.ohla.rti1516.messages.callbacks.Callback; +import net.sf.ohla.rti1516.messages.callbacks.CallbackManager; +import net.sf.ohla.rti1516.messages.callbacks.ReceiveInteraction; +import net.sf.ohla.rti1516.messages.callbacks.ReflectAttributeValues; +import net.sf.ohla.rti1516.messages.callbacks.RemoveObjectInstance; +import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; + +import org.apache.mina.common.IoSession; +import org.apache.mina.common.WriteFuture; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; + +import hla.rti1516.AsynchronousDeliveryAlreadyDisabled; +import hla.rti1516.AsynchronousDeliveryAlreadyEnabled; +import hla.rti1516.AttributeAcquisitionWasNotCanceled; +import hla.rti1516.AttributeAcquisitionWasNotRequested; +import hla.rti1516.AttributeAlreadyBeingAcquired; +import hla.rti1516.AttributeAlreadyBeingDivested; +import hla.rti1516.AttributeAlreadyOwned; +import hla.rti1516.AttributeDivestitureWasNotRequested; +import hla.rti1516.AttributeHandle; +import hla.rti1516.AttributeHandleFactory; +import hla.rti1516.AttributeHandleSet; +import hla.rti1516.AttributeHandleSetFactory; +import hla.rti1516.AttributeHandleValueMap; +import hla.rti1516.AttributeHandleValueMapFactory; +import hla.rti1516.AttributeNotDefined; +import hla.rti1516.AttributeNotOwned; +import hla.rti1516.AttributeNotPublished; +import hla.rti1516.AttributeNotRecognized; +import hla.rti1516.AttributeNotSubscribed; +import hla.rti1516.AttributeRegionAssociation; +import hla.rti1516.AttributeRelevanceAdvisorySwitchIsOff; +import hla.rti1516.AttributeRelevanceAdvisorySwitchIsOn; +import hla.rti1516.AttributeScopeAdvisorySwitchIsOff; +import hla.rti1516.AttributeScopeAdvisorySwitchIsOn; +import hla.rti1516.AttributeSetRegionSetPairList; +import hla.rti1516.AttributeSetRegionSetPairListFactory; +import hla.rti1516.CouldNotDiscover; +import hla.rti1516.CouldNotInitiateRestore; +import hla.rti1516.DeletePrivilegeNotHeld; +import hla.rti1516.DimensionHandle; +import hla.rti1516.DimensionHandleFactory; +import hla.rti1516.DimensionHandleSet; +import hla.rti1516.DimensionHandleSetFactory; +import hla.rti1516.FederateAlreadyExecutionMember; +import hla.rti1516.FederateAmbassador; +import hla.rti1516.FederateHandle; +import hla.rti1516.FederateHandleFactory; +import hla.rti1516.FederateHandleRestoreStatusPair; +import hla.rti1516.FederateHandleSaveStatusPair; +import hla.rti1516.FederateHandleSet; +import hla.rti1516.FederateHandleSetFactory; +import hla.rti1516.FederateHasNotBegunSave; +import hla.rti1516.FederateInternalError; +import hla.rti1516.FederateOwnsAttributes; +import hla.rti1516.FederateServiceInvocationsAreBeingReportedViaMOM; +import hla.rti1516.FederateUnableToUseTime; +import hla.rti1516.FederationExecutionDoesNotExist; +import hla.rti1516.IllegalName; +import hla.rti1516.InTimeAdvancingState; +import hla.rti1516.InteractionClassHandle; +import hla.rti1516.InteractionClassHandleFactory; +import hla.rti1516.InteractionClassNotDefined; +import hla.rti1516.InteractionClassNotPublished; +import hla.rti1516.InteractionClassNotRecognized; +import hla.rti1516.InteractionClassNotSubscribed; +import hla.rti1516.InteractionParameterNotDefined; +import hla.rti1516.InteractionParameterNotRecognized; +import hla.rti1516.InteractionRelevanceAdvisorySwitchIsOff; +import hla.rti1516.InteractionRelevanceAdvisorySwitchIsOn; +import hla.rti1516.InvalidAttributeHandle; +import hla.rti1516.InvalidDimensionHandle; +import hla.rti1516.InvalidFederateHandle; +import hla.rti1516.InvalidInteractionClassHandle; +import hla.rti1516.InvalidLogicalTime; +import hla.rti1516.InvalidLookahead; +import hla.rti1516.InvalidMessageRetractionHandle; +import hla.rti1516.InvalidObjectClassHandle; +import hla.rti1516.InvalidOrderName; +import hla.rti1516.InvalidOrderType; +import hla.rti1516.InvalidParameterHandle; +import hla.rti1516.InvalidRangeBound; +import hla.rti1516.InvalidRegion; +import hla.rti1516.InvalidRegionContext; +import hla.rti1516.InvalidTransportationName; +import hla.rti1516.InvalidTransportationType; +import hla.rti1516.JoinedFederateIsNotInTimeAdvancingState; +import hla.rti1516.LogicalTime; +import hla.rti1516.LogicalTimeAlreadyPassed; +import hla.rti1516.LogicalTimeInterval; +import hla.rti1516.MessageCanNoLongerBeRetracted; +import hla.rti1516.MessageRetractionHandle; +import hla.rti1516.MessageRetractionReturn; +import hla.rti1516.MobileFederateServices; +import hla.rti1516.NameNotFound; +import hla.rti1516.NoRequestToEnableTimeConstrainedWasPending; +import hla.rti1516.NoRequestToEnableTimeRegulationWasPending; +import hla.rti1516.ObjectClassHandle; +import hla.rti1516.ObjectClassHandleFactory; +import hla.rti1516.ObjectClassNotDefined; +import hla.rti1516.ObjectClassNotPublished; +import hla.rti1516.ObjectClassNotRecognized; +import hla.rti1516.ObjectClassRelevanceAdvisorySwitchIsOff; +import hla.rti1516.ObjectClassRelevanceAdvisorySwitchIsOn; +import hla.rti1516.ObjectInstanceHandle; +import hla.rti1516.ObjectInstanceHandleFactory; +import hla.rti1516.ObjectInstanceNameInUse; +import hla.rti1516.ObjectInstanceNameNotReserved; +import hla.rti1516.ObjectInstanceNotKnown; +import hla.rti1516.OrderType; +import hla.rti1516.OwnershipAcquisitionPending; +import hla.rti1516.ParameterHandle; +import hla.rti1516.ParameterHandleFactory; +import hla.rti1516.ParameterHandleValueMap; +import hla.rti1516.ParameterHandleValueMapFactory; +import hla.rti1516.RTIinternalError; +import hla.rti1516.RangeBounds; +import hla.rti1516.RegionDoesNotContainSpecifiedDimension; +import hla.rti1516.RegionHandle; +import hla.rti1516.RegionHandleSet; +import hla.rti1516.RegionHandleSetFactory; +import hla.rti1516.RegionInUseForUpdateOrSubscription; +import hla.rti1516.RegionNotCreatedByThisFederate; +import hla.rti1516.RequestForTimeConstrainedPending; +import hla.rti1516.RequestForTimeRegulationPending; +import hla.rti1516.ResignAction; +import hla.rti1516.RestoreFailureReason; +import hla.rti1516.RestoreInProgress; +import hla.rti1516.RestoreNotRequested; +import hla.rti1516.SaveFailureReason; +import hla.rti1516.SaveInProgress; +import hla.rti1516.SaveNotInitiated; +import hla.rti1516.SaveStatus; +import hla.rti1516.ServiceGroup; +import hla.rti1516.SpecifiedSaveLabelDoesNotExist; +import hla.rti1516.SynchronizationPointFailureReason; +import hla.rti1516.SynchronizationPointLabelNotAnnounced; +import hla.rti1516.TimeConstrainedAlreadyEnabled; +import hla.rti1516.TimeConstrainedIsNotEnabled; +import hla.rti1516.TimeQueryReturn; +import hla.rti1516.TimeRegulationAlreadyEnabled; +import hla.rti1516.TimeRegulationIsNotEnabled; +import hla.rti1516.TransportationType; +import hla.rti1516.UnableToPerformSave; +import hla.rti1516.UnknownName; +import hla.rti1516.RestoreStatus; +import hla.rti1516.jlc.NullFederateAmbassador; + +public class Federate +{ + public static final String OHLA_FEDERATE_HOST_PROPERTY = + "ohla.federate.%s.host"; + public static final String OHLA_FEDERATE_PORT_PROPERTY = + "ohla.federate.%s.port"; + + public enum LocalFederateState + { + ACTIVE, SAVE_IN_PROGRESS, RESTORE_IN_PROGRESS + } + + protected final String federateType; + protected final String federationExecutionName; + protected final FederateAmbassador federateAmbassador; + protected final MobileFederateServices mobileFederateServices; + + protected final FederateAmbassador federateAmbassadorInterceptor = + new FederateAmbassadorInterceptor(); + + protected FederateHandle federateHandle; + + protected String federationName; + protected FDD fdd; + + protected LocalFederateState federateState = LocalFederateState.ACTIVE; + + protected ReadWriteLock federateStateLock = + new ReentrantReadWriteLock(true); + + protected SaveStatus saveStatus; + protected FederateSave federateSave; + + protected RestoreStatus restoreStatus; + protected FederateRestore federateRestore; + + protected Lock synchronizationPointLock = new ReentrantLock(true); + protected Map<String, FederateSynchronizationPoint> synchronizationPoints = + new HashMap<String, FederateSynchronizationPoint>(); + + protected boolean asynchronousDeliveryEnabled; + + protected ObjectManager objectManager = new ObjectManager(this); + protected FederateRegionManager regionManager = new FederateRegionManager(this); + protected FederateMessageRetractionManager messageRetractionManager = + new FederateMessageRetractionManager(this); + + protected FederateTimeManager timeManager; + protected CallbackManager callbackManager = new CallbackManager(this); + + protected Lock futureTasksLock = new ReentrantLock(true); + protected Queue<TimestampedFutureTask> futureTasks = + new PriorityQueue<TimestampedFutureTask>(); + + protected AttributeHandleFactory attributeHandleFactory = + new OHLAAttributeHandleFactory(); + protected AttributeHandleSetFactory attributeHandleSetFactory = + new OHLAAttributeHandleSetFactory(); + protected AttributeHandleValueMapFactory attributeHandleValueMapFactory = + new OHLAAttributeHandleValueMapFactory(); + protected AttributeSetRegionSetPairListFactory attributeSetRegionSetPairListFactory = + new OHLAAttributeSetRegionSetPairListFactory(); + protected DimensionHandleFactory dimensionHandleFactory = + new OHLADimensionHandleFactory(); + protected DimensionHandleSetFactory dimensionHandleSetFactory = + new OHLADimensionHandleSetFactory(); + protected FederateHandleFactory federateHandleFactory = + new OHLAFederateHandleFactory(); + protected FederateHandleSetFactory federateHandleSetFactory = + new OHLAFederateHandleSetFactory(); + protected InteractionClassHandleFactory interactionClassHandleFactory = + new OHLAInteractionClassHandleFactory(); + protected ObjectClassHandleFactory objectClassHandleFactory = + new OHLAObjectClassHandleFactory(); + protected ObjectInstanceHandleFactory objectInstanceHandleFactory = + new OHLAObjectInstanceHandleFactory(); + protected ParameterHandleFactory parameterHandleFactory = + new OHLAParameterHandleFactory(); + protected ParameterHandleValueMapFactory parameterHandleValueMapFactory = + new OHLAParameterHandleValueMapFactory(); + protected RegionHandleSetFactory regionHandleSetFactory = + new OHLARegionHandleSetFactory(); + + /** + * The session with the RTI. + */ + protected IoSession rtiSession; + + protected final Logger log = LoggerFactory.getLogger(getClass()); + protected final Marker marker; + + public Federate(String federateType, String federationExecutionName, + FederateAmbassador federateAmbassador, + MobileFederateServices mobileFederateServices, + IoSession rtiSession) + throws FederationExecutionDoesNotExist, SaveInProgress, RestoreInProgress, + RTIinternalError + { + this.federateType = federateType; + this.federationExecutionName = federationExecutionName; + this.federateAmbassador = federateAmbassador; + this.mobileFederateServices = mobileFederateServices; + this.rtiSession = rtiSession; + + marker = MarkerFactory.getMarker(federateType); + + JoinFederationExecution joinFederationExecution = + new JoinFederationExecution( + federateType, federationExecutionName, mobileFederateServices); + WriteFuture writeFuture = rtiSession.write(joinFederationExecution); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + try + { + // TODO: set timeout + // + Object response = joinFederationExecution.getResponse(); + if (response instanceof JoinFederationExecutionResponse) + { + JoinFederationExecutionResponse joinFederationExecutionResponse = + (JoinFederationExecutionResponse) response; + + federateHandle = joinFederationExecutionResponse.getFederateHandle(); + fdd = joinFederationExecutionResponse.getFdd(); + + LogicalTime galt = joinFederationExecutionResponse.getGALT(); + timeManager = new FederateTimeManager(this, mobileFederateServices, galt); + + log.info(marker, "joined federation execution: {}", federateHandle); + } + else if (response instanceof FederationExecutionDoesNotExist) + { + throw new FederationExecutionDoesNotExist( + (FederationExecutionDoesNotExist) response); + } + else if (response instanceof SaveInProgress) + { + throw new SaveInProgress((SaveInProgress) response); + } + else if (response instanceof RestoreInProgress) + { + throw new RestoreInProgress((RestoreInProgress) response); + } + else + { + assert false : String.format("unexpected response: %s", response); + } + } + catch (InterruptedException ie) + { + throw new RTIinternalError("interrupted awaiting timeout", ie); + } + catch (ExecutionException ee) + { + throw new RTIinternalError("unable to get response", ee); + } + } + + public FederateHandle getFederateHandle() + { + return federateHandle; + } + + public FederateAmbassador getFederateAmbassador() + { + return federateAmbassadorInterceptor; + } + + public FDD getFDD() + { + return fdd; + } + + public ObjectManager getObjectManager() + { + return objectManager; + } + + public FederateRegionManager getRegionManager() + { + return regionManager; + } + + public FederateMessageRetractionManager getMessageRetractionManager() + { + return messageRetractionManager; + } + + public FederateTimeManager getTimeManager() + { + return timeManager; + } + + public CallbackManager getCallbackManager() + { + return callbackManager; + } + + public IoSession getRTISession() + { + return rtiSession; + } + + public boolean isAsynchronousDeliveryEnabled() + { + return asynchronousDeliveryEnabled; + } + + public void processFutureTasks(LogicalTime maxFutureTaskTimestamp) + { + futureTasksLock.lock(); + try + { + log.debug(marker, "processing future tasks: {}", maxFutureTaskTimestamp); + + for (TimestampedFutureTask timestampedFutureTask = futureTasks.peek(); + timestampedFutureTask != null && + timestampedFutureTask.getTime().compareTo( + maxFutureTaskTimestamp) <= 0; + timestampedFutureTask = futureTasks.peek()) + { + log.debug(marker, "processing future task: {}", timestampedFutureTask); + + try + { + timestampedFutureTask.run(); + } + catch (Throwable t) + { + log.error(marker, String.format("unable to execute scheduled task: %s", + timestampedFutureTask), t); + } + + futureTasks.poll(); + } + } + finally + { + futureTasksLock.unlock(); + } + } + + public boolean process(IoSession session, Object message) + { + log.debug(marker, "processing: {}", message); + + boolean processed = true; + if (message instanceof Callback) + { + if (message instanceof ReflectAttributeValues) + { + ReflectAttributeValues reflectAttributeValues = + (ReflectAttributeValues) message; + + timeManager.getTimeLock().readLock().lock(); + try + { + OrderType receivedOrderType = + reflectAttributeValues.getSentOrderType() == OrderType.TIMESTAMP && + timeManager.isTimeConstrained() ? OrderType.TIMESTAMP : + OrderType.RECEIVE; + reflectAttributeValues.setReceivedOrderType(receivedOrderType); + + if (receivedOrderType == OrderType.RECEIVE) + { + // receive order callbacks need to be held until released if we + // are constrained and in the time granted state if asynchronous + // delivery is disabled + // + boolean hold = timeManager.isTimeConstrainedAndTimeGranted() && + !isAsynchronousDeliveryEnabled(); + + callbackManager.add(reflectAttributeValues, hold); + } + else + { + // schedule the callback for the appropriate time + // + Future future = schedule( + reflectAttributeValues.getUpdateTime(), + new AddCallback(reflectAttributeValues)); + + // register the message retraction handle + // + messageRetractionManager.add( + reflectAttributeValues.getUpdateTime(), future, + reflectAttributeValues.getMessageRetractionHandle()); + } + } + finally + { + timeManager.getTimeLock().readLock().unlock(); + } + } + else if (message instanceof ReceiveInteraction) + { + ReceiveInteraction receiveInteraction = (ReceiveInteraction) message; + + timeManager.getTimeLock().readLock().lock(); + try + { + OrderType receivedOrderType = + receiveInteraction.getSentOrderType() == OrderType.TIMESTAMP && + timeManager.isTimeConstrained() ? OrderType.TIMESTAMP : + OrderType.RECEIVE; + + receiveInteraction.setReceivedOrderType(receivedOrderType); + + if (receivedOrderType == OrderType.RECEIVE) + { + // receive order callbacks need to be held until released if we + // are constrained and in the time granted state, if asynchronous + // delivery is disabled + // + boolean hold = timeManager.isTimeConstrainedAndTimeGranted() && + !isAsynchronousDeliveryEnabled(); + + callbackManager.add(receiveInteraction, hold); + } + else + { + // schedule the callback for the appropriate time + // + Future future = schedule(receiveInteraction.getSendTime(), + new AddCallback(receiveInteraction)); + + // register the message retraction handle + // + messageRetractionManager.add( + receiveInteraction.getSendTime(), future, + receiveInteraction.getMessageRetractionHandle()); + } + } + finally + { + timeManager.getTimeLock().readLock().unlock(); + } + } + else if (message instanceof RemoveObjectInstance) + { + RemoveObjectInstance removeObjectInstance = + (RemoveObjectInstance) message; + + timeManager.getTimeLock().readLock().lock(); + try + { + OrderType receivedOrderType = + removeObjectInstance.getSentOrderType() == OrderType.TIMESTAMP && + timeManager.isTimeConstrained() ? OrderType.TIMESTAMP : + OrderType.RECEIVE; + + removeObjectInstance.setReceivedOrderType(receivedOrderType); + + if (receivedOrderType == OrderType.RECEIVE) + { + // receive order callbacks need to be held until released if we + // are constrained and in the time granted state, if asynchronous + // delivery is disabled + // + boolean hold = timeManager.isTimeConstrainedAndTimeGranted() && + !isAsynchronousDeliveryEnabled(); + + callbackManager.add(removeObjectInstance, hold); + } + else + { + // schedule the callback for the appropriate time + // + Future future = schedule(removeObjectInstance.getDeleteTime(), + new AddCallback(removeObjectInstance)); + + // register the message retraction handle + // + messageRetractionManager.add( + removeObjectInstance.getDeleteTime(), future, + removeObjectInstance.getMessageRetractionHandle()); + } + } + finally + { + timeManager.getTimeLock().readLock().unlock(); + } + } + else + { + if (message instanceof TimeAdvanceGrant) + { + processFutureTasks(((TimeAdvanceGrant) message).getTime()); + } + + callbackManager.add((Callback) message); + } + } + else if (message instanceof GALTAdvanced) + { + GALTAdvanced galtAdvanced = (GALTAdvanced) message; + + LogicalTime galt = galtAdvanced.getGALT(); + + timeManager.galtAdvanced(galt); + } + else + { + processed = false; + } + return processed; + } + + public void resignFederationExecution(ResignAction resignAction) + throws OwnershipAcquisitionPending, FederateOwnsAttributes, + RTIinternalError + { + federateStateLock.writeLock().lock(); + try + { + objectManager.resignFederationExecution(resignAction); + + federateState = null; + } + finally + { + federateStateLock.writeLock().unlock(); + } + } + + public void registerFederationSynchronizationPoint(String label, byte[] tag) + throws SaveInProgress, RestoreInProgress, RTIinternalError + { + registerFederationSynchronizationPoint(label, tag, null); + } + + public void registerFederationSynchronizationPoint( + String label, byte[] tag, FederateHandleSet federateHandles) + throws SaveInProgress, RestoreInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + writeFuture = rtiSession.write( + new RegisterFederationSynchronizationPoint( + label, tag, federateHandles)); + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void synchronizationPointAchieved(String label) + throws SynchronizationPointLabelNotAnnounced, SaveInProgress, + RestoreInProgress, RTIinternalError + { + WriteFuture writeFuture = null; + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + synchronizationPointLock.lock(); + try + { + FederateSynchronizationPoint federateSynchronizationPoint = + synchronizationPoints.get(label); + if (federateSynchronizationPoint == null) + { + throw new SynchronizationPointLabelNotAnnounced(label); + } + else + { + federateSynchronizationPoint.synchronizationPointAchieved(); + + writeFuture = + rtiSession.write(new SynchronizationPointAchieved(label)); + } + } + finally + { + synchronizationPointLock.unlock(); + } + } + finally + { + federateStateLock.readLock().unlock(); + } + + if (writeFuture != null) + { + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + } + + public void requestFederationSave(String label) + throws SaveInProgress, RestoreInProgress, RTIinternalError + { + federateStateLock.writeLock().lock(); + try + { + checkIfActive(); + + RequestFederationSave requestFederationSave = + new RequestFederationSave(label); + WriteFuture writeFuture = rtiSession.write(requestFederationSave); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + // TODO: set timeout + // + Object response = requestFederationSave.getResponse(); + if (response instanceof SaveInProgress) + { + throw new SaveInProgress((SaveInProgress) response); + } + else if (response instanceof RestoreInProgress) + { + throw new RestoreInProgress((RestoreInProgress) response); + } + else + { + assert response == null : + String.format("unexpected response: %s", response); + } + } + catch (InterruptedException ie) + { + throw new RTIinternalError("interrupted awaiting timeout", ie); + } + catch (ExecutionException ee) + { + throw new RTIinternalError("unable to get response", ee); + } + finally + { + federateStateLock.writeLock().unlock(); + } + } + + public void requestFederationSave(String label, LogicalTime saveTime) + throws LogicalTimeAlreadyPassed, InvalidLogicalTime, + FederateUnableToUseTime, SaveInProgress, RestoreInProgress, + RTIinternalError + { + federateStateLock.writeLock().lock(); + try + { + checkIfActive(); + + // no need to lock time manager because we have a write lock on the + // federate state + // + timeManager.checkIfLogicalTimeAlreadyPassed(saveTime); + + RequestFederationSave requestFederationSave = + new RequestFederationSave(label, saveTime); + WriteFuture writeFuture = rtiSession.write(requestFederationSave); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + // TODO: set timeout + // + Object response = requestFederationSave.getResponse(); + if (response instanceof LogicalTimeAlreadyPassed) + { + throw new LogicalTimeAlreadyPassed((LogicalTimeAlreadyPassed) response); + } + else if (response instanceof SaveInProgress) + { + throw new SaveInProgress((SaveInProgress) response); + } + else if (response instanceof RestoreInProgress) + { + throw new RestoreInProgress((RestoreInProgress) response); + } + else + { + assert false : String.format("unexpected response: %s", response); + } + } + catch (InterruptedException ie) + { + throw new RTIinternalError("interrupted awaiting timeout", ie); + } + catch (ExecutionException ee) + { + throw new RTIinternalError("unable to get response", ee); + } + finally + { + federateStateLock.writeLock().unlock(); + } + } + + public void federateSaveBegun() + throws SaveNotInitiated, RestoreInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + if (saveStatus != SaveStatus.FEDERATE_INSTRUCTED_TO_SAVE) + { + throw new SaveNotInitiated(); + } + + writeFuture = rtiSession.write(new FederateSaveBegun()); + + saveStatus = SaveStatus.FEDERATE_SAVING; + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void federateSaveComplete() + throws FederateHasNotBegunSave, RestoreInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + checkIfRestoreInProgress(); + + if (saveStatus != SaveStatus.FEDERATE_SAVING) + { + throw new FederateHasNotBegunSave(); + } + + writeFuture = rtiSession.write(new FederateSaveComplete(null)); + + saveStatus = SaveStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_SAVE; + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void federateSaveNotComplete() + throws FederateHasNotBegunSave, RestoreInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + checkIfRestoreInProgress(); + + if (saveStatus != SaveStatus.FEDERATE_SAVING) + { + throw new FederateHasNotBegunSave(); + } + + writeFuture = rtiSession.write(new FederateSaveNotComplete()); + + saveStatus = SaveStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_SAVE; + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void queryFederationSaveStatus() + throws RestoreInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + checkIfRestoreInProgress(); + + writeFuture = rtiSession.write(new QueryFederationSaveStatus()); + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void requestFederationRestore(String label) + throws SaveInProgress, RestoreInProgress, RTIinternalError + { + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + RequestFederationRestore requestFederationRestore = + new RequestFederationRestore(label); + WriteFuture writeFuture = rtiSession.write(requestFederationRestore); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + // TODO: set timeout + // + Object response = requestFederationRestore.getResponse(); + if (response instanceof SaveInProgress) + { + throw new SaveInProgress((SaveInProgress) response); + } + else if (response instanceof RestoreInProgress) + { + throw new RestoreInProgress((RestoreInProgress) response); + } + else + { + assert false : String.format("unexpected response: %s", response); + } + } + catch (InterruptedException ie) + { + throw new RTIinternalError("interrupted awaiting timeout", ie); + } + catch (ExecutionException ee) + { + throw new RTIinternalError("unable to get response", ee); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void federateRestoreComplete() + throws RestoreNotRequested, SaveInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + checkIfSaveInProgress(); + + if (restoreStatus != RestoreStatus.FEDERATE_RESTORING) + { + throw new RestoreNotRequested(); + } + + writeFuture = rtiSession.write(new FederateRestoreComplete()); + + restoreStatus = RestoreStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_RESTORE; + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void federateRestoreNotComplete() + throws RestoreNotRequested, SaveInProgress, RTIinternalError + { + WriteFuture writeFuture; + + federateStateLock.readLock().lock(); + try + { + checkIfSaveInProgress(); + + if (restoreStatus != RestoreStatus.FEDERATE_RESTORING) + { + throw new RestoreNotRequested(); + } + + writeFuture = rtiSession.write(new FederateRestoreNotComplete()); + + restoreStatus = RestoreStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_RESTORE; + } + finally + { + federateStateLock.readLock().unlock(); + } + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + public void queryFederationRestoreStatus() + throws SaveInProgress, RTIinternalError + { + federateStateLock.readLock().lock(); + try + { + checkIfSaveInProgress(); + + WriteFuture writeFuture = + rtiSession.write(new QueryFederationRestoreStatus()); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void publishObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) + throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, + RestoreInProgress, RTIinternalError + { + // ensure we have a valid object class and attribute handles + // + fdd.checkIfAttributeNotDefined(objectClassHandle, attributeHandles); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.publishObjectClassAttributes( + objectClassHandle, attributeHandles); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void unpublishObjectClass(ObjectClassHandle objectClassHandle) + throws ObjectClassNotDefined, OwnershipAcquisitionPending, + SaveInProgress, RestoreInProgress, RTIinternalError + { + // ensure we have a valid object class handle + // + fdd.checkIfObjectClassNotDefined(objectClassHandle); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.unpublishObjectClass(objectClassHandle); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void unpublishObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) + throws ObjectClassNotDefined, AttributeNotDefined, + OwnershipAcquisitionPending, SaveInProgress, RestoreInProgress, + RTIinternalError + { + // ensure we have a valid object class handle + // + fdd.checkIfObjectClassNotDefined(objectClassHandle); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.unpublishObjectClassAttributes( + objectClassHandle, attributeHandles); + + // TODO: give up ownership of the specified attributes + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void publishInteractionClass( + InteractionClassHandle interactionClassHandle) + throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, + RTIinternalError + { + // ensure we have a valid interaction class handle + // + fdd.checkIfInteractionClassNotDefined(interactionClassHandle); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.publishInteractionClass(interactionClassHandle); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void unpublishInteractionClass( + InteractionClassHandle interactionClassHandle) + throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, + RTIinternalError + { + // ensure we have a valid interaction class handle + // + fdd.checkIfInteractionClassNotDefined(interactionClassHandle); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.unpublishInteractionClass(interactionClassHandle); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void subscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) + throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, + RestoreInProgress, RTIinternalError + { + subscribeObjectClassAttributes(objectClassHandle, attributeHandles, false); + } + + public void subscribeObjectClassAttributesPassively( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) + throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, + RestoreInProgress, RTIinternalError + { + subscribeObjectClassAttributes(objectClassHandle, attributeHandles, true); + } + + protected void subscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles, + boolean passive) + throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, + RestoreInProgress, RTIinternalError + { + // ensure we have a valid object class and attribute handles + // + fdd.checkIfAttributeNotDefined(objectClassHandle, attributeHandles); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.subscribeObjectClassAttributes( + objectClassHandle, attributeHandles, passive); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void unsubscribeObjectClass(ObjectClassHandle objectClassHandle) + throws ObjectClassNotDefined, SaveInProgress, RestoreInProgress, + RTIinternalError + { + // ensure we have a valid object class handle + // + fdd.checkIfObjectClassNotDefined(objectClassHandle); + + federateStateLock.readLock().lock(); + try + { + checkIfActive(); + + objectManager.unsubscribeObjectClass(objectClassHandle); + } + finally + { + federateStateLock.readLock().unlock(); + } + } + + public void unsubscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) + throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, + RestoreInProgress, RTIinternalError + { + // ensure we have a valid object class handle + // + fdd.checkIfObjectClassNotDefined(object... [truncated message content] |
From: <mne...@us...> - 2007-02-13 03:51:12
|
Revision: 120 http://svn.sourceforge.net/ohla/?rev=120&view=rev Author: mnewcomb Date: 2007-02-12 19:51:11 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/build/build.xml trunk/build/intellij/OHLA.iws trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateRestoreState.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateSaveState.java Modified: trunk/build/build.xml =================================================================== --- trunk/build/build.xml 2007-02-13 03:29:52 UTC (rev 119) +++ trunk/build/build.xml 2007-02-13 03:51:11 UTC (rev 120) @@ -322,17 +322,8 @@ <jvmarg value="-ea"/> - <jvmarg value="-Dohla.rti.host=localhost"/> - <jvmarg value="-Dohla.rti.port=5000"/> - - <!--<jvmarg value="-Dohla.federate.Test Federate.host=localhost"/>--> - <!--<jvmarg value="-Dohla.federate.Test Federate.port=5001"/>--> -<!----> - <!--<jvmarg value="-Dohla.federate.Test Federate2.host=localhost"/>--> - <!--<jvmarg value="-Dohla.federate.Test Federate2.port=5002"/>--> -<!----> - <!--<jvmarg value="-Dohla.federate.Test Federate3.host=localhost"/>--> - <!--<jvmarg value="-Dohla.federate.Test Federate3.port=5003"/>--> + <sysproperty key="ohla.rti.host" value="localhost"/> + <sysproperty key="ohla.rti.port" value="5000"/> </testng> </target> @@ -356,17 +347,17 @@ <jvmarg value="-ea"/> - <jvmarg value="-Dohla.rti.host=localhost"/> - <jvmarg value="-Dohla.rti.port=5000"/> + <sysproperty key="ohla.rti.host" value="localhost"/> + <sysproperty key="ohla.rti.port" value="5000"/> <sysproperty key="ohla.federate.rti.logicalTimeFactory" value="net.sf.ohla.rti.Integer64TimeFactory"/> <sysproperty key="ohla.federate.rti.logicalTimeIntervalFactory" value="net.sf.ohla.rti.Integer64TimeIntervalFactory"/> <sysproperty key="ohla.federate.rti1516.logicalTimeFactory" - value="net.sf.ohla.rti1516.Integer64TimeFactory"/> + value="net.sf.ohla.rti1516.impl.Integer64TimeFactory"/> <sysproperty key="ohla.federate.rti1516.logicalTimeIntervalFactory" - value="net.sf.ohla.rti1516.Integer64TimeIntervalFactory"/> + value="net.sf.ohla.rti1516.impl.Integer64TimeIntervalFactory"/> </testng> </target> Modified: trunk/build/intellij/OHLA.iws =================================================================== --- trunk/build/intellij/OHLA.iws 2007-02-13 03:29:52 UTC (rev 119) +++ trunk/build/intellij/OHLA.iws 2007-02-13 03:51:11 UTC (rev 120) @@ -20,15 +20,24 @@ </component> <component name="ChangeListManager"> <list default="true" name="Default" comment=""> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../resources/logback-test.xml" afterPath="$PROJECT_DIR$/../../resources/logback-test.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../resources/testsuite/ieee-1516-testng.xml" afterPath="$PROJECT_DIR$/../../resources/testsuite/ieee-1516-testng.xml" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/TimeAdvanceGrant.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/TimeAdvanceGrant.java" /> - <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/TimeManagementTestNG.java" afterPath="$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/TimeManagementTestNG.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\FederateRestoreState.java" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\AttributeInstance.java" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectManager.java" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federate\FederateSaveState.java" afterPath="" /> + <change type="DELETED" beforePath="D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\local\objects\ObjectInstance.java" afterPath="" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../build.xml" afterPath="$PROJECT_DIR$/../build.xml" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/OHLA.iws" afterPath="$PROJECT_DIR$/OHLA.iws" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java" /> + <change type="MODIFICATION" beforePath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java" afterPath="$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java" /> </list> <list name="Failed commit: Default" comment="- removed log4j" /> + <list name="Failed commit: Default (2)" comment="- refactoring" /> </component> <component name="ChangeListSynchronizer" /> <component name="ChangesViewManager" flattened_view="true" /> @@ -223,98 +232,82 @@ </component> <component name="FileEditorManager"> <leaf> - <file leaf-file-name="Federate.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java"> + <file leaf-file-name="FederateRestore.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="428" column="14" selection-start="16700" selection-end="16700" vertical-scroll-proportion="0.33252132"> - <folding> - <element signature="imports" expanded="true" /> - </folding> - </state> - </provider> - </entry> - </file> - <file leaf-file-name="ObjectManagementTestNG.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/ObjectManagementTestNG.java"> - <provider selected="true" editor-type-id="text-editor"> - <state line="15" column="0" selection-start="605" selection-end="605" vertical-scroll-proportion="0.020706456"> + <state line="18" column="13" selection-start="658" selection-end="658" vertical-scroll-proportion="0.12431444"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="TimeAdvanceGrant.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/TimeAdvanceGrant.java"> + <file leaf-file-name="FederateSave.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="35" column="3" selection-start="1062" selection-end="1062" vertical-scroll-proportion="0.35200974"> + <state line="16" column="13" selection-start="619" selection-end="619" vertical-scroll-proportion="0.06390978"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="TimeManager.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java"> + <file leaf-file-name="LocalFederate.java" pinned="false" current="true" current-in-tab="true"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="675" column="14" selection-start="18064" selection-end="18064" vertical-scroll-proportion="0.39464068"> - <folding /> + <state line="1040" column="50" selection-start="33230" selection-end="33230" vertical-scroll-proportion="0.7612782"> + <folding> + <element signature="imports" expanded="true" /> + </folding> </state> </provider> </entry> </file> - <file leaf-file-name="OHLARTIambassador.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java"> + <file leaf-file-name="LocalMessageRetractionManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="2938" column="0" selection-start="79846" selection-end="79846" vertical-scroll-proportion="0.020706456"> + <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="TestObjectModel.xml" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../resources/testsuite/TestObjectModel.xml"> + <file leaf-file-name="LocalRegionManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> + <state line="0" column="36" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="TimeManagementTestNG.java" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/TimeManagementTestNG.java"> + <file leaf-file-name="LocalSynchronizationPoint.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> + <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="ieee-1516-testng.xml" pinned="false" current="true" current-in-tab="true"> - <entry file="file://$PROJECT_DIR$/../../resources/testsuite/ieee-1516-testng.xml"> + <file leaf-file-name="LocalTimeManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="22" column="9" selection-start="909" selection-end="909" vertical-scroll-proportion="0.041412912"> - <folding /> + <state line="21" column="35" selection-start="788" selection-end="788" vertical-scroll-proportion="0.2236842"> + <folding> + <element signature="imports" expanded="true" /> + </folding> </state> </provider> </entry> </file> - <file leaf-file-name="logback-test.xml" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../../resources/logback-test.xml"> + <file leaf-file-name="SubscriptionManager.java" pinned="false" current="false" current-in-tab="false"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="24" column="46" selection-start="945" selection-end="945" vertical-scroll-proportion="0.35200974"> + <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> <folding /> </state> </provider> </entry> </file> - <file leaf-file-name="build.xml" pinned="false" current="false" current-in-tab="false"> - <entry file="file://$PROJECT_DIR$/../build.xml"> - <provider selected="true" editor-type-id="text-editor"> - <state line="44" column="0" selection-start="1897" selection-end="1897" vertical-scroll-proportion="0.020706456"> - <folding /> - </state> - </provider> - </entry> - </file> </leaf> </component> <component name="FindManager"> @@ -403,10 +396,6 @@ <option name="myItemId" value="OHLA.ipr" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Testsuite" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> @@ -414,62 +403,6 @@ <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> - <option name="myItemId" value="Testsuite" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src\java" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src\java\net\sf\ohla" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src\java\net\sf\ohla\rti1516" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="Testsuite" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src\java" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\testsuite\src\java\net\sf\ohla" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> <option name="myItemId" value="RTI" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> </PATH_ELEMENT> @@ -529,14 +462,6 @@ <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\handles" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> @@ -559,286 +484,14 @@ <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federation" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="RTI" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federation" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla\rti1516\federation\time" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="RTI" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\net\sf\ohla" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="RTI" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\rti\src\java\hla\rti1516\jlc\omt" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\slf4j" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\slf4j" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\slf4j\lib" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\logback" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\logback" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\logback\lib" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\apache" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - <PATH_ELEMENT> - <option name="myItemId" value="PsiDirectory:D:\projects\ohla-0.4\thirdparty\apache\mina" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT> - <option name="myItemId" value="OHLA.ipr" /> - <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> - </PATH_ELEMENT> - </PATH> </subPane> </component> <component name="ProjectReloadState"> <option name="STATE" value="0" /> </component> <component name="ProjectView"> - <navigator currentView="Scope" currentSubView="Project" proportions="0.16666667" version="1" splitterProportion="0.5"> + <navigator currentView="ProjectPane" proportions="0.16666667" version="1" splitterProportion="0.5"> <flattenPackages ProjectPane="false" /> <showMembers /> <showModules /> @@ -864,8 +517,8 @@ <property name="cvs_file_history_flatOrder1" value="1" /> <property name="cvs_file_history_flatWidth1" value="299" /> <property name="cvs_file_history_treeWidth1" value="299" /> - <property name="cvs_file_history_treeOrder2" value="2" /> <property name="cvs_file_history_treeWidth3" value="298" /> + <property name="cvs_file_history_treeOrder2" value="2" /> <property name="GoToClass.includeLibraries" value="false" /> <property name="cvs_file_history_flatOrder2" value="2" /> <property name="MemberChooser.showClasses" value="true" /> @@ -874,30 +527,23 @@ <property name="cvs_file_history_treeWidth2" value="299" /> <property name="cvs_file_history_flatOrder3" value="3" /> <property name="GoToClass.toSaveIncludeLibraries" value="false" /> - <property name="RunManagerConfig.showSettingsBeforeRunnig" value="true" /> <property name="cvs_file_history_treeOrder0" value="0" /> + <property name="RunManagerConfig.showSettingsBeforeRunnig" value="true" /> </component> <component name="ReadonlyStatusHandler"> <option name="SHOW_DIALOG" value="true" /> </component> <component name="RecentsManager"> <key name="MoveClassesOrPackagesDialog.RECENTS_KEY"> - <recent name="net.sf.ohla.rti1516.messages" /> - <recent name="net.sf.ohla" /> - <recent name="net.sf.ohla.rti" /> <recent name="net.sf.ohla.rti1516" /> - <recent name="net.sf.ohla.rti.ieee1516.impl.jlc" /> + <recent name="net.sf.ohla.rti1516.impl" /> + <recent name="net.sf.ohla.rti1516.federate" /> + <recent name="net.sf.ohla.rti1516.federation" /> + <recent name="net.sf.ohla.rti1516.messages" /> </key> </component> <component name="RestoreUpdateTree" /> <component name="RunManager" selected="Application.RTI"> - <configuration default="true" type="Remote" factoryName="Remote"> - <option name="USE_SOCKET_TRANSPORT" value="true" /> - <option name="SERVER_MODE" value="false" /> - <option name="SHMEM_ADDRESS" value="javadebug" /> - <option name="HOST" value="localhost" /> - <option name="PORT" value="5005" /> - </configuration> <configuration default="true" type="Applet" factoryName="Applet"> <module name="" /> <option name="MAIN_CLASS_NAME" /> @@ -910,6 +556,13 @@ <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> <option name="ALTERNATIVE_JRE_PATH" /> </configuration> + <configuration default="true" type="Remote" factoryName="Remote"> + <option name="USE_SOCKET_TRANSPORT" value="true" /> + <option name="SERVER_MODE" value="false" /> + <option name="SHMEM_ADDRESS" value="javadebug" /> + <option name="HOST" value="localhost" /> + <option name="PORT" value="5005" /> + </configuration> <configuration default="true" type="Application" factoryName="Application" enabled="false" merge="false"> <option name="MAIN_CLASS_NAME" /> <option name="VM_PARAMETERS" /> @@ -1039,144 +692,12 @@ <option name="myItemId" value="" /> <option name="myItemType" value="" /> </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="Testsuite"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="testsuite/src/java/net/sf/ohla"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti1516"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT USER_OBJECT="Root"> <option name="myItemId" value="" /> <option name="myItemType" value="" /> </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="Testsuite"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="testsuite/src/java/net/sf/ohla"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="RTI"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti/src/java"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="net/sf/ohla"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti1516"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="RTI"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti/src/java"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="net/sf/ohla"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti1516"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="federation"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="RTI"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti/src/java"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="net/sf/ohla"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti1516"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="federate"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="RTI"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti/src/java"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="net/sf/ohla"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="RTI"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - <PATH_ELEMENT USER_OBJECT="rti/src/java"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> <PATH_ELEMENT USER_OBJECT="OHLA"> <option name="myItemId" value="" /> <option name="myItemType" value="" /> @@ -1226,12 +747,6 @@ <option name="myItemType" value="" /> </PATH_ELEMENT> </PATH> - <PATH> - <PATH_ELEMENT USER_OBJECT="Root"> - <option name="myItemId" value="" /> - <option name="myItemType" value="" /> - </PATH_ELEMENT> - </PATH> </subPane> </component> <component name="SelectInManager" /> @@ -1300,23 +815,23 @@ </todo-panel> </component> <component name="ToolWindowManager"> - <frame x="-4" y="-4" width="1288" height="998" extended-state="6" /> + <frame x="-4" y="-4" width="1032" height="742" extended-state="6" /> <editor active="false" /> <layout> <window_info id="UI Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" /> <window_info id="CVS" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" /> <window_info id="IDEtalk" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" /> - <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32791588" order="7" /> - <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.30738038" order="0" /> - <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.34367815" order="1" /> + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32736155" order="7" /> + <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.3623337" order="0" /> + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.45276874" order="1" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="1" /> - <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32413793" order="8" /> + <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32247558" order="8" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" order="6" /> <window_info id="Module Dependencies" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" /> <window_info id="Dependency Viewer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32988507" order="8" /> <window_info id="Palette" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.15490673" order="1" /> - <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="8" /> + <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32899022" order="8" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.27816093" order="2" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" order="2" /> <window_info id="File View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" order="3" /> @@ -1356,12 +871,12 @@ </component> <component name="VcsManagerConfiguration"> <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" /> - <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" /> + <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="PERFORM_UPDATE_IN_BACKGROUND" value="false" /> <option name="PERFORM_COMMIT_IN_BACKGROUND" value="false" /> <option name="PUT_FOCUS_INTO_COMMENT" value="false" /> <option name="FORCE_NON_EMPTY_COMMENT" value="false" /> - <option name="LAST_COMMIT_MESSAGE" value="- all but 1 time management test passes" /> + <option name="LAST_COMMIT_MESSAGE" value="- refactoring" /> <option name="SAVE_LAST_COMMIT_MESSAGE" value="true" /> <option name="CHECKIN_DIALOG_SPLITTER_PROPORTION" value="0.8" /> <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" /> @@ -1374,16 +889,16 @@ <option name="UPDATE_GROUP_BY_PACKAGES" value="false" /> <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" /> <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" /> - <MESSAGE value="- fix for removed statics from RTI.java" /> - <MESSAGE value="removed duplicate text from thrown exceptions" /> - <MESSAGE value="- almost complete refactor to centralized RTI" /> - <MESSAGE value="- starting tests for centralized RTI" /> <MESSAGE value="- added a default socket acceptor" /> <MESSAGE value="- check sent region handles for null or isEmpty" /> <MESSAGE value="- Federation Management, Support Services, Declaration Management, and Object Management unit test cases passing" /> <MESSAGE value="- removed uncessary delay" /> <MESSAGE value="- removed log4j" /> <MESSAGE value="- all but 1 time management test passes" /> + <MESSAGE value="- all tests passing" /> + <MESSAGE value="- added HLA 1.3 LogicalTime factory properties" /> + <MESSAGE value="- removed extra lock on the Time lock" /> + <MESSAGE value="- refactoring" /> </component> <component name="VssConfiguration"> <option name="CLIENT_PATH" value="" /> @@ -1466,113 +981,101 @@ <option name="myLastEditedConfigurable" /> </component> <component name="editorHistoryManager"> - <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/OwnershipManagementTestNG.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="550" column="0" selection-start="19642" selection-end="19642" vertical-scroll-proportion="0.020706456"> + <state line="265" column="38" selection-start="9856" selection-end="9856" vertical-scroll-proportion="0.029929578"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/SupportServicesTestNG.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/Federate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="43" column="13" selection-start="1566" selection-end="1566" vertical-scroll-proportion="0.020706456"> + <state line="150" column="0" selection-start="4647" selection-end="4647" vertical-scroll-proportion="0.029929578"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java"> + <entry file="file://$PROJECT_DIR$/../build.xml"> <provider selected="true" editor-type-id="text-editor"> - <state line="152" column="0" selection-start="7195" selection-end="7239" vertical-scroll-proportion="0.020706456"> + <state line="326" column="0" selection-start="11921" selection-end="11921" vertical-scroll-proportion="0.029929578"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/RTI.java"> + <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/BaseTestNG.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="109" column="28" selection-start="3668" selection-end="3668" vertical-scroll-proportion="0.020706456"> + <state line="18" column="0" selection-start="636" selection-end="636" vertical-scroll-proportion="0.02915952"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/objects/AttributeInstance.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="2938" column="0" selection-start="79846" selection-end="79846" vertical-scroll-proportion="0.020706456"> + <state line="30" column="13" selection-start="1035" selection-end="1035" vertical-scroll-proportion="0.18545455"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../build.xml"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="44" column="0" selection-start="1897" selection-end="1897" vertical-scroll-proportion="0.020706456"> + <state line="16" column="13" selection-start="619" selection-end="619" vertical-scroll-proportion="0.06390978"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../resources/logback-test.xml"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="24" column="46" selection-start="945" selection-end="945" vertical-scroll-proportion="0.35200974"> + <state line="0" column="36" selection-start="28" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="675" column="14" selection-start="18064" selection-end="18064" vertical-scroll-proportion="0.39464068"> + <state line="0" column="36" selection-start="36" selection-end="36" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federation/Federate.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="78" column="0" selection-start="3168" selection-end="3201" vertical-scroll-proportion="0.020706456"> + <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/messages/callbacks/TimeAdvanceGrant.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="35" column="3" selection-start="1062" selection-end="1062" vertical-scroll-proportion="0.35200974"> + <state line="16" column="36" selection-start="642" selection-end="642" vertical-scroll-proportion="0.06390978"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/Federate.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="428" column="14" selection-start="16700" selection-end="16700" vertical-scroll-proportion="0.33252132"> + <state line="21" column="35" selection-start="788" selection-end="788" vertical-scroll-proportion="0.2236842"> <folding> <element signature="imports" expanded="true" /> </folding> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/ObjectManagementTestNG.java"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="15" column="0" selection-start="605" selection-end="605" vertical-scroll-proportion="0.020706456"> + <state line="18" column="13" selection-start="658" selection-end="658" vertical-scroll-proportion="0.12431444"> <folding /> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../resources/testsuite/TestObjectModel.xml"> + <entry file="file://$PROJECT_DIR$/../../rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java"> <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> - <folding /> + <state line="1040" column="50" selection-start="33230" selection-end="33230" vertical-scroll-proportion="0.7612782"> + <folding> + <element signature="imports" expanded="true" /> + </folding> </state> </provider> </entry> - <entry file="file://$PROJECT_DIR$/../../testsuite/src/java/net/sf/ohla/rti1516/TimeManagementTestNG.java"> - <provider selected="true" editor-type-id="text-editor"> - <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> - <folding /> - </state> - </provider> - </entry> - <entry file="file://$PROJECT_DIR$/../../resources/testsuite/ieee-1516-testng.xml"> - <provider selected="true" editor-type-id="text-editor"> - <state line="22" column="9" selection-start="909" selection-end="909" vertical-scroll-proportion="0.041412912"> - <folding /> - </state> - </provider> - </entry> </component> <component name="o... [truncated message content] |
From: <mne...@us...> - 2007-02-13 03:29:51
|
Revision: 119 http://svn.sourceforge.net/ohla/?rev=119&view=rev Author: mnewcomb Date: 2007-02-12 19:29:52 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/ Copied: trunk/rti/src/java/net/sf/ohla/rti1516/federate (from rev 115, trunk/rti/src/java/net/sf/ohla/rti1516/local) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 03:29:27
|
Revision: 118 http://svn.sourceforge.net/ohla/?rev=118&view=rev Author: mnewcomb Date: 2007-02-12 19:29:27 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/local/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 03:25:26
|
Revision: 117 http://svn.sourceforge.net/ohla/?rev=117&view=rev Author: mnewcomb Date: 2007-02-12 19:25:26 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java Modified: trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 03:25:26 UTC (rev 117) @@ -36,7 +36,7 @@ import net.sf.ohla.rti1516.OHLAObjectInstanceHandle; import net.sf.ohla.rti1516.OHLAParameterHandle; import net.sf.ohla.rti1516.OHLARegionHandleSet; -import net.sf.ohla.rti1516.local.LocalFederate; +import net.sf.ohla.rti1516.federate.LocalFederate; import net.sf.ohla.rti1516.fdd.ObjectClass; import org.slf4j.Logger; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 03:25:26 UTC (rev 117) @@ -29,7 +29,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.local.LocalFederate; +import net.sf.ohla.rti1516.federate.LocalFederate; import net.sf.ohla.rti1516.filter.RequestResponseFilter; import net.sf.ohla.rti1516.messages.CreateFederationExecution; import net.sf.ohla.rti1516.messages.DestroyFederationExecution; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java 2007-02-13 03:25:26 UTC (rev 117) @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Set; -import net.sf.ohla.rti1516.local.FederateSave; +import net.sf.ohla.rti1516.federate.FederateSave; import hla.rti1516.FederateHandle; import hla.rti1516.FederateHandleSaveStatusPair; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; public class FederateRestore { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; import hla.rti1516.FederateHandle; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; import java.util.HashMap; import java.util.Map; @@ -44,7 +44,7 @@ import net.sf.ohla.rti1516.OHLAParameterHandleValueMapFactory; import net.sf.ohla.rti1516.OHLARegionHandleSetFactory; import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.local.objects.ObjectManager; +import net.sf.ohla.rti1516.federate.objects.ObjectManager; import net.sf.ohla.rti1516.messages.FederateRestoreComplete; import net.sf.ohla.rti1516.messages.FederateRestoreNotComplete; import net.sf.ohla.rti1516.messages.FederateSaveBegun; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java 2007-02-13 03:25:26 UTC (rev 117) @@ -1,4 +1,4 @@ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; import java.util.HashMap; import java.util.Map; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java 2007-02-13 03:25:26 UTC (rev 117) @@ -1,4 +1,4 @@ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; import java.util.HashMap; import java.util.HashSet; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; import hla.rti1516.FederateHandleSet; import hla.rti1516.SynchronizationPointFailureReason; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,12 +14,12 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local; +package net.sf.ohla.rti1516.federate; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import net.sf.ohla.rti1516.local.LocalFederate; +import net.sf.ohla.rti1516.federate.LocalFederate; import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; import net.sf.ohla.rti1516.messages.DisableTimeConstrained; import net.sf.ohla.rti1516.messages.DisableTimeRegulation; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local.objects; +package net.sf.ohla.rti1516.federate.objects; import java.io.Serializable; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java 2007-02-13 03:25:26 UTC (rev 117) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.local.objects; +package net.sf.ohla.rti1516.federate.objects; import java.io.Serializable; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java 2007-02-13 03:25:26 UTC (rev 117) @@ -1,4 +1,4 @@ -package net.sf.ohla.rti1516.local.objects; +package net.sf.ohla.rti1516.federate.objects; import java.util.ArrayList; import java.util.Collection; @@ -18,7 +18,7 @@ import net.sf.ohla.rti1516.SubscriptionManager; import net.sf.ohla.rti1516.fdd.InteractionClass; import net.sf.ohla.rti1516.fdd.ObjectClass; -import net.sf.ohla.rti1516.local.LocalFederate; +import net.sf.ohla.rti1516.federate.LocalFederate; import net.sf.ohla.rti1516.messages.DeleteObjectInstance; import net.sf.ohla.rti1516.messages.RegisterObjectInstance; import net.sf.ohla.rti1516.messages.ReserveObjectInstanceName; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java 2007-02-13 03:25:26 UTC (rev 117) @@ -16,7 +16,7 @@ package net.sf.ohla.rti1516.messages; -import net.sf.ohla.rti1516.local.FederateSave; +import net.sf.ohla.rti1516.federate.FederateSave; public class FederateSaveComplete implements Message Modified: trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java 2007-02-13 03:23:38 UTC (rev 116) +++ trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java 2007-02-13 03:25:26 UTC (rev 117) @@ -22,7 +22,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import net.sf.ohla.rti1516.local.LocalFederate; +import net.sf.ohla.rti1516.federate.LocalFederate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 03:23:39
|
Revision: 116 http://svn.sourceforge.net/ohla/?rev=116&view=rev Author: mnewcomb Date: 2007-02-12 19:23:38 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/SubscriptionManager.java Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java Copied: trunk/rti/src/java/net/sf/ohla/rti1516/SubscriptionManager.java (from rev 115, trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java) =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/SubscriptionManager.java (rev 0) +++ trunk/rti/src/java/net/sf/ohla/rti1516/SubscriptionManager.java 2007-02-13 03:23:38 UTC (rev 116) @@ -0,0 +1,425 @@ +/* + * Copyright (c) 2006, Michael Newcomb + * + * Licensed 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 net.sf.ohla.rti1516; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import net.sf.ohla.rti1516.fdd.InteractionClass; +import net.sf.ohla.rti1516.fdd.ObjectClass; + +import hla.rti1516.AttributeHandle; +import hla.rti1516.AttributeHandleSet; +import hla.rti1516.AttributeRegionAssociation; +import hla.rti1516.AttributeSetRegionSetPairList; +import hla.rti1516.InteractionClassHandle; +import hla.rti1516.ObjectClassHandle; +import hla.rti1516.RegionHandle; +import hla.rti1516.RegionHandleSet; +import hla.rti1516.AttributeHandleValueMap; + +public class SubscriptionManager +{ + protected Map<ObjectClassHandle, Map<AttributeHandle, AttributeSubscription>> + subscribedObjectClasses = + new HashMap<ObjectClassHandle, Map<AttributeHandle, AttributeSubscription>>(); + + protected Map<InteractionClassHandle, InteractionClassSubscription> + subscribedInteractionClasses = + new HashMap<InteractionClassHandle, InteractionClassSubscription>(); + + public boolean isObjectClassSubscribed(ObjectClassHandle objectClassHandle) + { + return subscribedObjectClasses.containsKey(objectClassHandle); + } + + public void subscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles, + boolean passive) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + getAttributeSubscriptions(objectClassHandle, true); + + for (AttributeHandle attributeHandle : attributeHandles) + { + AttributeSubscription attributeSubscription = + attributeSubscriptions.get(attributeHandle); + if (attributeSubscription == null) + { + attributeSubscriptions.put( + attributeHandle, new AttributeSubscription(attributeHandle, passive)); + } + else + { + attributeSubscription.subscribe(passive); + } + } + } + + public void subscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, + AttributeSetRegionSetPairList attributesAndRegions, boolean passive) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + getAttributeSubscriptions(objectClassHandle, true); + + for (AttributeRegionAssociation attributeRegionAssociation : attributesAndRegions) + { + for (AttributeHandle attributeHandle : attributeRegionAssociation.attributes) + { + AttributeSubscription attributeSubscription = + attributeSubscriptions.get(attributeHandle); + if (attributeSubscription == null) + { + attributeSubscriptions.put( + attributeHandle, new AttributeSubscription( + attributeHandle, attributeRegionAssociation.regions, passive)); + } + else + { + attributeSubscription.subscribe( + attributeRegionAssociation.regions, passive); + } + } + } + } + + public void unsubscribeObjectClass(ObjectClassHandle objectClassHandle) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + getAttributeSubscriptions(objectClassHandle, false); + + if (attributeSubscriptions != null) + { + for (AttributeSubscription attributeSubscription : attributeSubscriptions.values()) + { + // unsubscribe from the default region + // + attributeSubscription.unsubscribe(); + } + } + } + + public void unsubscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + getAttributeSubscriptions(objectClassHandle, false); + + if (attributeSubscriptions != null) + { + for (AttributeHandle attributeHandle : attributeHandles) + { + AttributeSubscription attributeSubscription = + attributeSubscriptions.get(attributeHandle); + if (attributeSubscription != null) + { + // unsubscribe from the default region + // + attributeSubscription.unsubscribe(); + } + } + } + } + + public void unsubscribeObjectClassAttributes( + ObjectClassHandle objectClassHandle, + AttributeSetRegionSetPairList attributesAndRegions) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + getAttributeSubscriptions(objectClassHandle, false); + + if (attributeSubscriptions != null) + { + for (AttributeRegionAssociation attributeRegionAssociation : attributesAndRegions) + { + for (AttributeHandle attributeHandle : attributeRegionAssociation.attributes) + { + AttributeSubscription attributeSubscription = + attributeSubscriptions.get(attributeHandle); + if (attributeSubscription != null) + { + // unsubscribe from the specified regions + // + attributeSubscription.unsubscribe( + attributeRegionAssociation.regions); + } + } + } + } + } + + public boolean isInteractionClassSubscribed( + InteractionClassHandle interactionClassHandle) + { + return subscribedInteractionClasses.containsKey(interactionClassHandle); + } + + public void subscribeInteractionClass( + InteractionClassHandle interactionClassHandle, boolean passive) + { + InteractionClassSubscription interactionClassSubscription = + subscribedInteractionClasses.get(interactionClassHandle); + if (interactionClassSubscription == null) + { + subscribedInteractionClasses.put( + interactionClassHandle, + new InteractionClassSubscription(interactionClassHandle, passive)); + } + else + { + interactionClassSubscription.subscribe(passive); + } + } + + public void subscribeInteractionClass( + InteractionClassHandle interactionClassHandle, + RegionHandleSet regionHandles, boolean passive) + { + InteractionClassSubscription interactionClassSubscription = + subscribedInteractionClasses.get(interactionClassHandle); + if (interactionClassSubscription == null) + { + subscribedInteractionClasses.put( + interactionClassHandle, + new InteractionClassSubscription(interactionClassHandle, passive)); + } + else + { + interactionClassSubscription.subscribe(passive); + } + } + + public void unsubscribeInteractionClass( + InteractionClassHandle interactionClassHandle) + { + InteractionClassSubscription interactionClassSubscription = + subscribedInteractionClasses.get(interactionClassHandle); + if (interactionClassSubscription != null) + { + interactionClassSubscription.unsubscribe(); + } + } + + public void unsubscribeInteractionClass( + InteractionClassHandle interactionClassHandle, + RegionHandleSet regionHandles) + { + InteractionClassSubscription interactionClassSubscription = + subscribedInteractionClasses.get(interactionClassHandle); + if (interactionClassSubscription != null) + { + interactionClassSubscription.unsubscribe(regionHandles); + } + } + + public ObjectClass getSubscribedObjectClass(ObjectClass objectClass) + { + boolean subscribed = isObjectClassSubscribed( + objectClass.getObjectClassHandle()); + + if (!subscribed && objectClass.hasSuperObjectClass()) + { + // see if an anscestor of the object class is subscribed + + do + { + objectClass = objectClass.getSuperObjectClass(); + + subscribed = isObjectClassSubscribed( + objectClass.getObjectClassHandle()); + } while (!subscribed && objectClass.hasSuperObjectClass()); + } + + return subscribed ? objectClass : null; + } + + public InteractionClass getSubscribedInteractionClass( + InteractionClass interactionClass) + { + boolean subscribed = isInteractionClassSubscribed( + interactionClass.getInteractionClassHandle()); + + if (!subscribed && interactionClass.hasSuperInteractionClass()) + { + // see if an anscestor of the interaction class is subscribed + + do + { + interactionClass = interactionClass.getSuperInteractionClass(); + + subscribed = isInteractionClassSubscribed( + interactionClass.getInteractionClassHandle()); + } while (!subscribed && interactionClass.hasSuperInteractionClass()); + } + + return subscribed ? interactionClass : null; + } + + public void trim(AttributeHandleValueMap attributeValues, + ObjectClassHandle objectClassHandle) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + subscribedObjectClasses.get(objectClassHandle); + assert attributeSubscriptions != null; + + attributeValues.keySet().retainAll(attributeSubscriptions.keySet()); + } + + protected Map<AttributeHandle, AttributeSubscription> getSubscribedAttributeSubscriptions( + ObjectClass objectClass) + { + Map<AttributeHandle, AttributeSubscription> subscriptions = + subscribedObjectClasses.get(objectClass.getObjectClassHandle()); + if (subscriptions == null && objectClass.hasSuperObjectClass()) + { + // see if an anscestor of the object class is subscribed + + do + { + objectClass = objectClass.getSuperObjectClass(); + + subscriptions = subscribedObjectClasses.get( + objectClass.getObjectClassHandle()); + + } while (subscriptions == null && objectClass.hasSuperObjectClass()); + } + return subscriptions; + } + + protected Map<AttributeHandle, AttributeSubscription> getAttributeSubscriptions( + ObjectClassHandle objectClassHandle, boolean addIfMissing) + { + Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = + subscribedObjectClasses.get(objectClassHandle); + if (attributeSubscriptions == null && addIfMissing) + { + attributeSubscriptions = + new HashMap<AttributeHandle, AttributeSubscription>(); + subscribedObjectClasses.put(objectClassHandle, + attributeSubscriptions); + } + return attributeSubscriptions; + } + + protected abstract class AbstractSubscription + { + protected boolean defaultRegionSubscribed; + protected boolean defaultRegionPassive; + + protected Map<RegionHandle, Boolean> subscribedRegionHandles = + new HashMap<RegionHandle, Boolean>(); + + public AbstractSubscription(boolean passive) + { + subscribe(passive); + } + + public AbstractSubscription(RegionHandleSet regionHandles, boolean passive) + { + subscribe(regionHandles, passive); + } + + public boolean isDefaultRegionSubscribed() + { + return defaultRegionSubscribed; + } + + public boolean isDefaultRegionPassive() + { + return defaultRegionPassive; + } + + public Set<RegionHandle> getSubscribedRegionHandles() + { + return subscribedRegionHandles.keySet(); + } + + public void subscribe(boolean passive) + { + defaultRegionSubscribed = true; + defaultRegionPassive = passive; + } + + public void unsubscribe() + { + defaultRegionSubscribed = false; + } + + public void subscribe(RegionHandleSet regionHandles, boolean passive) + { + for (RegionHandle regionHandle : regionHandles) + { + subscribedRegionHandles.put(regionHandle, passive); + } + } + + public void unsubscribe(RegionHandleSet regionHandles) + { + for (RegionHandle regionHandle : regionHandles) + { + subscribedRegionHandles.remove(regionHandle); + } + } + } + + protected class AttributeSubscription + extends AbstractSubscription + { + protected final AttributeHandle attributeHandle; + + public AttributeSubscription(AttributeHandle attributeHandle, + boolean passive) + { + super(passive); + + this.attributeHandle = attributeHandle; + } + + public AttributeSubscription(AttributeHandle attributeHandle, + RegionHandleSet regionHandles, boolean passive) + { + super(regionHandles, passive); + + this.attributeHandle = attributeHandle; + } + } + + protected class InteractionClassSubscription + extends AbstractSubscription + { + protected final InteractionClassHandle interactionClassHandle; + + public InteractionClassSubscription( + InteractionClassHandle interactionClassHandle, boolean passive) + { + super(passive); + + this.interactionClassHandle = interactionClassHandle; + } + + public InteractionClassSubscription( + InteractionClassHandle interactionClassHandle, + RegionHandleSet regionHandles, boolean passive) + { + super(regionHandles, passive); + + this.interactionClassHandle = interactionClassHandle; + } + } +} Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java 2007-02-13 03:23:38 UTC (rev 116) @@ -20,8 +20,8 @@ import net.sf.ohla.rti1516.OHLAAttributeHandleValueMap; import net.sf.ohla.rti1516.OHLAParameterHandleValueMap; +import net.sf.ohla.rti1516.SubscriptionManager; import net.sf.ohla.rti1516.fdd.InteractionClass; -import net.sf.ohla.rti1516.local.SubscriptionManager; import net.sf.ohla.rti1516.messages.AttributeOwnershipAcquisition; import net.sf.ohla.rti1516.messages.AttributeOwnershipAcquisitionIfAvailable; import net.sf.ohla.rti1516.messages.AttributeOwnershipDivestitureIfWanted; Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java 2007-02-13 03:23:38 UTC (rev 116) @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.local; - -public enum FederateRestoreState -{ - RESTORE_REQUEST_PENDING, WAITING_FOR_RESTORE_TO_BEGIN, PREPARED_TO_RESTORE, - RESTORING, WAITING_FOR_FEDERATION_TO_RESTORE -} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java 2007-02-13 03:23:38 UTC (rev 116) @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.local; - -public enum FederateSaveState -{ - INSTRUCTED_TO_SAVE, SAVING, WAITING_FOR_FEDERATION_TO_SAVE -} Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java 2007-02-13 03:23:38 UTC (rev 116) @@ -45,7 +45,6 @@ import net.sf.ohla.rti1516.OHLARegionHandleSetFactory; import net.sf.ohla.rti1516.fdd.FDD; import net.sf.ohla.rti1516.local.objects.ObjectManager; -import net.sf.ohla.rti1516.local.LocalTimeManager; import net.sf.ohla.rti1516.messages.FederateRestoreComplete; import net.sf.ohla.rti1516.messages.FederateRestoreNotComplete; import net.sf.ohla.rti1516.messages.FederateSaveBegun; @@ -198,9 +197,11 @@ import hla.rti1516.RestoreFailureReason; import hla.rti1516.RestoreInProgress; import hla.rti1516.RestoreNotRequested; +import hla.rti1516.RestoreStatus; import hla.rti1516.SaveFailureReason; import hla.rti1516.SaveInProgress; import hla.rti1516.SaveNotInitiated; +import hla.rti1516.SaveStatus; import hla.rti1516.ServiceGroup; import hla.rti1516.SpecifiedSaveLabelDoesNotExist; import hla.rti1516.SynchronizationPointFailureReason; @@ -245,10 +246,10 @@ protected ReadWriteLock federateStateLock = new ReentrantReadWriteLock(true); - protected FederateSaveState federateSaveState; + protected SaveStatus saveStatus; protected FederateSave federateSave; - protected FederateRestoreState federateRestoreState; + protected RestoreStatus restoreStatus; protected FederateRestore federateRestore; protected Lock synchronizationPointLock = new ReentrantLock(true); @@ -857,14 +858,14 @@ federateStateLock.readLock().lock(); try { - if (federateSaveState != FederateSaveState.INSTRUCTED_TO_SAVE) + if (saveStatus != SaveStatus.FEDERATE_INSTRUCTED_TO_SAVE) { throw new SaveNotInitiated(); } writeFuture = rtiSession.write(new FederateSaveBegun()); - federateSaveState = FederateSaveState.SAVING; + saveStatus = SaveStatus.FEDERATE_SAVING; } finally { @@ -891,14 +892,14 @@ { checkIfRestoreInProgress(); - if (federateSaveState != FederateSaveState.SAVING) + if (saveStatus != SaveStatus.FEDERATE_SAVING) { throw new FederateHasNotBegunSave(); } writeFuture = rtiSession.write(new FederateSaveComplete(null)); - federateSaveState = FederateSaveState.WAITING_FOR_FEDERATION_TO_SAVE; + saveStatus = SaveStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_SAVE; } finally { @@ -925,14 +926,14 @@ { checkIfRestoreInProgress(); - if (federateSaveState != FederateSaveState.SAVING) + if (saveStatus != SaveStatus.FEDERATE_SAVING) { throw new FederateHasNotBegunSave(); } writeFuture = rtiSession.write(new FederateSaveNotComplete()); - federateSaveState = FederateSaveState.WAITING_FOR_FEDERATION_TO_SAVE; + saveStatus = SaveStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_SAVE; } finally { @@ -1037,15 +1038,14 @@ { checkIfSaveInProgress(); - if (federateRestoreState != FederateRestoreState.RESTORING) + if (restoreStatus != RestoreStatus.FEDERATE_RESTORING) { throw new RestoreNotRequested(); } writeFuture = rtiSession.write(new FederateRestoreComplete()); - federateRestoreState = - FederateRestoreState.WAITING_FOR_FEDERATION_TO_RESTORE; + restoreStatus = RestoreStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_RESTORE; } finally { @@ -1072,15 +1072,14 @@ { checkIfSaveInProgress(); - if (federateRestoreState != FederateRestoreState.RESTORING) + if (restoreStatus != RestoreStatus.FEDERATE_RESTORING) { throw new RestoreNotRequested(); } writeFuture = rtiSession.write(new FederateRestoreNotComplete()); - federateRestoreState = - FederateRestoreState.WAITING_FOR_FEDERATION_TO_RESTORE; + restoreStatus = RestoreStatus.FEDERATE_WAITING_FOR_FEDERATION_TO_RESTORE; } finally { Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java 2007-02-13 03:23:38 UTC (rev 116) @@ -1,425 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.local; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import net.sf.ohla.rti1516.fdd.InteractionClass; -import net.sf.ohla.rti1516.fdd.ObjectClass; - -import hla.rti1516.AttributeHandle; -import hla.rti1516.AttributeHandleSet; -import hla.rti1516.AttributeRegionAssociation; -import hla.rti1516.AttributeSetRegionSetPairList; -import hla.rti1516.InteractionClassHandle; -import hla.rti1516.ObjectClassHandle; -import hla.rti1516.RegionHandle; -import hla.rti1516.RegionHandleSet; -import hla.rti1516.AttributeHandleValueMap; - -public class SubscriptionManager -{ - protected Map<ObjectClassHandle, Map<AttributeHandle, AttributeSubscription>> - subscribedObjectClasses = - new HashMap<ObjectClassHandle, Map<AttributeHandle, AttributeSubscription>>(); - - protected Map<InteractionClassHandle, InteractionClassSubscription> - subscribedInteractionClasses = - new HashMap<InteractionClassHandle, InteractionClassSubscription>(); - - public boolean isObjectClassSubscribed(ObjectClassHandle objectClassHandle) - { - return subscribedObjectClasses.containsKey(objectClassHandle); - } - - public void subscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles, - boolean passive) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - getAttributeSubscriptions(objectClassHandle, true); - - for (AttributeHandle attributeHandle : attributeHandles) - { - AttributeSubscription attributeSubscription = - attributeSubscriptions.get(attributeHandle); - if (attributeSubscription == null) - { - attributeSubscriptions.put( - attributeHandle, new AttributeSubscription(attributeHandle, passive)); - } - else - { - attributeSubscription.subscribe(passive); - } - } - } - - public void subscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, - AttributeSetRegionSetPairList attributesAndRegions, boolean passive) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - getAttributeSubscriptions(objectClassHandle, true); - - for (AttributeRegionAssociation attributeRegionAssociation : attributesAndRegions) - { - for (AttributeHandle attributeHandle : attributeRegionAssociation.attributes) - { - AttributeSubscription attributeSubscription = - attributeSubscriptions.get(attributeHandle); - if (attributeSubscription == null) - { - attributeSubscriptions.put( - attributeHandle, new AttributeSubscription( - attributeHandle, attributeRegionAssociation.regions, passive)); - } - else - { - attributeSubscription.subscribe( - attributeRegionAssociation.regions, passive); - } - } - } - } - - public void unsubscribeObjectClass(ObjectClassHandle objectClassHandle) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - getAttributeSubscriptions(objectClassHandle, false); - - if (attributeSubscriptions != null) - { - for (AttributeSubscription attributeSubscription : attributeSubscriptions.values()) - { - // unsubscribe from the default region - // - attributeSubscription.unsubscribe(); - } - } - } - - public void unsubscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - getAttributeSubscriptions(objectClassHandle, false); - - if (attributeSubscriptions != null) - { - for (AttributeHandle attributeHandle : attributeHandles) - { - AttributeSubscription attributeSubscription = - attributeSubscriptions.get(attributeHandle); - if (attributeSubscription != null) - { - // unsubscribe from the default region - // - attributeSubscription.unsubscribe(); - } - } - } - } - - public void unsubscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, - AttributeSetRegionSetPairList attributesAndRegions) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - getAttributeSubscriptions(objectClassHandle, false); - - if (attributeSubscriptions != null) - { - for (AttributeRegionAssociation attributeRegionAssociation : attributesAndRegions) - { - for (AttributeHandle attributeHandle : attributeRegionAssociation.attributes) - { - AttributeSubscription attributeSubscription = - attributeSubscriptions.get(attributeHandle); - if (attributeSubscription != null) - { - // unsubscribe from the specified regions - // - attributeSubscription.unsubscribe( - attributeRegionAssociation.regions); - } - } - } - } - } - - public boolean isInteractionClassSubscribed( - InteractionClassHandle interactionClassHandle) - { - return subscribedInteractionClasses.containsKey(interactionClassHandle); - } - - public void subscribeInteractionClass( - InteractionClassHandle interactionClassHandle, boolean passive) - { - InteractionClassSubscription interactionClassSubscription = - subscribedInteractionClasses.get(interactionClassHandle); - if (interactionClassSubscription == null) - { - subscribedInteractionClasses.put( - interactionClassHandle, - new InteractionClassSubscription(interactionClassHandle, passive)); - } - else - { - interactionClassSubscription.subscribe(passive); - } - } - - public void subscribeInteractionClass( - InteractionClassHandle interactionClassHandle, - RegionHandleSet regionHandles, boolean passive) - { - InteractionClassSubscription interactionClassSubscription = - subscribedInteractionClasses.get(interactionClassHandle); - if (interactionClassSubscription == null) - { - subscribedInteractionClasses.put( - interactionClassHandle, - new InteractionClassSubscription(interactionClassHandle, passive)); - } - else - { - interactionClassSubscription.subscribe(passive); - } - } - - public void unsubscribeInteractionClass( - InteractionClassHandle interactionClassHandle) - { - InteractionClassSubscription interactionClassSubscription = - subscribedInteractionClasses.get(interactionClassHandle); - if (interactionClassSubscription != null) - { - interactionClassSubscription.unsubscribe(); - } - } - - public void unsubscribeInteractionClass( - InteractionClassHandle interactionClassHandle, - RegionHandleSet regionHandles) - { - InteractionClassSubscription interactionClassSubscription = - subscribedInteractionClasses.get(interactionClassHandle); - if (interactionClassSubscription != null) - { - interactionClassSubscription.unsubscribe(regionHandles); - } - } - - public ObjectClass getSubscribedObjectClass(ObjectClass objectClass) - { - boolean subscribed = isObjectClassSubscribed( - objectClass.getObjectClassHandle()); - - if (!subscribed && objectClass.hasSuperObjectClass()) - { - // see if an anscestor of the object class is subscribed - - do - { - objectClass = objectClass.getSuperObjectClass(); - - subscribed = isObjectClassSubscribed( - objectClass.getObjectClassHandle()); - } while (!subscribed && objectClass.hasSuperObjectClass()); - } - - return subscribed ? objectClass : null; - } - - public InteractionClass getSubscribedInteractionClass( - InteractionClass interactionClass) - { - boolean subscribed = isInteractionClassSubscribed( - interactionClass.getInteractionClassHandle()); - - if (!subscribed && interactionClass.hasSuperInteractionClass()) - { - // see if an anscestor of the interaction class is subscribed - - do - { - interactionClass = interactionClass.getSuperInteractionClass(); - - subscribed = isInteractionClassSubscribed( - interactionClass.getInteractionClassHandle()); - } while (!subscribed && interactionClass.hasSuperInteractionClass()); - } - - return subscribed ? interactionClass : null; - } - - public void trim(AttributeHandleValueMap attributeValues, - ObjectClassHandle objectClassHandle) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - subscribedObjectClasses.get(objectClassHandle); - assert attributeSubscriptions != null; - - attributeValues.keySet().retainAll(attributeSubscriptions.keySet()); - } - - protected Map<AttributeHandle, AttributeSubscription> getSubscribedAttributeSubscriptions( - ObjectClass objectClass) - { - Map<AttributeHandle, AttributeSubscription> subscriptions = - subscribedObjectClasses.get(objectClass.getObjectClassHandle()); - if (subscriptions == null && objectClass.hasSuperObjectClass()) - { - // see if an anscestor of the object class is subscribed - - do - { - objectClass = objectClass.getSuperObjectClass(); - - subscriptions = subscribedObjectClasses.get( - objectClass.getObjectClassHandle()); - - } while (subscriptions == null && objectClass.hasSuperObjectClass()); - } - return subscriptions; - } - - protected Map<AttributeHandle, AttributeSubscription> getAttributeSubscriptions( - ObjectClassHandle objectClassHandle, boolean addIfMissing) - { - Map<AttributeHandle, AttributeSubscription> attributeSubscriptions = - subscribedObjectClasses.get(objectClassHandle); - if (attributeSubscriptions == null && addIfMissing) - { - attributeSubscriptions = - new HashMap<AttributeHandle, AttributeSubscription>(); - subscribedObjectClasses.put(objectClassHandle, - attributeSubscriptions); - } - return attributeSubscriptions; - } - - protected abstract class AbstractSubscription - { - protected boolean defaultRegionSubscribed; - protected boolean defaultRegionPassive; - - protected Map<RegionHandle, Boolean> subscribedRegionHandles = - new HashMap<RegionHandle, Boolean>(); - - public AbstractSubscription(boolean passive) - { - subscribe(passive); - } - - public AbstractSubscription(RegionHandleSet regionHandles, boolean passive) - { - subscribe(regionHandles, passive); - } - - public boolean isDefaultRegionSubscribed() - { - return defaultRegionSubscribed; - } - - public boolean isDefaultRegionPassive() - { - return defaultRegionPassive; - } - - public Set<RegionHandle> getSubscribedRegionHandles() - { - return subscribedRegionHandles.keySet(); - } - - public void subscribe(boolean passive) - { - defaultRegionSubscribed = true; - defaultRegionPassive = passive; - } - - public void unsubscribe() - { - defaultRegionSubscribed = false; - } - - public void subscribe(RegionHandleSet regionHandles, boolean passive) - { - for (RegionHandle regionHandle : regionHandles) - { - subscribedRegionHandles.put(regionHandle, passive); - } - } - - public void unsubscribe(RegionHandleSet regionHandles) - { - for (RegionHandle regionHandle : regionHandles) - { - subscribedRegionHandles.remove(regionHandle); - } - } - } - - protected class AttributeSubscription - extends AbstractSubscription - { - protected final AttributeHandle attributeHandle; - - public AttributeSubscription(AttributeHandle attributeHandle, - boolean passive) - { - super(passive); - - this.attributeHandle = attributeHandle; - } - - public AttributeSubscription(AttributeHandle attributeHandle, - RegionHandleSet regionHandles, boolean passive) - { - super(regionHandles, passive); - - this.attributeHandle = attributeHandle; - } - } - - protected class InteractionClassSubscription - extends AbstractSubscription - { - protected final InteractionClassHandle interactionClassHandle; - - public InteractionClassSubscription( - InteractionClassHandle interactionClassHandle, boolean passive) - { - super(passive); - - this.interactionClassHandle = interactionClassHandle; - } - - public InteractionClassSubscription( - InteractionClassHandle interactionClassHandle, - RegionHandleSet regionHandles, boolean passive) - { - super(regionHandles, passive); - - this.interactionClassHandle = interactionClassHandle; - } - } -} Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/AttributeInstance.java 2007-02-13 03:23:38 UTC (rev 116) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate.objects; +package net.sf.ohla.rti1516.local.objects; import java.io.Serializable; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectInstance.java 2007-02-13 03:23:38 UTC (rev 116) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate.objects; +package net.sf.ohla.rti1516.local.objects; import java.io.Serializable; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java 2007-02-13 03:16:02 UTC (rev 115) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/objects/ObjectManager.java 2007-02-13 03:23:38 UTC (rev 116) @@ -1,4 +1,4 @@ -package net.sf.ohla.rti1516.federate.objects; +package net.sf.ohla.rti1516.local.objects; import java.util.ArrayList; import java.util.Collection; @@ -15,10 +15,10 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.sf.ohla.rti1516.OHLAAttributeHandleSet; +import net.sf.ohla.rti1516.SubscriptionManager; import net.sf.ohla.rti1516.fdd.InteractionClass; import net.sf.ohla.rti1516.fdd.ObjectClass; -import net.sf.ohla.rti1516.federate.LocalFederate; -import net.sf.ohla.rti1516.federate.SubscriptionManager; +import net.sf.ohla.rti1516.local.LocalFederate; import net.sf.ohla.rti1516.messages.DeleteObjectInstance; import net.sf.ohla.rti1516.messages.RegisterObjectInstance; import net.sf.ohla.rti1516.messages.ReserveObjectInstanceName; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 03:16:05
|
Revision: 115 http://svn.sourceforge.net/ohla/?rev=115&view=rev Author: mnewcomb Date: 2007-02-12 19:16:02 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/federation/Federate.java trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/local/ Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/ Modified: trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 03:16:02 UTC (rev 115) @@ -36,7 +36,7 @@ import net.sf.ohla.rti1516.OHLAObjectInstanceHandle; import net.sf.ohla.rti1516.OHLAParameterHandle; import net.sf.ohla.rti1516.OHLARegionHandleSet; -import net.sf.ohla.rti1516.federate.LocalFederate; +import net.sf.ohla.rti1516.local.LocalFederate; import net.sf.ohla.rti1516.fdd.ObjectClass; import org.slf4j.Logger; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 03:16:02 UTC (rev 115) @@ -29,7 +29,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.federate.LocalFederate; +import net.sf.ohla.rti1516.local.LocalFederate; import net.sf.ohla.rti1516.filter.RequestResponseFilter; import net.sf.ohla.rti1516.messages.CreateFederationExecution; import net.sf.ohla.rti1516.messages.DestroyFederationExecution; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/Federate.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/Federate.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/Federate.java 2007-02-13 03:16:02 UTC (rev 115) @@ -52,13 +52,14 @@ import hla.rti1516.LogicalTime; import hla.rti1516.LogicalTimeInterval; import hla.rti1516.IllegalTimeArithmetic; +import hla.rti1516.ResignAction; public class Federate { private static final String FEDERATE_IO_FILTER = "FederateIoFilter"; protected final FederateHandle federateHandle; - protected final String federateType; + protected final String federateName; protected final IoSession session; protected final FederationExecution federationExecution; @@ -77,18 +78,20 @@ protected final Logger log = LoggerFactory.getLogger(getClass()); protected final Marker marker; - public Federate(FederateHandle federateHandle, String federateType, + public Federate(FederateHandle federateHandle, String federateName, IoSession session, FederationExecution federationExecution) { this.federateHandle = federateHandle; - this.federateType = federateType; + this.federateName = federateName; this.session = session; this.federationExecution = federationExecution; session.getFilterChain().addLast( FEDERATE_IO_FILTER, new FederateIoFilter(this, federationExecution)); - marker = MarkerFactory.getMarker(federateType); + marker = MarkerFactory.getMarker(federateName); + + log.debug(marker, "joined: {}", federateName); } public FederateHandle getFederateHandle() @@ -96,9 +99,9 @@ return federateHandle; } - public String getFederateType() + public String getFederateName() { - return federateType; + return federateName; } public IoSession getSession() @@ -141,9 +144,11 @@ return lits; } - public void resignFederationExecution() + public void resignFederationExecution(ResignAction resignAction) { session.getFilterChain().remove(FEDERATE_IO_FILTER); + + log.debug(marker, "resigned: {}", resignAction); } public WriteFuture announceSynchronizationPoint( @@ -364,6 +369,6 @@ public String toString() { return String.format("%s,%s,%s", federateHandle, - session.getLocalAddress(), federateType); + session.getLocalAddress(), federateName); } } Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederateIoFilter.java 2007-02-13 03:16:02 UTC (rev 115) @@ -21,7 +21,7 @@ import net.sf.ohla.rti1516.OHLAAttributeHandleValueMap; import net.sf.ohla.rti1516.OHLAParameterHandleValueMap; import net.sf.ohla.rti1516.fdd.InteractionClass; -import net.sf.ohla.rti1516.federate.SubscriptionManager; +import net.sf.ohla.rti1516.local.SubscriptionManager; import net.sf.ohla.rti1516.messages.AttributeOwnershipAcquisition; import net.sf.ohla.rti1516.messages.AttributeOwnershipAcquisitionIfAvailable; import net.sf.ohla.rti1516.messages.AttributeOwnershipDivestitureIfWanted; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java 2007-02-13 03:16:02 UTC (rev 115) @@ -228,8 +228,6 @@ new JoinFederationExecutionResponse( federateHandle, fdd, federationExecutionTimeManager.getGALT()))); - log.debug(marker, "federate joined: {}", federate); - // TODO: set timeout // writeFuture.join(); @@ -265,11 +263,10 @@ federatesLock.lock(); try { - federate.resignFederationExecution(); + federate.resignFederationExecution( + resignFederationExecution.getResignAction()); federates.remove(federate.getFederateHandle()); - - log.debug(marker, "federate resigned: {}", federate); } finally { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionSave.java 2007-02-13 03:16:02 UTC (rev 115) @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Set; -import net.sf.ohla.rti1516.federate.FederateSave; +import net.sf.ohla.rti1516.local.FederateSave; import hla.rti1516.FederateHandle; import hla.rti1516.FederateHandleSaveStatusPair; Copied: trunk/rti/src/java/net/sf/ohla/rti1516/local (from rev 113, trunk/rti/src/java/net/sf/ohla/rti1516/federate) Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateRestore.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestore.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; public class FederateRestore { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateRestoreState.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateRestoreState.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; public enum FederateRestoreState { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateSave.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSave.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import hla.rti1516.FederateHandle; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateSaveState.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/FederateSaveState.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; public enum FederateSaveState { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalFederate.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import java.util.HashMap; import java.util.Map; @@ -44,8 +44,8 @@ import net.sf.ohla.rti1516.OHLAParameterHandleValueMapFactory; import net.sf.ohla.rti1516.OHLARegionHandleSetFactory; import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.federate.objects.ObjectManager; -import net.sf.ohla.rti1516.federate.LocalTimeManager; +import net.sf.ohla.rti1516.local.objects.ObjectManager; +import net.sf.ohla.rti1516.local.LocalTimeManager; import net.sf.ohla.rti1516.messages.FederateRestoreComplete; import net.sf.ohla.rti1516.messages.FederateRestoreNotComplete; import net.sf.ohla.rti1516.messages.FederateSaveBegun; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalMessageRetractionManager.java 2007-02-13 03:16:02 UTC (rev 115) @@ -1,4 +1,4 @@ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import java.util.HashMap; import java.util.Map; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalRegionManager.java 2007-02-13 03:16:02 UTC (rev 115) @@ -1,4 +1,4 @@ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import java.util.HashMap; import java.util.HashSet; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalSynchronizationPoint.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import hla.rti1516.FederateHandleSet; import hla.rti1516.SynchronizationPointFailureReason; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/LocalTimeManager.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,12 +14,12 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import net.sf.ohla.rti1516.federate.LocalFederate; +import net.sf.ohla.rti1516.local.LocalFederate; import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; import net.sf.ohla.rti1516.messages.DisableTimeConstrained; import net.sf.ohla.rti1516.messages.DisableTimeRegulation; @@ -642,7 +642,7 @@ catch (Throwable t) { log.warn(String.format( - "federate unable enable time regulation to: %s", time), t); + "federate unable to enable time regulation to: %s", time), t); } finally { @@ -665,7 +665,7 @@ catch (Throwable t) { log.warn(String.format( - "federate unable enable time constrained to: %s", time), t); + "federate unable to enable time constrained to: %s", time), t); } finally { Modified: trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/SubscriptionManager.java 2007-02-13 02:47:48 UTC (rev 113) +++ trunk/rti/src/java/net/sf/ohla/rti1516/local/SubscriptionManager.java 2007-02-13 03:16:02 UTC (rev 115) @@ -14,7 +14,7 @@ * limitations under the License. */ -package net.sf.ohla.rti1516.federate; +package net.sf.ohla.rti1516.local; import java.util.HashMap; import java.util.Map; Modified: trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/messages/FederateSaveComplete.java 2007-02-13 03:16:02 UTC (rev 115) @@ -16,7 +16,7 @@ package net.sf.ohla.rti1516.messages; -import net.sf.ohla.rti1516.federate.FederateSave; +import net.sf.ohla.rti1516.local.FederateSave; public class FederateSaveComplete implements Message Modified: trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java 2007-02-13 03:02:36 UTC (rev 114) +++ trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java 2007-02-13 03:16:02 UTC (rev 115) @@ -22,7 +22,7 @@ import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; -import net.sf.ohla.rti1516.federate.LocalFederate; +import net.sf.ohla.rti1516.local.LocalFederate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 03:02:35
|
Revision: 114 http://svn.sourceforge.net/ohla/?rev=114&view=rev Author: mnewcomb Date: 2007-02-12 19:02:36 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/io/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 02:47:48
|
Revision: 113 http://svn.sourceforge.net/ohla/?rev=113&view=rev Author: mnewcomb Date: 2007-02-12 18:47:48 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/objects/ObjectManager.java trunk/rti/src/java/net/sf/ohla/rti1516/messages/callbacks/CallbackManager.java Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalFederate.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalMessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalRegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/LocalTimeManager.java Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateState.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/FederateSynchronizationPoint.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/MessageRetractionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/RegionManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/TimeManager.java Modified: trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 02:39:35 UTC (rev 112) +++ trunk/rti/src/java/net/sf/ohla/rti/OHLARTIambassador.java 2007-02-13 02:47:48 UTC (rev 113) @@ -36,7 +36,7 @@ import net.sf.ohla.rti1516.OHLAObjectInstanceHandle; import net.sf.ohla.rti1516.OHLAParameterHandle; import net.sf.ohla.rti1516.OHLARegionHandleSet; -import net.sf.ohla.rti1516.federate.Federate; +import net.sf.ohla.rti1516.federate.LocalFederate; import net.sf.ohla.rti1516.fdd.ObjectClass; import org.slf4j.Logger; @@ -215,7 +215,7 @@ protected LogicalTimeIntervalFactory logicalTimeIntervalFactory; protected hla.rti1516.LogicalTimeIntervalFactory ieee1516LogicalTimeIntervalFactory; - public Federate getJoinedFederate() + public LocalFederate getJoinedFederate() { return rtiAmbassador.getJoinedFederate(); } Modified: trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 02:39:35 UTC (rev 112) +++ trunk/rti/src/java/net/sf/ohla/rti1516/OHLARTIambassador.java 2007-02-13 02:47:48 UTC (rev 113) @@ -29,7 +29,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.federate.Federate; +import net.sf.ohla.rti1516.federate.LocalFederate; import net.sf.ohla.rti1516.filter.RequestResponseFilter; import net.sf.ohla.rti1516.messages.CreateFederationExecution; import net.sf.ohla.rti1516.messages.DestroyFederationExecution; @@ -193,9 +193,9 @@ */ protected Semaphore callbackSemaphore = new Semaphore(1, true); - protected Federate federate; + protected LocalFederate federate; - public Federate getJoinedFederate() + public LocalFederate getJoinedFederate() { return federate; } @@ -332,7 +332,7 @@ checkIfFederateAlreadyExecutionMember(); federate = - new Federate(federateType, federationName, federateAmbassador, + new LocalFederate(federateType, federationName, federateAmbassador, mobileFederateServices, rtiSession); return federate.getFederateHandle(); Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java 2007-02-13 02:39:35 UTC (rev 112) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java 2007-02-13 02:47:48 UTC (rev 113) @@ -1,4048 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.federate; - -import java.util.HashMap; -import java.util.Map; -import java.util.PriorityQueue; -import java.util.Queue; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.FutureTask; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import net.sf.ohla.rti1516.OHLAAttributeHandleFactory; -import net.sf.ohla.rti1516.OHLAAttributeHandleSetFactory; -import net.sf.ohla.rti1516.OHLAAttributeHandleValueMapFactory; -import net.sf.ohla.rti1516.OHLAAttributeSetRegionSetPairListFactory; -import net.sf.ohla.rti1516.OHLADimensionHandleFactory; -import net.sf.ohla.rti1516.OHLADimensionHandleSetFactory; -import net.sf.ohla.rti1516.OHLAFederateHandleFactory; -import net.sf.ohla.rti1516.OHLAFederateHandleSetFactory; -import net.sf.ohla.rti1516.OHLAInteractionClassHandleFactory; -import net.sf.ohla.rti1516.OHLAObjectClassHandleFactory; -import net.sf.ohla.rti1516.OHLAObjectInstanceHandleFactory; -import net.sf.ohla.rti1516.OHLAParameterHandleFactory; -import net.sf.ohla.rti1516.OHLAParameterHandleValueMapFactory; -import net.sf.ohla.rti1516.OHLARegionHandleSetFactory; -import net.sf.ohla.rti1516.fdd.FDD; -import net.sf.ohla.rti1516.federate.objects.ObjectManager; -import net.sf.ohla.rti1516.federate.TimeManager; -import net.sf.ohla.rti1516.messages.FederateRestoreComplete; -import net.sf.ohla.rti1516.messages.FederateRestoreNotComplete; -import net.sf.ohla.rti1516.messages.FederateSaveBegun; -import net.sf.ohla.rti1516.messages.FederateSaveComplete; -import net.sf.ohla.rti1516.messages.FederateSaveNotComplete; -import net.sf.ohla.rti1516.messages.GALTAdvanced; -import net.sf.ohla.rti1516.messages.JoinFederationExecution; -import net.sf.ohla.rti1516.messages.JoinFederationExecutionResponse; -import net.sf.ohla.rti1516.messages.QueryFederationRestoreStatus; -import net.sf.ohla.rti1516.messages.QueryFederationSaveStatus; -import net.sf.ohla.rti1516.messages.RegisterFederationSynchronizationPoint; -import net.sf.ohla.rti1516.messages.RequestAttributeValueUpdate; -import net.sf.ohla.rti1516.messages.RequestFederationRestore; -import net.sf.ohla.rti1516.messages.RequestFederationSave; -import net.sf.ohla.rti1516.messages.Retract; -import net.sf.ohla.rti1516.messages.SendInteraction; -import net.sf.ohla.rti1516.messages.SubscribeObjectClassAttributes; -import net.sf.ohla.rti1516.messages.SynchronizationPointAchieved; -import net.sf.ohla.rti1516.messages.UnsubscribeObjectClassAttributes; -import net.sf.ohla.rti1516.messages.callbacks.Callback; -import net.sf.ohla.rti1516.messages.callbacks.CallbackManager; -import net.sf.ohla.rti1516.messages.callbacks.ReceiveInteraction; -import net.sf.ohla.rti1516.messages.callbacks.ReflectAttributeValues; -import net.sf.ohla.rti1516.messages.callbacks.RemoveObjectInstance; -import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; - -import org.apache.mina.common.IoSession; -import org.apache.mina.common.WriteFuture; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.slf4j.Marker; -import org.slf4j.MarkerFactory; - -import hla.rti1516.AsynchronousDeliveryAlreadyDisabled; -import hla.rti1516.AsynchronousDeliveryAlreadyEnabled; -import hla.rti1516.AttributeAcquisitionWasNotCanceled; -import hla.rti1516.AttributeAcquisitionWasNotRequested; -import hla.rti1516.AttributeAlreadyBeingAcquired; -import hla.rti1516.AttributeAlreadyBeingDivested; -import hla.rti1516.AttributeAlreadyOwned; -import hla.rti1516.AttributeDivestitureWasNotRequested; -import hla.rti1516.AttributeHandle; -import hla.rti1516.AttributeHandleFactory; -import hla.rti1516.AttributeHandleSet; -import hla.rti1516.AttributeHandleSetFactory; -import hla.rti1516.AttributeHandleValueMap; -import hla.rti1516.AttributeHandleValueMapFactory; -import hla.rti1516.AttributeNotDefined; -import hla.rti1516.AttributeNotOwned; -import hla.rti1516.AttributeNotPublished; -import hla.rti1516.AttributeNotRecognized; -import hla.rti1516.AttributeNotSubscribed; -import hla.rti1516.AttributeRegionAssociation; -import hla.rti1516.AttributeRelevanceAdvisorySwitchIsOff; -import hla.rti1516.AttributeRelevanceAdvisorySwitchIsOn; -import hla.rti1516.AttributeScopeAdvisorySwitchIsOff; -import hla.rti1516.AttributeScopeAdvisorySwitchIsOn; -import hla.rti1516.AttributeSetRegionSetPairList; -import hla.rti1516.AttributeSetRegionSetPairListFactory; -import hla.rti1516.CouldNotDiscover; -import hla.rti1516.CouldNotInitiateRestore; -import hla.rti1516.DeletePrivilegeNotHeld; -import hla.rti1516.DimensionHandle; -import hla.rti1516.DimensionHandleFactory; -import hla.rti1516.DimensionHandleSet; -import hla.rti1516.DimensionHandleSetFactory; -import hla.rti1516.FederateAlreadyExecutionMember; -import hla.rti1516.FederateAmbassador; -import hla.rti1516.FederateHandle; -import hla.rti1516.FederateHandleFactory; -import hla.rti1516.FederateHandleRestoreStatusPair; -import hla.rti1516.FederateHandleSaveStatusPair; -import hla.rti1516.FederateHandleSet; -import hla.rti1516.FederateHandleSetFactory; -import hla.rti1516.FederateHasNotBegunSave; -import hla.rti1516.FederateInternalError; -import hla.rti1516.FederateOwnsAttributes; -import hla.rti1516.FederateServiceInvocationsAreBeingReportedViaMOM; -import hla.rti1516.FederateUnableToUseTime; -import hla.rti1516.FederationExecutionDoesNotExist; -import hla.rti1516.IllegalName; -import hla.rti1516.InTimeAdvancingState; -import hla.rti1516.InteractionClassHandle; -import hla.rti1516.InteractionClassHandleFactory; -import hla.rti1516.InteractionClassNotDefined; -import hla.rti1516.InteractionClassNotPublished; -import hla.rti1516.InteractionClassNotRecognized; -import hla.rti1516.InteractionClassNotSubscribed; -import hla.rti1516.InteractionParameterNotDefined; -import hla.rti1516.InteractionParameterNotRecognized; -import hla.rti1516.InteractionRelevanceAdvisorySwitchIsOff; -import hla.rti1516.InteractionRelevanceAdvisorySwitchIsOn; -import hla.rti1516.InvalidAttributeHandle; -import hla.rti1516.InvalidDimensionHandle; -import hla.rti1516.InvalidFederateHandle; -import hla.rti1516.InvalidInteractionClassHandle; -import hla.rti1516.InvalidLogicalTime; -import hla.rti1516.InvalidLookahead; -import hla.rti1516.InvalidMessageRetractionHandle; -import hla.rti1516.InvalidObjectClassHandle; -import hla.rti1516.InvalidOrderName; -import hla.rti1516.InvalidOrderType; -import hla.rti1516.InvalidParameterHandle; -import hla.rti1516.InvalidRangeBound; -import hla.rti1516.InvalidRegion; -import hla.rti1516.InvalidRegionContext; -import hla.rti1516.InvalidTransportationName; -import hla.rti1516.InvalidTransportationType; -import hla.rti1516.JoinedFederateIsNotInTimeAdvancingState; -import hla.rti1516.LogicalTime; -import hla.rti1516.LogicalTimeAlreadyPassed; -import hla.rti1516.LogicalTimeInterval; -import hla.rti1516.MessageCanNoLongerBeRetracted; -import hla.rti1516.MessageRetractionHandle; -import hla.rti1516.MessageRetractionReturn; -import hla.rti1516.MobileFederateServices; -import hla.rti1516.NameNotFound; -import hla.rti1516.NoRequestToEnableTimeConstrainedWasPending; -import hla.rti1516.NoRequestToEnableTimeRegulationWasPending; -import hla.rti1516.ObjectClassHandle; -import hla.rti1516.ObjectClassHandleFactory; -import hla.rti1516.ObjectClassNotDefined; -import hla.rti1516.ObjectClassNotPublished; -import hla.rti1516.ObjectClassNotRecognized; -import hla.rti1516.ObjectClassRelevanceAdvisorySwitchIsOff; -import hla.rti1516.ObjectClassRelevanceAdvisorySwitchIsOn; -import hla.rti1516.ObjectInstanceHandle; -import hla.rti1516.ObjectInstanceHandleFactory; -import hla.rti1516.ObjectInstanceNameInUse; -import hla.rti1516.ObjectInstanceNameNotReserved; -import hla.rti1516.ObjectInstanceNotKnown; -import hla.rti1516.OrderType; -import hla.rti1516.OwnershipAcquisitionPending; -import hla.rti1516.ParameterHandle; -import hla.rti1516.ParameterHandleFactory; -import hla.rti1516.ParameterHandleValueMap; -import hla.rti1516.ParameterHandleValueMapFactory; -import hla.rti1516.RTIinternalError; -import hla.rti1516.RangeBounds; -import hla.rti1516.RegionDoesNotContainSpecifiedDimension; -import hla.rti1516.RegionHandle; -import hla.rti1516.RegionHandleSet; -import hla.rti1516.RegionHandleSetFactory; -import hla.rti1516.RegionInUseForUpdateOrSubscription; -import hla.rti1516.RegionNotCreatedByThisFederate; -import hla.rti1516.RequestForTimeConstrainedPending; -import hla.rti1516.RequestForTimeRegulationPending; -import hla.rti1516.ResignAction; -import hla.rti1516.RestoreFailureReason; -import hla.rti1516.RestoreInProgress; -import hla.rti1516.RestoreNotRequested; -import hla.rti1516.SaveFailureReason; -import hla.rti1516.SaveInProgress; -import hla.rti1516.SaveNotInitiated; -import hla.rti1516.ServiceGroup; -import hla.rti1516.SpecifiedSaveLabelDoesNotExist; -import hla.rti1516.SynchronizationPointFailureReason; -import hla.rti1516.SynchronizationPointLabelNotAnnounced; -import hla.rti1516.TimeConstrainedAlreadyEnabled; -import hla.rti1516.TimeConstrainedIsNotEnabled; -import hla.rti1516.TimeQueryReturn; -import hla.rti1516.TimeRegulationAlreadyEnabled; -import hla.rti1516.TimeRegulationIsNotEnabled; -import hla.rti1516.TransportationType; -import hla.rti1516.UnableToPerformSave; -import hla.rti1516.UnknownName; -import hla.rti1516.jlc.NullFederateAmbassador; - -public class Federate -{ - public static final String OHLA_FEDERATE_HOST_PROPERTY = - "ohla.federate.%s.host"; - public static final String OHLA_FEDERATE_PORT_PROPERTY = - "ohla.federate.%s.port"; - - protected final String federateType; - protected final String federationExecutionName; - protected final FederateAmbassador federateAmbassador; - protected final MobileFederateServices mobileFederateServices; - - protected final FederateAmbassador federateAmbassadorInterceptor = - new FederateAmbassadorInterceptor(); - - protected FederateHandle federateHandle; - - protected String federationName; - protected FDD fdd; - - protected FederateState federateState = FederateState.ACTIVE; - - protected ReadWriteLock federateStateLock = - new ReentrantReadWriteLock(true); - - protected FederateSaveState federateSaveState; - protected FederateSave federateSave; - - protected FederateRestoreState federateRestoreState; - protected FederateRestore federateRestore; - - protected Lock synchronizationPointLock = new ReentrantLock(true); - protected Map<String, FederateSynchronizationPoint> synchronizationPoints = - new HashMap<String, FederateSynchronizationPoint>(); - - protected boolean asynchronousDeliveryEnabled; - - protected ObjectManager objectManager = new ObjectManager(this); - protected RegionManager regionManager = new RegionManager(this); - protected MessageRetractionManager messageRetractionManager = - new MessageRetractionManager(this); - - protected TimeManager timeManager; - protected CallbackManager callbackManager = new CallbackManager(this); - - protected Lock futureTasksLock = new ReentrantLock(true); - protected Queue<TimestampedFutureTask> futureTasks = - new PriorityQueue<TimestampedFutureTask>(); - - protected AttributeHandleFactory attributeHandleFactory = - new OHLAAttributeHandleFactory(); - protected AttributeHandleSetFactory attributeHandleSetFactory = - new OHLAAttributeHandleSetFactory(); - protected AttributeHandleValueMapFactory attributeHandleValueMapFactory = - new OHLAAttributeHandleValueMapFactory(); - protected AttributeSetRegionSetPairListFactory attributeSetRegionSetPairListFactory = - new OHLAAttributeSetRegionSetPairListFactory(); - protected DimensionHandleFactory dimensionHandleFactory = - new OHLADimensionHandleFactory(); - protected DimensionHandleSetFactory dimensionHandleSetFactory = - new OHLADimensionHandleSetFactory(); - protected FederateHandleFactory federateHandleFactory = - new OHLAFederateHandleFactory(); - protected FederateHandleSetFactory federateHandleSetFactory = - new OHLAFederateHandleSetFactory(); - protected InteractionClassHandleFactory interactionClassHandleFactory = - new OHLAInteractionClassHandleFactory(); - protected ObjectClassHandleFactory objectClassHandleFactory = - new OHLAObjectClassHandleFactory(); - protected ObjectInstanceHandleFactory objectInstanceHandleFactory = - new OHLAObjectInstanceHandleFactory(); - protected ParameterHandleFactory parameterHandleFactory = - new OHLAParameterHandleFactory(); - protected ParameterHandleValueMapFactory parameterHandleValueMapFactory = - new OHLAParameterHandleValueMapFactory(); - protected RegionHandleSetFactory regionHandleSetFactory = - new OHLARegionHandleSetFactory(); - - /** - * The session with the RTI. - */ - protected IoSession rtiSession; - - protected final Logger log = LoggerFactory.getLogger(getClass()); - protected final Marker marker; - - public Federate(String federateType, String federationExecutionName, - FederateAmbassador federateAmbassador, - MobileFederateServices mobileFederateServices, - IoSession rtiSession) - throws FederationExecutionDoesNotExist, SaveInProgress, RestoreInProgress, - RTIinternalError - { - this.federateType = federateType; - this.federationExecutionName = federationExecutionName; - this.federateAmbassador = federateAmbassador; - this.mobileFederateServices = mobileFederateServices; - this.rtiSession = rtiSession; - - marker = MarkerFactory.getMarker(federateType); - - JoinFederationExecution joinFederationExecution = - new JoinFederationExecution( - federateType, federationExecutionName, mobileFederateServices); - WriteFuture writeFuture = rtiSession.write(joinFederationExecution); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - try - { - // TODO: set timeout - // - Object response = joinFederationExecution.getResponse(); - if (response instanceof JoinFederationExecutionResponse) - { - JoinFederationExecutionResponse joinFederationExecutionResponse = - (JoinFederationExecutionResponse) response; - - federateHandle = joinFederationExecutionResponse.getFederateHandle(); - fdd = joinFederationExecutionResponse.getFdd(); - - LogicalTime galt = joinFederationExecutionResponse.getGALT(); - timeManager = new TimeManager(this, mobileFederateServices, galt); - - log.info(marker, "joined federation execution: {}", federateHandle); - } - else if (response instanceof FederationExecutionDoesNotExist) - { - throw new FederationExecutionDoesNotExist( - (FederationExecutionDoesNotExist) response); - } - else if (response instanceof SaveInProgress) - { - throw new SaveInProgress((SaveInProgress) response); - } - else if (response instanceof RestoreInProgress) - { - throw new RestoreInProgress((RestoreInProgress) response); - } - else - { - assert false : String.format("unexpected response: %s", response); - } - } - catch (InterruptedException ie) - { - throw new RTIinternalError("interrupted awaiting timeout", ie); - } - catch (ExecutionException ee) - { - throw new RTIinternalError("unable to get response", ee); - } - } - - public FederateHandle getFederateHandle() - { - return federateHandle; - } - - public FederateAmbassador getFederateAmbassador() - { - return federateAmbassadorInterceptor; - } - - public FDD getFDD() - { - return fdd; - } - - public ObjectManager getObjectManager() - { - return objectManager; - } - - public RegionManager getRegionManager() - { - return regionManager; - } - - public MessageRetractionManager getMessageRetractionManager() - { - return messageRetractionManager; - } - - public TimeManager getTimeManager() - { - return timeManager; - } - - public CallbackManager getCallbackManager() - { - return callbackManager; - } - - public IoSession getRTISession() - { - return rtiSession; - } - - public boolean isAsynchronousDeliveryEnabled() - { - return asynchronousDeliveryEnabled; - } - - public void processFutureTasks(LogicalTime maxFutureTaskTimestamp) - { - futureTasksLock.lock(); - try - { - log.debug(marker, "processing future tasks: {}", maxFutureTaskTimestamp); - - for (TimestampedFutureTask timestampedFutureTask = futureTasks.peek(); - timestampedFutureTask != null && - timestampedFutureTask.getTime().compareTo( - maxFutureTaskTimestamp) <= 0; - timestampedFutureTask = futureTasks.peek()) - { - log.debug(marker, "processing future task: {}", timestampedFutureTask); - - try - { - timestampedFutureTask.run(); - } - catch (Throwable t) - { - log.error(marker, String.format("unable to execute scheduled task: %s", - timestampedFutureTask), t); - } - - futureTasks.poll(); - } - } - finally - { - futureTasksLock.unlock(); - } - } - - public boolean process(IoSession session, Object message) - { - log.debug(marker, "processing: {}", message); - - boolean processed = true; - if (message instanceof Callback) - { - if (message instanceof ReflectAttributeValues) - { - ReflectAttributeValues reflectAttributeValues = - (ReflectAttributeValues) message; - - timeManager.getTimeLock().readLock().lock(); - try - { - OrderType receivedOrderType = - reflectAttributeValues.getSentOrderType() == OrderType.TIMESTAMP && - timeManager.isTimeConstrained() ? OrderType.TIMESTAMP : - OrderType.RECEIVE; - reflectAttributeValues.setReceivedOrderType(receivedOrderType); - - if (receivedOrderType == OrderType.RECEIVE) - { - // receive order callbacks need to be held until released if we - // are constrained and in the time granted state if asynchronous - // delivery is disabled - // - boolean hold = timeManager.isTimeConstrainedAndTimeGranted() && - !isAsynchronousDeliveryEnabled(); - - callbackManager.add(reflectAttributeValues, hold); - } - else - { - // schedule the callback for the appropriate time - // - Future future = schedule( - reflectAttributeValues.getUpdateTime(), - new AddCallback(reflectAttributeValues)); - - // register the message retraction handle - // - messageRetractionManager.add( - reflectAttributeValues.getUpdateTime(), future, - reflectAttributeValues.getMessageRetractionHandle()); - } - } - finally - { - timeManager.getTimeLock().readLock().unlock(); - } - } - else if (message instanceof ReceiveInteraction) - { - ReceiveInteraction receiveInteraction = (ReceiveInteraction) message; - - timeManager.getTimeLock().readLock().lock(); - try - { - OrderType receivedOrderType = - receiveInteraction.getSentOrderType() == OrderType.TIMESTAMP && - timeManager.isTimeConstrained() ? OrderType.TIMESTAMP : - OrderType.RECEIVE; - - receiveInteraction.setReceivedOrderType(receivedOrderType); - - if (receivedOrderType == OrderType.RECEIVE) - { - // receive order callbacks need to be held until released if we - // are constrained and in the time granted state, if asynchronous - // delivery is disabled - // - boolean hold = timeManager.isTimeConstrainedAndTimeGranted() && - !isAsynchronousDeliveryEnabled(); - - callbackManager.add(receiveInteraction, hold); - } - else - { - // schedule the callback for the appropriate time - // - Future future = schedule(receiveInteraction.getSendTime(), - new AddCallback(receiveInteraction)); - - // register the message retraction handle - // - messageRetractionManager.add( - receiveInteraction.getSendTime(), future, - receiveInteraction.getMessageRetractionHandle()); - } - } - finally - { - timeManager.getTimeLock().readLock().unlock(); - } - } - else if (message instanceof RemoveObjectInstance) - { - RemoveObjectInstance removeObjectInstance = - (RemoveObjectInstance) message; - - timeManager.getTimeLock().readLock().lock(); - try - { - OrderType receivedOrderType = - removeObjectInstance.getSentOrderType() == OrderType.TIMESTAMP && - timeManager.isTimeConstrained() ? OrderType.TIMESTAMP : - OrderType.RECEIVE; - - removeObjectInstance.setReceivedOrderType(receivedOrderType); - - if (receivedOrderType == OrderType.RECEIVE) - { - // receive order callbacks need to be held until released if we - // are constrained and in the time granted state, if asynchronous - // delivery is disabled - // - boolean hold = timeManager.isTimeConstrainedAndTimeGranted() && - !isAsynchronousDeliveryEnabled(); - - callbackManager.add(removeObjectInstance, hold); - } - else - { - // schedule the callback for the appropriate time - // - Future future = schedule(removeObjectInstance.getDeleteTime(), - new AddCallback(removeObjectInstance)); - - // register the message retraction handle - // - messageRetractionManager.add( - removeObjectInstance.getDeleteTime(), future, - removeObjectInstance.getMessageRetractionHandle()); - } - } - finally - { - timeManager.getTimeLock().readLock().unlock(); - } - } - else - { - if (message instanceof TimeAdvanceGrant) - { - processFutureTasks(((TimeAdvanceGrant) message).getTime()); - } - - callbackManager.add((Callback) message); - } - } - else if (message instanceof GALTAdvanced) - { - GALTAdvanced galtAdvanced = (GALTAdvanced) message; - - LogicalTime galt = galtAdvanced.getGALT(); - - timeManager.galtAdvanced(galt); - } - else - { - processed = false; - } - return processed; - } - - public void resignFederationExecution(ResignAction resignAction) - throws OwnershipAcquisitionPending, FederateOwnsAttributes, - RTIinternalError - { - federateStateLock.writeLock().lock(); - try - { - objectManager.resignFederationExecution(resignAction); - - federateState = null; - } - finally - { - federateStateLock.writeLock().unlock(); - } - } - - public void registerFederationSynchronizationPoint(String label, byte[] tag) - throws SaveInProgress, RestoreInProgress, RTIinternalError - { - registerFederationSynchronizationPoint(label, tag, null); - } - - public void registerFederationSynchronizationPoint( - String label, byte[] tag, FederateHandleSet federateHandles) - throws SaveInProgress, RestoreInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - writeFuture = rtiSession.write( - new RegisterFederationSynchronizationPoint( - label, tag, federateHandles)); - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void synchronizationPointAchieved(String label) - throws SynchronizationPointLabelNotAnnounced, SaveInProgress, - RestoreInProgress, RTIinternalError - { - WriteFuture writeFuture = null; - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - synchronizationPointLock.lock(); - try - { - FederateSynchronizationPoint federateSynchronizationPoint = - synchronizationPoints.get(label); - if (federateSynchronizationPoint == null) - { - throw new SynchronizationPointLabelNotAnnounced(label); - } - else - { - federateSynchronizationPoint.synchronizationPointAchieved(); - - writeFuture = - rtiSession.write(new SynchronizationPointAchieved(label)); - } - } - finally - { - synchronizationPointLock.unlock(); - } - } - finally - { - federateStateLock.readLock().unlock(); - } - - if (writeFuture != null) - { - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - } - - public void requestFederationSave(String label) - throws SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.writeLock().lock(); - try - { - checkIfActive(); - - RequestFederationSave requestFederationSave = - new RequestFederationSave(label); - WriteFuture writeFuture = rtiSession.write(requestFederationSave); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - // TODO: set timeout - // - Object response = requestFederationSave.getResponse(); - if (response instanceof SaveInProgress) - { - throw new SaveInProgress((SaveInProgress) response); - } - else if (response instanceof RestoreInProgress) - { - throw new RestoreInProgress((RestoreInProgress) response); - } - else - { - assert response == null : - String.format("unexpected response: %s", response); - } - } - catch (InterruptedException ie) - { - throw new RTIinternalError("interrupted awaiting timeout", ie); - } - catch (ExecutionException ee) - { - throw new RTIinternalError("unable to get response", ee); - } - finally - { - federateStateLock.writeLock().unlock(); - } - } - - public void requestFederationSave(String label, LogicalTime saveTime) - throws LogicalTimeAlreadyPassed, InvalidLogicalTime, - FederateUnableToUseTime, SaveInProgress, RestoreInProgress, - RTIinternalError - { - federateStateLock.writeLock().lock(); - try - { - checkIfActive(); - - // no need to lock time manager because we have a write lock on the - // federate state - // - timeManager.checkIfLogicalTimeAlreadyPassed(saveTime); - - RequestFederationSave requestFederationSave = - new RequestFederationSave(label, saveTime); - WriteFuture writeFuture = rtiSession.write(requestFederationSave); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - // TODO: set timeout - // - Object response = requestFederationSave.getResponse(); - if (response instanceof LogicalTimeAlreadyPassed) - { - throw new LogicalTimeAlreadyPassed((LogicalTimeAlreadyPassed) response); - } - else if (response instanceof SaveInProgress) - { - throw new SaveInProgress((SaveInProgress) response); - } - else if (response instanceof RestoreInProgress) - { - throw new RestoreInProgress((RestoreInProgress) response); - } - else - { - assert false : String.format("unexpected response: %s", response); - } - } - catch (InterruptedException ie) - { - throw new RTIinternalError("interrupted awaiting timeout", ie); - } - catch (ExecutionException ee) - { - throw new RTIinternalError("unable to get response", ee); - } - finally - { - federateStateLock.writeLock().unlock(); - } - } - - public void federateSaveBegun() - throws SaveNotInitiated, RestoreInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - if (federateSaveState != FederateSaveState.INSTRUCTED_TO_SAVE) - { - throw new SaveNotInitiated(); - } - - writeFuture = rtiSession.write(new FederateSaveBegun()); - - federateSaveState = FederateSaveState.SAVING; - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void federateSaveComplete() - throws FederateHasNotBegunSave, RestoreInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - checkIfRestoreInProgress(); - - if (federateSaveState != FederateSaveState.SAVING) - { - throw new FederateHasNotBegunSave(); - } - - writeFuture = rtiSession.write(new FederateSaveComplete(null)); - - federateSaveState = FederateSaveState.WAITING_FOR_FEDERATION_TO_SAVE; - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void federateSaveNotComplete() - throws FederateHasNotBegunSave, RestoreInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - checkIfRestoreInProgress(); - - if (federateSaveState != FederateSaveState.SAVING) - { - throw new FederateHasNotBegunSave(); - } - - writeFuture = rtiSession.write(new FederateSaveNotComplete()); - - federateSaveState = FederateSaveState.WAITING_FOR_FEDERATION_TO_SAVE; - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void queryFederationSaveStatus() - throws RestoreInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - checkIfRestoreInProgress(); - - writeFuture = rtiSession.write(new QueryFederationSaveStatus()); - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void requestFederationRestore(String label) - throws SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - RequestFederationRestore requestFederationRestore = - new RequestFederationRestore(label); - WriteFuture writeFuture = rtiSession.write(requestFederationRestore); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - // TODO: set timeout - // - Object response = requestFederationRestore.getResponse(); - if (response instanceof SaveInProgress) - { - throw new SaveInProgress((SaveInProgress) response); - } - else if (response instanceof RestoreInProgress) - { - throw new RestoreInProgress((RestoreInProgress) response); - } - else - { - assert false : String.format("unexpected response: %s", response); - } - } - catch (InterruptedException ie) - { - throw new RTIinternalError("interrupted awaiting timeout", ie); - } - catch (ExecutionException ee) - { - throw new RTIinternalError("unable to get response", ee); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void federateRestoreComplete() - throws RestoreNotRequested, SaveInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - checkIfSaveInProgress(); - - if (federateRestoreState != FederateRestoreState.RESTORING) - { - throw new RestoreNotRequested(); - } - - writeFuture = rtiSession.write(new FederateRestoreComplete()); - - federateRestoreState = - FederateRestoreState.WAITING_FOR_FEDERATION_TO_RESTORE; - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void federateRestoreNotComplete() - throws RestoreNotRequested, SaveInProgress, RTIinternalError - { - WriteFuture writeFuture; - - federateStateLock.readLock().lock(); - try - { - checkIfSaveInProgress(); - - if (federateRestoreState != FederateRestoreState.RESTORING) - { - throw new RestoreNotRequested(); - } - - writeFuture = rtiSession.write(new FederateRestoreNotComplete()); - - federateRestoreState = - FederateRestoreState.WAITING_FOR_FEDERATION_TO_RESTORE; - } - finally - { - federateStateLock.readLock().unlock(); - } - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - public void queryFederationRestoreStatus() - throws SaveInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfSaveInProgress(); - - WriteFuture writeFuture = - rtiSession.write(new QueryFederationRestoreStatus()); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void publishObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) - throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, - RestoreInProgress, RTIinternalError - { - // ensure we have a valid object class and attribute handles - // - fdd.checkIfAttributeNotDefined(objectClassHandle, attributeHandles); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.publishObjectClassAttributes( - objectClassHandle, attributeHandles); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unpublishObjectClass(ObjectClassHandle objectClassHandle) - throws ObjectClassNotDefined, OwnershipAcquisitionPending, - SaveInProgress, RestoreInProgress, RTIinternalError - { - // ensure we have a valid object class handle - // - fdd.checkIfObjectClassNotDefined(objectClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unpublishObjectClass(objectClassHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unpublishObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) - throws ObjectClassNotDefined, AttributeNotDefined, - OwnershipAcquisitionPending, SaveInProgress, RestoreInProgress, - RTIinternalError - { - // ensure we have a valid object class handle - // - fdd.checkIfObjectClassNotDefined(objectClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unpublishObjectClassAttributes( - objectClassHandle, attributeHandles); - - // TODO: give up ownership of the specified attributes - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void publishInteractionClass( - InteractionClassHandle interactionClassHandle) - throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, - RTIinternalError - { - // ensure we have a valid interaction class handle - // - fdd.checkIfInteractionClassNotDefined(interactionClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.publishInteractionClass(interactionClassHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unpublishInteractionClass( - InteractionClassHandle interactionClassHandle) - throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, - RTIinternalError - { - // ensure we have a valid interaction class handle - // - fdd.checkIfInteractionClassNotDefined(interactionClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unpublishInteractionClass(interactionClassHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void subscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) - throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, - RestoreInProgress, RTIinternalError - { - subscribeObjectClassAttributes(objectClassHandle, attributeHandles, false); - } - - public void subscribeObjectClassAttributesPassively( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) - throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, - RestoreInProgress, RTIinternalError - { - subscribeObjectClassAttributes(objectClassHandle, attributeHandles, true); - } - - protected void subscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles, - boolean passive) - throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, - RestoreInProgress, RTIinternalError - { - // ensure we have a valid object class and attribute handles - // - fdd.checkIfAttributeNotDefined(objectClassHandle, attributeHandles); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.subscribeObjectClassAttributes( - objectClassHandle, attributeHandles, passive); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unsubscribeObjectClass(ObjectClassHandle objectClassHandle) - throws ObjectClassNotDefined, SaveInProgress, RestoreInProgress, - RTIinternalError - { - // ensure we have a valid object class handle - // - fdd.checkIfObjectClassNotDefined(objectClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unsubscribeObjectClass(objectClassHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unsubscribeObjectClassAttributes( - ObjectClassHandle objectClassHandle, AttributeHandleSet attributeHandles) - throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, - RestoreInProgress, RTIinternalError - { - // ensure we have a valid object class handle - // - fdd.checkIfObjectClassNotDefined(objectClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unsubscribeObjectClassAttributes( - objectClassHandle, attributeHandles); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void subscribeInteractionClass( - InteractionClassHandle interactionClassHandle) - throws InteractionClassNotDefined, - FederateServiceInvocationsAreBeingReportedViaMOM, SaveInProgress, - RestoreInProgress, RTIinternalError - { - subscribeInteractionClass(interactionClassHandle, false); - } - - public void subscribeInteractionClassPassively( - InteractionClassHandle interactionClassHandle) - throws InteractionClassNotDefined, - FederateServiceInvocationsAreBeingReportedViaMOM, SaveInProgress, - RestoreInProgress, RTIinternalError - { - subscribeInteractionClass(interactionClassHandle, true); - } - - protected void subscribeInteractionClass( - InteractionClassHandle interactionClassHandle, boolean passive) - throws InteractionClassNotDefined, - FederateServiceInvocationsAreBeingReportedViaMOM, SaveInProgress, - RestoreInProgress, RTIinternalError - { - // ensure we have a valid interaction class handle - // - fdd.checkIfInteractionClassNotDefined(interactionClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.subscribeInteractionClass(interactionClassHandle, passive); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unsubscribeInteractionClass( - InteractionClassHandle interactionClassHandle) - throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, - RTIinternalError - { - // ensure we have a valid interaction class handle - // - fdd.checkIfInteractionClassNotDefined(interactionClassHandle); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unsubscribeInteractionClass(interactionClassHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void reserveObjectInstanceName(String name) - throws IllegalName, SaveInProgress, RestoreInProgress, RTIinternalError - { - if (name.startsWith("HLA")) - { - throw new IllegalName(String.format("starts with 'HLA': %s", name)); - } - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.reserveObjectInstanceName(name); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public ObjectInstanceHandle registerObjectInstance( - ObjectClassHandle objectClassHandle) - throws ObjectClassNotDefined, ObjectClassNotPublished, SaveInProgress, - RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - return objectManager.registerObjectInstance(objectClassHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public ObjectInstanceHandle registerObjectInstance( - ObjectClassHandle objectClassHandle, String name) - throws ObjectClassNotDefined, ObjectClassNotPublished, - ObjectInstanceNameNotReserved, ObjectInstanceNameInUse, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - return objectManager.registerObjectInstance(objectClassHandle, name); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void updateAttributeValues( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleValueMap attributeValues, byte[] tag) - throws ObjectInstanceNotKnown, AttributeNotDefined, AttributeNotOwned, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.updateAttributeValues( - objectInstanceHandle, attributeValues, tag); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public MessageRetractionReturn updateAttributeValues( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleValueMap attributeValues, byte[] tag, LogicalTime updateTime) - throws ObjectInstanceNotKnown, AttributeNotDefined, AttributeNotOwned, - InvalidLogicalTime, SaveInProgress, RestoreInProgress, - RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - MessageRetractionHandle messageRetractionHandle = null; - - timeManager.getTimeLock().readLock().lock(); - try - { - timeManager.updateAttributeValues(updateTime); - - OrderType sentOrderType = - timeManager.isTimeRegulating() && updateTime != null ? - OrderType.TIMESTAMP : OrderType.RECEIVE; - - if (sentOrderType == OrderType.TIMESTAMP) - { - messageRetractionHandle = messageRetractionManager.add(updateTime); - } - - objectManager.updateAttributeValues( - objectInstanceHandle, attributeValues, tag, updateTime, - messageRetractionHandle, sentOrderType); - } - finally - { - timeManager.getTimeLock().readLock().unlock(); - } - - return new MessageRetractionReturn(messageRetractionHandle != null, - messageRetractionHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void sendInteraction( - InteractionClassHandle interactionClassHandle, - ParameterHandleValueMap parameterValues, byte[] tag) - throws InteractionClassNotPublished, InteractionClassNotDefined, - InteractionParameterNotDefined, SaveInProgress, RestoreInProgress, - RTIinternalError - { - // ensure we have a valid interaction class and parameter handles - // - fdd.checkIfInteractionParameterNotDefined( - interactionClassHandle, parameterValues.keySet()); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.sendInteraction( - interactionClassHandle, parameterValues, tag); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public MessageRetractionReturn sendInteraction( - InteractionClassHandle interactionClassHandle, - ParameterHandleValueMap parameterValues, byte[] tag, LogicalTime sendTime) - throws InteractionClassNotPublished, InteractionClassNotDefined, - InteractionParameterNotDefined, InvalidLogicalTime, SaveInProgress, - RestoreInProgress, RTIinternalError - { - // ensure we have a valid interaction class and parameter handles - // - fdd.checkIfInteractionParameterNotDefined( - interactionClassHandle, parameterValues.keySet()); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - MessageRetractionHandle messageRetractionHandle = null; - - timeManager.getTimeLock().readLock().lock(); - try - { - timeManager.sendInteraction(sendTime); - - OrderType sentOrderType = - timeManager.isTimeRegulating() && sendTime != null ? - OrderType.TIMESTAMP : OrderType.RECEIVE; - - if (sentOrderType == OrderType.TIMESTAMP) - { - messageRetractionHandle = messageRetractionManager.add(sendTime); - } - - objectManager.sendInteraction( - interactionClassHandle, parameterValues, tag, sendTime, - messageRetractionHandle, sentOrderType); - } - finally - { - timeManager.getTimeLock().readLock().unlock(); - } - - return new MessageRetractionReturn(messageRetractionHandle != null, - messageRetractionHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void deleteObjectInstance( - ObjectInstanceHandle objectInstanceHandle, byte[] tag) - throws ObjectInstanceNotKnown, DeletePrivilegeNotHeld, SaveInProgress, - RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.deleteObjectInstance(objectInstanceHandle, tag); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public MessageRetractionReturn deleteObjectInstance( - ObjectInstanceHandle objectInstanceHandle, byte[] tag, - LogicalTime deleteTime) - throws ObjectInstanceNotKnown, DeletePrivilegeNotHeld, InvalidLogicalTime, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - MessageRetractionHandle messageRetractionHandle = null; - - timeManager.getTimeLock().readLock().lock(); - try - { - timeManager.deleteObjectInstance(deleteTime); - - OrderType sentOrderType = - timeManager.isTimeRegulating() && deleteTime != null ? - OrderType.TIMESTAMP : OrderType.RECEIVE; - - if (sentOrderType == OrderType.TIMESTAMP) - { - messageRetractionHandle = messageRetractionManager.add(deleteTime); - } - - objectManager.deleteObjectInstance( - objectInstanceHandle, tag, deleteTime, messageRetractionHandle, - sentOrderType); - } - finally - { - timeManager.getTimeLock().readLock().unlock(); - } - - return new MessageRetractionReturn(messageRetractionHandle != null, - messageRetractionHandle); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void localDeleteObjectInstance( - ObjectInstanceHandle objectInstanceHandle) - throws ObjectInstanceNotKnown, FederateOwnsAttributes, - OwnershipAcquisitionPending, SaveInProgress, RestoreInProgress, - RTIinternalError - { - objectManager.localDeleteObjectInstance(objectInstanceHandle); - } - - public void changeAttributeTransportationType( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleSet attributeHandles, TransportationType transportationType) - throws ObjectInstanceNotKnown, AttributeNotDefined, AttributeNotOwned, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.changeAttributeTransportationType( - objectInstanceHandle, attributeHandles, transportationType); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void changeInteractionTransportationType( - InteractionClassHandle interactionClassHandle, - TransportationType transportationType) - throws InteractionClassNotDefined, InteractionClassNotPublished, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.changeInteractionTransportationType( - interactionClassHandle, transportationType); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void requestAttributeValueUpdate( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleSet attributeHandles, byte[] tag) - throws ObjectInstanceNotKnown, AttributeNotDefined, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.requestAttributeValueUpdate( - objectInstanceHandle, attributeHandles, tag); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void requestAttributeValueUpdate( - ObjectClassHandle objectClassHandle, - AttributeHandleSet attributeHandles, - byte[] tag) - throws ObjectClassNotDefined, AttributeNotDefined, SaveInProgress, - RestoreInProgress, RTIinternalError - { - // check to see if the handles are valid - // - fdd.checkIfAttributeNotDefined(objectClassHandle, attributeHandles); - - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - WriteFuture writeFuture = rtiSession.write( - new RequestAttributeValueUpdate( - objectClassHandle, attributeHandles, tag)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void unconditionalAttributeOwnershipDivestiture( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleSet attributeHandles) - throws ObjectInstanceNotKnown, AttributeNotDefined, AttributeNotOwned, - SaveInProgress, RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.unconditionalAttributeOwnershipDivestiture( - objectInstanceHandle, attributeHandles); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void negotiatedAttributeOwnershipDivestiture( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleSet attributeHandles, byte[] tag) - throws ObjectInstanceNotKnown, AttributeNotDefined, AttributeNotOwned, - AttributeAlreadyBeingDivested, SaveInProgress, RestoreInProgress, - RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.negotiatedAttributeOwnershipDivestiture( - objectInstanceHandle, attributeHandles, tag); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void confirmDivestiture( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleSet attributeHandles, byte[] tag) - throws ObjectInstanceNotKnown, AttributeNotDefined, AttributeNotOwned, - AttributeDivestitureWasNotRequested, SaveInProgress, - RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManager.confirmDivestiture( - objectInstanceHandle, attributeHandles, tag); - } - finally - { - federateStateLock.readLock().unlock(); - } - } - - public void attributeOwnershipAcquisition( - ObjectInstanceHandle objectInstanceHandle, - AttributeHandleSet attributeHandles, byte[] tag) - throws ObjectInstanceNotKnown, ObjectClassNotPublished, AttributeNotDefined, - AttributeNotPublished, FederateOwnsAttributes, SaveInProgress, - RestoreInProgress, RTIinternalError - { - federateStateLock.readLock().lock(); - try - { - checkIfActive(); - - objectManage... [truncated message content] |
From: <mne...@us...> - 2007-02-13 02:39:34
|
Revision: 112 http://svn.sourceforge.net/ohla/?rev=112&view=rev Author: mnewcomb Date: 2007-02-12 18:39:35 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 02:38:13
|
Revision: 111 http://svn.sourceforge.net/ohla/?rev=111&view=rev Author: mnewcomb Date: 2007-02-12 18:38:14 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/TimeManager.java Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TemporalState.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeAdvanceType.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeConstrainedState.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeRegulatingState.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-02-13 02:33:41 UTC (rev 110) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/Federate.java 2007-02-13 02:38:14 UTC (rev 111) @@ -45,7 +45,7 @@ import net.sf.ohla.rti1516.OHLARegionHandleSetFactory; import net.sf.ohla.rti1516.fdd.FDD; import net.sf.ohla.rti1516.federate.objects.ObjectManager; -import net.sf.ohla.rti1516.federate.time.TimeManager; +import net.sf.ohla.rti1516.federate.TimeManager; import net.sf.ohla.rti1516.messages.FederateRestoreComplete; import net.sf.ohla.rti1516.messages.FederateRestoreNotComplete; import net.sf.ohla.rti1516.messages.FederateSaveBegun; Copied: trunk/rti/src/java/net/sf/ohla/rti1516/federate/TimeManager.java (from rev 108, trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java) =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/TimeManager.java (rev 0) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/TimeManager.java 2007-02-13 02:38:14 UTC (rev 111) @@ -0,0 +1,867 @@ +/* + * Copyright (c) 2006, Michael Newcomb + * + * Licensed 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 net.sf.ohla.rti1516.federate; + +import java.util.concurrent.locks.ReadWriteLock; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +import net.sf.ohla.rti1516.federate.Federate; +import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; +import net.sf.ohla.rti1516.messages.DisableTimeConstrained; +import net.sf.ohla.rti1516.messages.DisableTimeRegulation; +import net.sf.ohla.rti1516.messages.EnableTimeConstrained; +import net.sf.ohla.rti1516.messages.EnableTimeRegulation; +import net.sf.ohla.rti1516.messages.ModifyLookahead; +import net.sf.ohla.rti1516.messages.TimeAdvanceRequest; +import net.sf.ohla.rti1516.messages.TimeAdvanceRequestAvailable; + +import org.apache.mina.common.WriteFuture; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import hla.rti1516.FederateAmbassador; +import hla.rti1516.IllegalTimeArithmetic; +import hla.rti1516.InTimeAdvancingState; +import hla.rti1516.InvalidLogicalTime; +import hla.rti1516.InvalidLookahead; +import hla.rti1516.LogicalTime; +import hla.rti1516.LogicalTimeAlreadyPassed; +import hla.rti1516.LogicalTimeInterval; +import hla.rti1516.MobileFederateServices; +import hla.rti1516.RTIinternalError; +import hla.rti1516.RequestForTimeConstrainedPending; +import hla.rti1516.RequestForTimeRegulationPending; +import hla.rti1516.TimeConstrainedAlreadyEnabled; +import hla.rti1516.TimeConstrainedIsNotEnabled; +import hla.rti1516.TimeQueryReturn; +import hla.rti1516.TimeRegulationAlreadyEnabled; +import hla.rti1516.TimeRegulationIsNotEnabled; + +public class TimeManager +{ + private static final Logger log = LoggerFactory.getLogger(TimeManager.class); + + protected enum TemporalState + { + TIME_ADVANCING, TIME_GRANTED + } + + protected enum TimeAdvanceType + { + TIME_ADVANCE_REQUEST, TIME_ADVANCE_REQUEST_AVAILABLE, + NEXT_MESSAGE_REQUEST, NEXT_MESSAGE_REQUEST_AVAILABLE, + FLUSH_QUEUE_REQUEST + } + + protected enum TimeRegulatingState + { + TIME_REGULATING, BECOMING_TIME_REGULATING, NOT_TIME_REGULATING + } + + protected enum TimeConstrainedState + { + TIME_CONSTRAINED, BECOMING_TIME_CONSTRAINED, NOT_TIME_CONSTRAINED + } + + protected final Federate federate; + protected final MobileFederateServices mobileFederateServices; + + protected ReadWriteLock timeLock = new ReentrantReadWriteLock(true); + + protected TemporalState temporalState = TemporalState.TIME_GRANTED; + protected TimeRegulatingState timeRegulatingState = + TimeRegulatingState.NOT_TIME_REGULATING; + protected TimeConstrainedState timeConstrainedState = + TimeConstrainedState.NOT_TIME_CONSTRAINED; + + protected LogicalTime federateTime; + protected LogicalTime galt; + protected LogicalTime lits; + + protected LogicalTimeInterval lookahead; + + protected LogicalTime advanceRequestTime; + protected TimeAdvanceType advanceRequestTimeType; + + public TimeManager(Federate federate, + MobileFederateServices mobileFederateServices, + LogicalTime galt) + { + this.federate = federate; + this.mobileFederateServices = mobileFederateServices; + this.galt = galt; + + federateTime = mobileFederateServices.timeFactory.makeInitial(); + } + + public ReadWriteLock getTimeLock() + { + return timeLock; + } + + public boolean isTimeRegulating() + { + return timeRegulatingState == TimeRegulatingState.TIME_REGULATING; + } + + public boolean isTimeConstrained() + { + return timeConstrainedState == TimeConstrainedState.TIME_CONSTRAINED; + } + + public boolean isTimeAdvancing() + { + return temporalState == TemporalState.TIME_ADVANCING; + } + + public boolean isTimeGranted() + { + return temporalState == TemporalState.TIME_GRANTED; + } + + public boolean isTimeConstrainedAndTimeGranted() + { + return isTimeConstrained() && isTimeGranted(); + } + + public void enableTimeRegulation(LogicalTimeInterval lookahead) + throws TimeRegulationAlreadyEnabled, InvalidLookahead, InTimeAdvancingState, + RequestForTimeRegulationPending, RTIinternalError + { + timeLock.writeLock().lock(); + try + { + if (timeRegulatingState == TimeRegulatingState.TIME_REGULATING) + { + throw new TimeRegulationAlreadyEnabled(); + } + + checkIfInvalidLookahead(lookahead); + checkIfInTimeAdvancingState(); + checkIfRequestForTimeRegulationPending(); + + WriteFuture writeFuture = + federate.getRTISession().write(new EnableTimeRegulation(lookahead)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + this.lookahead = lookahead; + + timeRegulatingState = TimeRegulatingState.BECOMING_TIME_REGULATING; + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void disableTimeRegulation() + throws TimeRegulationIsNotEnabled, RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfTimeRegulationIsNotEnabled(); + + WriteFuture writeFuture = + federate.getRTISession().write(new DisableTimeRegulation()); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + timeRegulatingState = TimeRegulatingState.NOT_TIME_REGULATING; + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void enableTimeConstrained() + throws TimeConstrainedAlreadyEnabled, InTimeAdvancingState, + RequestForTimeConstrainedPending, RTIinternalError + { + timeLock.writeLock().lock(); + try + { + if (timeConstrainedState == TimeConstrainedState.TIME_CONSTRAINED) + { + throw new TimeConstrainedAlreadyEnabled(); + } + + checkIfInTimeAdvancingState(); + + checkIfRequestForTimeConstrainedPending(); + + WriteFuture writeFuture = + federate.getRTISession().write(new EnableTimeConstrained()); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + timeConstrainedState = TimeConstrainedState.BECOMING_TIME_CONSTRAINED; + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void disableTimeConstrained() + throws TimeConstrainedIsNotEnabled, RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfTimeConstrainedIsNotEnabled(); + + WriteFuture writeFuture = + federate.getRTISession().write(new DisableTimeConstrained()); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + timeConstrainedState = TimeConstrainedState.NOT_TIME_CONSTRAINED; + + // TODO: release all TSO messages + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void timeAdvanceRequest(LogicalTime time) + throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, + RequestForTimeRegulationPending, RequestForTimeConstrainedPending, + RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfInvalidLogicalTime(time); + checkIfLogicalTimeAlreadyPassed(time); + checkIfInTimeAdvancingState(); + checkIfRequestForTimeRegulationPending(); + checkIfRequestForTimeConstrainedPending(); + + advanceRequestTime = time; + advanceRequestTimeType = TimeAdvanceType.TIME_ADVANCE_REQUEST; + + if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && + timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) + { + // immediately grant the request + // + federate.getCallbackManager().add(new TimeAdvanceGrant(time)); + } + else + { + WriteFuture writeFuture = + federate.getRTISession().write(new TimeAdvanceRequest(time)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + // TODO: will need to send to peers as well + } + + temporalState = TemporalState.TIME_ADVANCING; + + // release any callbacks held until we are time advancing + // + federate.getCallbackManager().releaseHeld(); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void timeAdvanceRequestAvailable(LogicalTime time) + throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, + RequestForTimeRegulationPending, RequestForTimeConstrainedPending, + RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfInvalidLogicalTime(time); + checkIfLogicalTimeAlreadyPassed(time); + checkIfInTimeAdvancingState(); + checkIfRequestForTimeRegulationPending(); + checkIfRequestForTimeConstrainedPending(); + + advanceRequestTime = time; + advanceRequestTimeType = TimeAdvanceType.TIME_ADVANCE_REQUEST_AVAILABLE; + + if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && + timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) + { + // immediately grant the request + // + federate.getCallbackManager().add(new TimeAdvanceGrant(time)); + } + else + { + WriteFuture writeFuture = + federate.getRTISession().write(new TimeAdvanceRequestAvailable(time)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + temporalState = TemporalState.TIME_ADVANCING; + + // release any callbacks held until we are time advancing + // + federate.getCallbackManager().releaseHeld(); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void nextMessageRequest(LogicalTime time) + throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, + RequestForTimeRegulationPending, RequestForTimeConstrainedPending, + RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfInvalidLogicalTime(time); + checkIfLogicalTimeAlreadyPassed(time); + checkIfInTimeAdvancingState(); + checkIfRequestForTimeRegulationPending(); + checkIfRequestForTimeConstrainedPending(); + + advanceRequestTime = time; + advanceRequestTimeType = TimeAdvanceType.NEXT_MESSAGE_REQUEST; + + if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && + timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) + { + // immediately grant the request + // + federate.getCallbackManager().add(new TimeAdvanceGrant(time)); + } + else + { + WriteFuture writeFuture = + federate.getRTISession().write(new TimeAdvanceRequest(time)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + temporalState = TemporalState.TIME_ADVANCING; + + // release any callbacks held until we are time advancing + // + federate.getCallbackManager().releaseHeld(); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void nextMessageRequestAvailable(LogicalTime time) + throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, + RequestForTimeRegulationPending, RequestForTimeConstrainedPending, + RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfInvalidLogicalTime(time); + checkIfLogicalTimeAlreadyPassed(time); + checkIfInTimeAdvancingState(); + checkIfRequestForTimeConstrainedPending(); + checkIfRequestForTimeRegulationPending(); + + advanceRequestTime = time; + advanceRequestTimeType = TimeAdvanceType.NEXT_MESSAGE_REQUEST_AVAILABLE; + + if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && + timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) + { + // immediately grant the request + // + federate.getCallbackManager().add(new TimeAdvanceGrant(time)); + } + else + { + WriteFuture writeFuture = + federate.getRTISession().write(new TimeAdvanceRequest(time)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + temporalState = TemporalState.TIME_ADVANCING; + + // release any callbacks held until we are time advancing + // + federate.getCallbackManager().releaseHeld(); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void flushQueueRequest(LogicalTime time) + throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, + RequestForTimeRegulationPending, RequestForTimeConstrainedPending, + RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfInvalidLogicalTime(time); + checkIfLogicalTimeAlreadyPassed(time); + checkIfInTimeAdvancingState(); + checkIfRequestForTimeRegulationPending(); + checkIfRequestForTimeConstrainedPending(); + + advanceRequestTime = time; + advanceRequestTimeType = TimeAdvanceType.FLUSH_QUEUE_REQUEST; + + if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && + timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) + { + // immediately grant the request + // + federate.getCallbackManager().add(new TimeAdvanceGrant(time)); + } + else + { + WriteFuture writeFuture = + federate.getRTISession().write(new TimeAdvanceRequest(time)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + } + + temporalState = TemporalState.TIME_ADVANCING; + + // release any callbacks held until we are time advancing + // + federate.getCallbackManager().releaseHeld(); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public TimeQueryReturn queryGALT() + throws RTIinternalError + { + TimeQueryReturn timeQueryReturn = new TimeQueryReturn(); + + timeLock.readLock().lock(); + try + { + timeQueryReturn.timeIsValid = galt != null; + timeQueryReturn.time = galt; + } + finally + { + timeLock.readLock().unlock(); + } + + return timeQueryReturn; + } + + public LogicalTime queryLogicalTime() + throws RTIinternalError + { + timeLock.readLock().lock(); + try + { + return federateTime; + } + finally + { + timeLock.readLock().unlock(); + } + } + + public TimeQueryReturn queryLITS() + throws RTIinternalError + { + TimeQueryReturn timeQueryReturn = new TimeQueryReturn(); + + timeLock.readLock().lock(); + try + { + timeQueryReturn.timeIsValid = lits != null; + timeQueryReturn.time = lits; + } + finally + { + timeLock.readLock().unlock(); + } + + return timeQueryReturn; + } + + public void modifyLookahead(LogicalTimeInterval lookahead) + throws TimeRegulationIsNotEnabled, InvalidLookahead, InTimeAdvancingState, + RTIinternalError + { + timeLock.writeLock().lock(); + try + { + checkIfTimeRegulationIsNotEnabled(); + checkIfInvalidLookahead(lookahead); + checkIfInTimeAdvancingState(); + + WriteFuture writeFuture = + federate.getRTISession().write(new ModifyLookahead(lookahead)); + + // TODO: set timeout + // + writeFuture.join(); + + if (!writeFuture.isWritten()) + { + throw new RTIinternalError("error communicating with RTI"); + } + + this.lookahead = lookahead; + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public LogicalTimeInterval queryLookahead() + throws TimeRegulationIsNotEnabled, RTIinternalError + { + timeLock.readLock().lock(); + try + { + checkIfTimeRegulationIsNotEnabled(); + + return lookahead; + } + finally + { + timeLock.readLock().unlock(); + } + } + + public void timeRegulationEnabled(LogicalTime time, + FederateAmbassador federateAmbassador) + { + timeLock.writeLock().lock(); + try + { + federateTime = time; + + timeRegulatingState = TimeRegulatingState.TIME_REGULATING; + + federateAmbassador.timeRegulationEnabled(time); + } + catch (Throwable t) + { + log.warn(String.format( + "federate unable enable time regulation to: %s", time), t); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void timeConstrainedEnabled(LogicalTime time, + FederateAmbassador federateAmbassador) + { + timeLock.writeLock().lock(); + try + { + federateTime = time; + + timeConstrainedState = TimeConstrainedState.TIME_CONSTRAINED; + + federateAmbassador.timeConstrainedEnabled(time); + } + catch (Throwable t) + { + log.warn(String.format( + "federate unable enable time constrained to: %s", time), t); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void timeAdvanceGrant(LogicalTime time, + FederateAmbassador federateAmbassador) + { + timeLock.writeLock().lock(); + try + { + federateTime = time; + + temporalState = TemporalState.TIME_GRANTED; + + federateAmbassador.timeAdvanceGrant(time); + } + catch (Throwable t) + { + log.warn(String.format("federate unable to advance to: %s", time), t); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void galtAdvanced(LogicalTime galt) + { + timeLock.writeLock().lock(); + try + { + this.galt = galt; + + log.debug("GALT advanced: {}", galt); + + LogicalTime maxFutureTaskTimestamp = isTimeAdvancing() ? + (galt.compareTo(advanceRequestTime) <= 0 ? galt : advanceRequestTime) : + (galt.compareTo(federateTime) <= 0 ? galt : federateTime); + federate.processFutureTasks(maxFutureTaskTimestamp); + } + finally + { + timeLock.writeLock().unlock(); + } + } + + public void checkIfInTimeAdvancingState() + throws InTimeAdvancingState + { + if (isTimeAdvancing()) + { + throw new InTimeAdvancingState(); + } + } + + public void checkIfTimeRegulationIsNotEnabled() + throws TimeRegulationIsNotEnabled + { + if (!isTimeRegulating()) + { + throw new TimeRegulationIsNotEnabled(); + } + } + + public void checkIfRequestForTimeRegulationPending() + throws RequestForTimeRegulationPending + { + if (timeRegulatingState == TimeRegulatingState.BECOMING_TIME_REGULATING) + { + throw new RequestForTimeRegulationPending(); + } + } + + public void checkIfTimeConstrainedIsNotEnabled() + throws TimeConstrainedIsNotEnabled + { + if (!isTimeConstrained()) + { + throw new TimeConstrainedIsNotEnabled(); + } + } + + public void checkIfRequestForTimeConstrainedPending() + throws RequestForTimeConstrainedPending + { + if (timeConstrainedState == TimeConstrainedState.BECOMING_TIME_CONSTRAINED) + { + throw new RequestForTimeConstrainedPending(); + } + } + + public void checkIfLogicalTimeAlreadyPassed(LogicalTime time) + throws LogicalTimeAlreadyPassed + { + if (time.compareTo(federateTime) < 0) + { + throw new LogicalTimeAlreadyPassed( + String.format("%s < %s", time, federateTime)); + } + } + + public void checkIfInvalidLogicalTime(LogicalTime time) + throws InvalidLogicalTime + { + if (time == null) + { + throw new InvalidLogicalTime("null"); + } + + // TODO: check against factory type? + } + + public void checkIfInvalidLookahead(LogicalTimeInterval lookahead) + throws InvalidLookahead + { + if (lookahead == null) + { + throw new InvalidLookahead("null"); + } + + // TODO: check against factory type? + } + + public void updateAttributeValues(LogicalTime updateTime) + throws InvalidLogicalTime + { + checkIfInvalidTimestamp(updateTime); + } + + public void sendInteraction(LogicalTime sendTime) + throws InvalidLogicalTime + { + checkIfInvalidTimestamp(sendTime); + } + + public void deleteObjectInstance(LogicalTime deleteTime) + throws InvalidLogicalTime + { + checkIfInvalidTimestamp(deleteTime); + } + + public void checkIfInvalidTimestamp(LogicalTime time) + throws InvalidLogicalTime + { + checkIfInvalidLogicalTime(time); + + LogicalTime minimumTime = + isTimeAdvancing() ? advanceRequestTime : federateTime; + switch (advanceRequestTimeType) + { + case TIME_ADVANCE_REQUEST: + case NEXT_MESSAGE_REQUEST: + { + if (lookahead.isZero()) + { + // handle special case when lookahead is 0 + + if (time.compareTo(minimumTime) <= 0) + { + throw new InvalidLogicalTime( + String.format("%s <= %s", time, minimumTime)); + } + + break; + } + } + case TIME_ADVANCE_REQUEST_AVAILABLE: + case NEXT_MESSAGE_REQUEST_AVAILABLE: + case FLUSH_QUEUE_REQUEST: + { + try + { + LogicalTime minimumTimePlusLookahead = minimumTime.add(lookahead); + + if (time.compareTo(minimumTimePlusLookahead) < 0) + { + throw new InvalidLogicalTime(String.format( + "%s < %s (%s + %s)", time, minimumTimePlusLookahead, + minimumTime, lookahead)); + } + } + catch (IllegalTimeArithmetic ita) + { + throw new InvalidLogicalTime(ita); + } + + break; + } + default: + { + assert false : + String.format("unknown TimeAdvanceType: %s", advanceRequestTimeType); + } + } + } +} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TemporalState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TemporalState.java 2007-02-13 02:33:41 UTC (rev 110) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TemporalState.java 2007-02-13 02:38:14 UTC (rev 111) @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.federate.time; - -public enum TemporalState -{ - TIME_ADVANCING, TIME_GRANTED -} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeAdvanceType.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeAdvanceType.java 2007-02-13 02:33:41 UTC (rev 110) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeAdvanceType.java 2007-02-13 02:38:14 UTC (rev 111) @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.federate.time; - -public enum TimeAdvanceType -{ - TIME_ADVANCE_REQUEST, TIME_ADVANCE_REQUEST_AVAILABLE, - NEXT_MESSAGE_REQUEST, NEXT_MESSAGE_REQUEST_AVAILABLE, - FLUSH_QUEUE_REQUEST -} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeConstrainedState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeConstrainedState.java 2007-02-13 02:33:41 UTC (rev 110) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeConstrainedState.java 2007-02-13 02:38:14 UTC (rev 111) @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.federate.time; - -public enum TimeConstrainedState -{ - TIME_CONSTRAINED, BECOMING_TIME_CONSTRAINED, NOT_TIME_CONSTRAINED -} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java 2007-02-13 02:33:41 UTC (rev 110) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java 2007-02-13 02:38:14 UTC (rev 111) @@ -1,867 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.federate.time; - -import java.util.concurrent.locks.ReadWriteLock; -import java.util.concurrent.locks.ReentrantReadWriteLock; - -import net.sf.ohla.rti1516.federate.Federate; -import net.sf.ohla.rti1516.messages.callbacks.TimeAdvanceGrant; -import net.sf.ohla.rti1516.messages.DisableTimeConstrained; -import net.sf.ohla.rti1516.messages.DisableTimeRegulation; -import net.sf.ohla.rti1516.messages.EnableTimeConstrained; -import net.sf.ohla.rti1516.messages.EnableTimeRegulation; -import net.sf.ohla.rti1516.messages.ModifyLookahead; -import net.sf.ohla.rti1516.messages.TimeAdvanceRequest; -import net.sf.ohla.rti1516.messages.TimeAdvanceRequestAvailable; - -import org.apache.mina.common.WriteFuture; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import hla.rti1516.FederateAmbassador; -import hla.rti1516.IllegalTimeArithmetic; -import hla.rti1516.InTimeAdvancingState; -import hla.rti1516.InvalidLogicalTime; -import hla.rti1516.InvalidLookahead; -import hla.rti1516.LogicalTime; -import hla.rti1516.LogicalTimeAlreadyPassed; -import hla.rti1516.LogicalTimeInterval; -import hla.rti1516.MobileFederateServices; -import hla.rti1516.RTIinternalError; -import hla.rti1516.RequestForTimeConstrainedPending; -import hla.rti1516.RequestForTimeRegulationPending; -import hla.rti1516.TimeConstrainedAlreadyEnabled; -import hla.rti1516.TimeConstrainedIsNotEnabled; -import hla.rti1516.TimeQueryReturn; -import hla.rti1516.TimeRegulationAlreadyEnabled; -import hla.rti1516.TimeRegulationIsNotEnabled; - -public class TimeManager -{ - private static final Logger log = LoggerFactory.getLogger(TimeManager.class); - - protected enum TemporalState - { - TIME_ADVANCING, TIME_GRANTED - } - - protected enum TimeAdvanceType - { - TIME_ADVANCE_REQUEST, TIME_ADVANCE_REQUEST_AVAILABLE, - NEXT_MESSAGE_REQUEST, NEXT_MESSAGE_REQUEST_AVAILABLE, - FLUSH_QUEUE_REQUEST - } - - protected enum TimeRegulatingState - { - TIME_REGULATING, BECOMING_TIME_REGULATING, NOT_TIME_REGULATING - } - - protected enum TimeConstrainedState - { - TIME_CONSTRAINED, BECOMING_TIME_CONSTRAINED, NOT_TIME_CONSTRAINED - } - - protected final Federate federate; - protected final MobileFederateServices mobileFederateServices; - - protected ReadWriteLock timeLock = new ReentrantReadWriteLock(true); - - protected TemporalState temporalState = TemporalState.TIME_GRANTED; - protected TimeRegulatingState timeRegulatingState = - TimeRegulatingState.NOT_TIME_REGULATING; - protected TimeConstrainedState timeConstrainedState = - TimeConstrainedState.NOT_TIME_CONSTRAINED; - - protected LogicalTime federateTime; - protected LogicalTime galt; - protected LogicalTime lits; - - protected LogicalTimeInterval lookahead; - - protected LogicalTime advanceRequestTime; - protected TimeAdvanceType advanceRequestTimeType; - - public TimeManager(Federate federate, - MobileFederateServices mobileFederateServices, - LogicalTime galt) - { - this.federate = federate; - this.mobileFederateServices = mobileFederateServices; - this.galt = galt; - - federateTime = mobileFederateServices.timeFactory.makeInitial(); - } - - public ReadWriteLock getTimeLock() - { - return timeLock; - } - - public boolean isTimeRegulating() - { - return timeRegulatingState == TimeRegulatingState.TIME_REGULATING; - } - - public boolean isTimeConstrained() - { - return timeConstrainedState == TimeConstrainedState.TIME_CONSTRAINED; - } - - public boolean isTimeAdvancing() - { - return temporalState == TemporalState.TIME_ADVANCING; - } - - public boolean isTimeGranted() - { - return temporalState == TemporalState.TIME_GRANTED; - } - - public boolean isTimeConstrainedAndTimeGranted() - { - return isTimeConstrained() && isTimeGranted(); - } - - public void enableTimeRegulation(LogicalTimeInterval lookahead) - throws TimeRegulationAlreadyEnabled, InvalidLookahead, InTimeAdvancingState, - RequestForTimeRegulationPending, RTIinternalError - { - timeLock.writeLock().lock(); - try - { - if (timeRegulatingState == TimeRegulatingState.TIME_REGULATING) - { - throw new TimeRegulationAlreadyEnabled(); - } - - checkIfInvalidLookahead(lookahead); - checkIfInTimeAdvancingState(); - checkIfRequestForTimeRegulationPending(); - - WriteFuture writeFuture = - federate.getRTISession().write(new EnableTimeRegulation(lookahead)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - this.lookahead = lookahead; - - timeRegulatingState = TimeRegulatingState.BECOMING_TIME_REGULATING; - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void disableTimeRegulation() - throws TimeRegulationIsNotEnabled, RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfTimeRegulationIsNotEnabled(); - - WriteFuture writeFuture = - federate.getRTISession().write(new DisableTimeRegulation()); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - timeRegulatingState = TimeRegulatingState.NOT_TIME_REGULATING; - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void enableTimeConstrained() - throws TimeConstrainedAlreadyEnabled, InTimeAdvancingState, - RequestForTimeConstrainedPending, RTIinternalError - { - timeLock.writeLock().lock(); - try - { - if (timeConstrainedState == TimeConstrainedState.TIME_CONSTRAINED) - { - throw new TimeConstrainedAlreadyEnabled(); - } - - checkIfInTimeAdvancingState(); - - checkIfRequestForTimeConstrainedPending(); - - WriteFuture writeFuture = - federate.getRTISession().write(new EnableTimeConstrained()); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - timeConstrainedState = TimeConstrainedState.BECOMING_TIME_CONSTRAINED; - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void disableTimeConstrained() - throws TimeConstrainedIsNotEnabled, RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfTimeConstrainedIsNotEnabled(); - - WriteFuture writeFuture = - federate.getRTISession().write(new DisableTimeConstrained()); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - timeConstrainedState = TimeConstrainedState.NOT_TIME_CONSTRAINED; - - // TODO: release all TSO messages - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void timeAdvanceRequest(LogicalTime time) - throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, - RequestForTimeRegulationPending, RequestForTimeConstrainedPending, - RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfInvalidLogicalTime(time); - checkIfLogicalTimeAlreadyPassed(time); - checkIfInTimeAdvancingState(); - checkIfRequestForTimeRegulationPending(); - checkIfRequestForTimeConstrainedPending(); - - advanceRequestTime = time; - advanceRequestTimeType = TimeAdvanceType.TIME_ADVANCE_REQUEST; - - if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && - timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) - { - // immediately grant the request - // - federate.getCallbackManager().add(new TimeAdvanceGrant(time)); - } - else - { - WriteFuture writeFuture = - federate.getRTISession().write(new TimeAdvanceRequest(time)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - // TODO: will need to send to peers as well - } - - temporalState = TemporalState.TIME_ADVANCING; - - // release any callbacks held until we are time advancing - // - federate.getCallbackManager().releaseHeld(); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void timeAdvanceRequestAvailable(LogicalTime time) - throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, - RequestForTimeRegulationPending, RequestForTimeConstrainedPending, - RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfInvalidLogicalTime(time); - checkIfLogicalTimeAlreadyPassed(time); - checkIfInTimeAdvancingState(); - checkIfRequestForTimeRegulationPending(); - checkIfRequestForTimeConstrainedPending(); - - advanceRequestTime = time; - advanceRequestTimeType = TimeAdvanceType.TIME_ADVANCE_REQUEST_AVAILABLE; - - if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && - timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) - { - // immediately grant the request - // - federate.getCallbackManager().add(new TimeAdvanceGrant(time)); - } - else - { - WriteFuture writeFuture = - federate.getRTISession().write(new TimeAdvanceRequestAvailable(time)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - temporalState = TemporalState.TIME_ADVANCING; - - // release any callbacks held until we are time advancing - // - federate.getCallbackManager().releaseHeld(); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void nextMessageRequest(LogicalTime time) - throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, - RequestForTimeRegulationPending, RequestForTimeConstrainedPending, - RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfInvalidLogicalTime(time); - checkIfLogicalTimeAlreadyPassed(time); - checkIfInTimeAdvancingState(); - checkIfRequestForTimeRegulationPending(); - checkIfRequestForTimeConstrainedPending(); - - advanceRequestTime = time; - advanceRequestTimeType = TimeAdvanceType.NEXT_MESSAGE_REQUEST; - - if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && - timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) - { - // immediately grant the request - // - federate.getCallbackManager().add(new TimeAdvanceGrant(time)); - } - else - { - WriteFuture writeFuture = - federate.getRTISession().write(new TimeAdvanceRequest(time)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - temporalState = TemporalState.TIME_ADVANCING; - - // release any callbacks held until we are time advancing - // - federate.getCallbackManager().releaseHeld(); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void nextMessageRequestAvailable(LogicalTime time) - throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, - RequestForTimeRegulationPending, RequestForTimeConstrainedPending, - RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfInvalidLogicalTime(time); - checkIfLogicalTimeAlreadyPassed(time); - checkIfInTimeAdvancingState(); - checkIfRequestForTimeConstrainedPending(); - checkIfRequestForTimeRegulationPending(); - - advanceRequestTime = time; - advanceRequestTimeType = TimeAdvanceType.NEXT_MESSAGE_REQUEST_AVAILABLE; - - if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && - timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) - { - // immediately grant the request - // - federate.getCallbackManager().add(new TimeAdvanceGrant(time)); - } - else - { - WriteFuture writeFuture = - federate.getRTISession().write(new TimeAdvanceRequest(time)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - temporalState = TemporalState.TIME_ADVANCING; - - // release any callbacks held until we are time advancing - // - federate.getCallbackManager().releaseHeld(); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void flushQueueRequest(LogicalTime time) - throws InvalidLogicalTime, LogicalTimeAlreadyPassed, InTimeAdvancingState, - RequestForTimeRegulationPending, RequestForTimeConstrainedPending, - RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfInvalidLogicalTime(time); - checkIfLogicalTimeAlreadyPassed(time); - checkIfInTimeAdvancingState(); - checkIfRequestForTimeRegulationPending(); - checkIfRequestForTimeConstrainedPending(); - - advanceRequestTime = time; - advanceRequestTimeType = TimeAdvanceType.FLUSH_QUEUE_REQUEST; - - if (timeRegulatingState == TimeRegulatingState.NOT_TIME_REGULATING && - timeConstrainedState == TimeConstrainedState.NOT_TIME_CONSTRAINED) - { - // immediately grant the request - // - federate.getCallbackManager().add(new TimeAdvanceGrant(time)); - } - else - { - WriteFuture writeFuture = - federate.getRTISession().write(new TimeAdvanceRequest(time)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - } - - temporalState = TemporalState.TIME_ADVANCING; - - // release any callbacks held until we are time advancing - // - federate.getCallbackManager().releaseHeld(); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public TimeQueryReturn queryGALT() - throws RTIinternalError - { - TimeQueryReturn timeQueryReturn = new TimeQueryReturn(); - - timeLock.readLock().lock(); - try - { - timeQueryReturn.timeIsValid = galt != null; - timeQueryReturn.time = galt; - } - finally - { - timeLock.readLock().unlock(); - } - - return timeQueryReturn; - } - - public LogicalTime queryLogicalTime() - throws RTIinternalError - { - timeLock.readLock().lock(); - try - { - return federateTime; - } - finally - { - timeLock.readLock().unlock(); - } - } - - public TimeQueryReturn queryLITS() - throws RTIinternalError - { - TimeQueryReturn timeQueryReturn = new TimeQueryReturn(); - - timeLock.readLock().lock(); - try - { - timeQueryReturn.timeIsValid = lits != null; - timeQueryReturn.time = lits; - } - finally - { - timeLock.readLock().unlock(); - } - - return timeQueryReturn; - } - - public void modifyLookahead(LogicalTimeInterval lookahead) - throws TimeRegulationIsNotEnabled, InvalidLookahead, InTimeAdvancingState, - RTIinternalError - { - timeLock.writeLock().lock(); - try - { - checkIfTimeRegulationIsNotEnabled(); - checkIfInvalidLookahead(lookahead); - checkIfInTimeAdvancingState(); - - WriteFuture writeFuture = - federate.getRTISession().write(new ModifyLookahead(lookahead)); - - // TODO: set timeout - // - writeFuture.join(); - - if (!writeFuture.isWritten()) - { - throw new RTIinternalError("error communicating with RTI"); - } - - this.lookahead = lookahead; - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public LogicalTimeInterval queryLookahead() - throws TimeRegulationIsNotEnabled, RTIinternalError - { - timeLock.readLock().lock(); - try - { - checkIfTimeRegulationIsNotEnabled(); - - return lookahead; - } - finally - { - timeLock.readLock().unlock(); - } - } - - public void timeRegulationEnabled(LogicalTime time, - FederateAmbassador federateAmbassador) - { - timeLock.writeLock().lock(); - try - { - federateTime = time; - - timeRegulatingState = TimeRegulatingState.TIME_REGULATING; - - federateAmbassador.timeRegulationEnabled(time); - } - catch (Throwable t) - { - log.warn(String.format( - "federate unable enable time regulation to: %s", time), t); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void timeConstrainedEnabled(LogicalTime time, - FederateAmbassador federateAmbassador) - { - timeLock.writeLock().lock(); - try - { - federateTime = time; - - timeConstrainedState = TimeConstrainedState.TIME_CONSTRAINED; - - federateAmbassador.timeConstrainedEnabled(time); - } - catch (Throwable t) - { - log.warn(String.format( - "federate unable enable time constrained to: %s", time), t); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void timeAdvanceGrant(LogicalTime time, - FederateAmbassador federateAmbassador) - { - timeLock.writeLock().lock(); - try - { - federateTime = time; - - temporalState = TemporalState.TIME_GRANTED; - - federateAmbassador.timeAdvanceGrant(time); - } - catch (Throwable t) - { - log.warn(String.format("federate unable to advance to: %s", time), t); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void galtAdvanced(LogicalTime galt) - { - timeLock.writeLock().lock(); - try - { - this.galt = galt; - - log.debug("GALT advanced: {}", galt); - - LogicalTime maxFutureTaskTimestamp = isTimeAdvancing() ? - (galt.compareTo(advanceRequestTime) <= 0 ? galt : advanceRequestTime) : - (galt.compareTo(federateTime) <= 0 ? galt : federateTime); - federate.processFutureTasks(maxFutureTaskTimestamp); - } - finally - { - timeLock.writeLock().unlock(); - } - } - - public void checkIfInTimeAdvancingState() - throws InTimeAdvancingState - { - if (isTimeAdvancing()) - { - throw new InTimeAdvancingState(); - } - } - - public void checkIfTimeRegulationIsNotEnabled() - throws TimeRegulationIsNotEnabled - { - if (!isTimeRegulating()) - { - throw new TimeRegulationIsNotEnabled(); - } - } - - public void checkIfRequestForTimeRegulationPending() - throws RequestForTimeRegulationPending - { - if (timeRegulatingState == TimeRegulatingState.BECOMING_TIME_REGULATING) - { - throw new RequestForTimeRegulationPending(); - } - } - - public void checkIfTimeConstrainedIsNotEnabled() - throws TimeConstrainedIsNotEnabled - { - if (!isTimeConstrained()) - { - throw new TimeConstrainedIsNotEnabled(); - } - } - - public void checkIfRequestForTimeConstrainedPending() - throws RequestForTimeConstrainedPending - { - if (timeConstrainedState == TimeConstrainedState.BECOMING_TIME_CONSTRAINED) - { - throw new RequestForTimeConstrainedPending(); - } - } - - public void checkIfLogicalTimeAlreadyPassed(LogicalTime time) - throws LogicalTimeAlreadyPassed - { - if (time.compareTo(federateTime) < 0) - { - throw new LogicalTimeAlreadyPassed( - String.format("%s < %s", time, federateTime)); - } - } - - public void checkIfInvalidLogicalTime(LogicalTime time) - throws InvalidLogicalTime - { - if (time == null) - { - throw new InvalidLogicalTime("null"); - } - - // TODO: check against factory type? - } - - public void checkIfInvalidLookahead(LogicalTimeInterval lookahead) - throws InvalidLookahead - { - if (lookahead == null) - { - throw new InvalidLookahead("null"); - } - - // TODO: check against factory type? - } - - public void updateAttributeValues(LogicalTime updateTime) - throws InvalidLogicalTime - { - checkIfInvalidTimestamp(updateTime); - } - - public void sendInteraction(LogicalTime sendTime) - throws InvalidLogicalTime - { - checkIfInvalidTimestamp(sendTime); - } - - public void deleteObjectInstance(LogicalTime deleteTime) - throws InvalidLogicalTime - { - checkIfInvalidTimestamp(deleteTime); - } - - public void checkIfInvalidTimestamp(LogicalTime time) - throws InvalidLogicalTime - { - checkIfInvalidLogicalTime(time); - - LogicalTime minimumTime = - isTimeAdvancing() ? advanceRequestTime : federateTime; - switch (advanceRequestTimeType) - { - case TIME_ADVANCE_REQUEST: - case NEXT_MESSAGE_REQUEST: - { - if (lookahead.isZero()) - { - // handle special case when lookahead is 0 - - if (time.compareTo(minimumTime) <= 0) - { - throw new InvalidLogicalTime( - String.format("%s <= %s", time, minimumTime)); - } - - break; - } - } - case TIME_ADVANCE_REQUEST_AVAILABLE: - case NEXT_MESSAGE_REQUEST_AVAILABLE: - case FLUSH_QUEUE_REQUEST: - { - try - { - LogicalTime minimumTimePlusLookahead = minimumTime.add(lookahead); - - if (time.compareTo(minimumTimePlusLookahead) < 0) - { - throw new InvalidLogicalTime(String.format( - "%s < %s (%s + %s)", time, minimumTimePlusLookahead, - minimumTime, lookahead)); - } - } - catch (IllegalTimeArithmetic ita) - { - throw new InvalidLogicalTime(ita); - } - - break; - } - default: - { - assert false : - String.format("unknown TimeAdvanceType: %s", advanceRequestTimeType); - } - } - } -} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeRegulatingState.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeRegulatingState.java 2007-02-13 02:33:41 UTC (rev 110) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeRegulatingState.java 2007-02-13 02:38:14 UTC (rev 111) @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2006, Michael Newcomb - * - * Licensed 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 net.sf.ohla.rti1516.federate.time; - -public enum TimeRegulatingState -{ - TIME_REGULATING, BECOMING_TIME_REGULATING, NOT_TIME_REGULATING -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 02:33:40
|
Revision: 110 http://svn.sourceforge.net/ohla/?rev=110&view=rev Author: mnewcomb Date: 2007-02-12 18:33:41 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federation/time/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 02:29:13
|
Revision: 109 http://svn.sourceforge.net/ohla/?rev=109&view=rev Author: mnewcomb Date: 2007-02-12 18:29:11 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java Added Paths: ----------- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionTimeManager.java Removed Paths: ------------- trunk/rti/src/java/net/sf/ohla/rti1516/federation/time/TimeKeeper.java Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java 2007-02-13 02:08:08 UTC (rev 108) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecution.java 2007-02-13 02:29:11 UTC (rev 109) @@ -6,8 +6,6 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; @@ -21,7 +19,6 @@ import net.sf.ohla.rti1516.fdd.FDD; import net.sf.ohla.rti1516.fdd.ObjectClass; import net.sf.ohla.rti1516.federation.objects.ObjectManager; -import net.sf.ohla.rti1516.federation.time.TimeKeeper; import net.sf.ohla.rti1516.messages.AttributeOwnershipAcquisition; import net.sf.ohla.rti1516.messages.AttributeOwnershipAcquisitionIfAvailable; import net.sf.ohla.rti1516.messages.AttributeOwnershipDivestitureIfWanted; @@ -134,7 +131,7 @@ protected ObjectManager objectManager = new ObjectManager(this); - protected TimeKeeper timeKeeper; + protected FederationExecutionTimeManager federationExecutionTimeManager; protected AtomicInteger objectInstanceCount = new AtomicInteger(Integer.MIN_VALUE); @@ -208,7 +205,7 @@ federatesLock.lock(); try { - if (timeKeeper != null) + if (federationExecutionTimeManager != null) { // TODO: ensure each federate has the same mobile federate services } @@ -216,7 +213,7 @@ { // use the first federate's mobile services // - timeKeeper = new TimeKeeper( + federationExecutionTimeManager = new FederationExecutionTimeManager( this, joinFederationExecution.getMobileFederateServices()); } @@ -229,7 +226,7 @@ WriteFuture writeFuture = session.write(new DefaultResponse( joinFederationExecution.getId(), new JoinFederationExecutionResponse( - federateHandle, fdd, timeKeeper.getGALT()))); + federateHandle, fdd, federationExecutionTimeManager.getGALT()))); log.debug(marker, "federate joined: {}", federate); @@ -1298,7 +1295,7 @@ federationExecutionStateLock.readLock().lock(); try { - timeKeeper.enableTimeRegulation( + federationExecutionTimeManager.enableTimeRegulation( federate, enableTimeRegulation.getLookahead()); } finally @@ -1313,7 +1310,7 @@ federationExecutionStateLock.readLock().lock(); try { - timeKeeper.disableTimeRegulation(federate); + federationExecutionTimeManager.disableTimeRegulation(federate); } finally { @@ -1327,7 +1324,7 @@ federationExecutionStateLock.readLock().lock(); try { - timeKeeper.enableTimeConstrained(federate); + federationExecutionTimeManager.enableTimeConstrained(federate); } finally { @@ -1341,7 +1338,7 @@ federationExecutionStateLock.readLock().lock(); try { - timeKeeper.disableTimeConstrained(federate); + federationExecutionTimeManager.disableTimeConstrained(federate); } finally { @@ -1355,7 +1352,7 @@ federationExecutionStateLock.readLock().lock(); try { - timeKeeper.timeAdvanceRequest(federate, timeAdvanceRequest.getTime()); + federationExecutionTimeManager.timeAdvanceRequest(federate, timeAdvanceRequest.getTime()); } finally { @@ -1369,7 +1366,7 @@ federationExecutionStateLock.readLock().lock(); try { - timeKeeper.timeAdvanceRequestAvailable( + federationExecutionTimeManager.timeAdvanceRequestAvailable( federate, timeAdvanceRequestAvailable.getTime()); } finally Copied: trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionTimeManager.java (from rev 104, trunk/rti/src/java/net/sf/ohla/rti1516/federation/time/TimeKeeper.java) =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionTimeManager.java (rev 0) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/FederationExecutionTimeManager.java 2007-02-13 02:29:11 UTC (rev 109) @@ -0,0 +1,172 @@ +package net.sf.ohla.rti1516.federation; + +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import hla.rti1516.IllegalTimeArithmetic; +import hla.rti1516.LogicalTime; +import hla.rti1516.LogicalTimeInterval; +import hla.rti1516.MobileFederateServices; + +public class FederationExecutionTimeManager +{ + private static final Logger log = LoggerFactory.getLogger( + FederationExecutionTimeManager.class); + + protected FederationExecution federationExecution; + + protected MobileFederateServices mobileFederateServices; + + protected LogicalTime galt; + + protected Lock timeLock = new ReentrantLock(true); + + protected Set<Federate> timeRegulatingFederates = new HashSet<Federate>(); + protected Set<Federate> timeConstrainedFederates = new HashSet<Federate>(); + + public FederationExecutionTimeManager(FederationExecution federationExecution, + MobileFederateServices mobileFederateServices) + { + this.federationExecution = federationExecution; + this.mobileFederateServices = mobileFederateServices; + + galt = mobileFederateServices.timeFactory.makeInitial(); + } + + public LogicalTime getGALT() + { + return galt; + } + + public void enableTimeRegulation(Federate federate, + LogicalTimeInterval lookahead) + { + timeLock.lock(); + try + { + timeRegulatingFederates.add(federate); + + federate.enableTimeRegulation(galt, lookahead); + } + catch (IllegalTimeArithmetic ita) + { + log.error("unable to enable time regulation", ita); + } + finally + { + timeLock.unlock(); + } + } + + public void disableTimeRegulation(Federate federate) + { + timeLock.lock(); + try + { + timeRegulatingFederates.remove(federate); + + federate.disableTimeRegulation(); + } + finally + { + timeLock.unlock(); + } + } + + public void enableTimeConstrained(Federate federate) + { + timeLock.lock(); + try + { + timeConstrainedFederates.add(federate); + + federate.enableTimeConstrained(galt); + } + finally + { + timeLock.unlock(); + } + } + + public void disableTimeConstrained(Federate federate) + { + timeLock.lock(); + try + { + timeConstrainedFederates.remove(federate); + + federate.disableTimeConstrained(); + } + finally + { + timeLock.unlock(); + } + } + + public void timeAdvanceRequest(Federate federate, LogicalTime time) + { + timeLock.lock(); + try + { + assert galt.compareTo(time) >= 0; + + federate.timeAdvanceRequest(time); + + boolean galtAdvanced = false; + + if (timeRegulatingFederates.contains(federate)) + { + LogicalTime newGALT = mobileFederateServices.timeFactory.makeFinal(); + for (Federate f : timeRegulatingFederates) + { + newGALT = min(newGALT, f.getLITS()); + } + + galtAdvanced = galt.compareTo(newGALT) < 0; + if (galtAdvanced) + { + galt = newGALT; + } + } + + if (galtAdvanced) + { + federationExecution.getFederatesLock().lock(); + try + { + for (Federate f : federationExecution.getFederates().values()) + { + f.galtAdvanced(galt); + } + } + finally + { + federationExecution.getFederatesLock().unlock(); + } + } + } + catch (IllegalTimeArithmetic ita) + { + log.error("unable to request time advance", ita); + } + finally + { + timeLock.unlock(); + } + } + + public void timeAdvanceRequestAvailable(Federate federate, LogicalTime time) + { + timeAdvanceRequest(federate, min(time, galt)); + } + + protected LogicalTime min(LogicalTime lhs, LogicalTime rhs) + { + return lhs.compareTo(rhs) <= 0 ? lhs : rhs; + } +} Deleted: trunk/rti/src/java/net/sf/ohla/rti1516/federation/time/TimeKeeper.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federation/time/TimeKeeper.java 2007-02-13 02:08:08 UTC (rev 108) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federation/time/TimeKeeper.java 2007-02-13 02:29:11 UTC (rev 109) @@ -1,174 +0,0 @@ -package net.sf.ohla.rti1516.federation.time; - -import java.util.HashSet; -import java.util.Set; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; - -import net.sf.ohla.rti1516.federation.Federate; -import net.sf.ohla.rti1516.federation.FederationExecution; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import hla.rti1516.IllegalTimeArithmetic; -import hla.rti1516.LogicalTime; -import hla.rti1516.LogicalTimeInterval; -import hla.rti1516.MobileFederateServices; - -public class TimeKeeper -{ - private static final Logger log = LoggerFactory.getLogger(TimeKeeper.class); - - protected FederationExecution federationExecution; - - protected MobileFederateServices mobileFederateServices; - - protected LogicalTime galt; - - protected Lock timeLock = new ReentrantLock(true); - - protected Set<Federate> timeRegulatingFederates = new HashSet<Federate>(); - protected Set<Federate> timeConstrainedFederates = new HashSet<Federate>(); - - public TimeKeeper(FederationExecution federationExecution, - MobileFederateServices mobileFederateServices) - { - this.federationExecution = federationExecution; - this.mobileFederateServices = mobileFederateServices; - - galt = mobileFederateServices.timeFactory.makeInitial(); - } - - public LogicalTime getGALT() - { - return galt; - } - - public void enableTimeRegulation(Federate federate, - LogicalTimeInterval lookahead) - { - timeLock.lock(); - try - { - timeRegulatingFederates.add(federate); - - federate.enableTimeRegulation(galt, lookahead); - } - catch (IllegalTimeArithmetic ita) - { - log.error("unable to enable time regulation", ita); - } - finally - { - timeLock.unlock(); - } - } - - public void disableTimeRegulation(Federate federate) - { - timeLock.lock(); - try - { - timeRegulatingFederates.remove(federate); - - federate.disableTimeRegulation(); - } - finally - { - timeLock.unlock(); - } - } - - public void enableTimeConstrained(Federate federate) - { - timeLock.lock(); - try - { - timeConstrainedFederates.add(federate); - - federate.enableTimeConstrained(galt); - } - finally - { - timeLock.unlock(); - } - } - - public void disableTimeConstrained(Federate federate) - { - timeLock.lock(); - try - { - timeConstrainedFederates.remove(federate); - - federate.disableTimeConstrained(); - } - finally - { - timeLock.unlock(); - } - } - - public void timeAdvanceRequest(Federate federate, LogicalTime time) - { - timeLock.lock(); - try - { - assert galt.compareTo(time) >= 0; - - federate.timeAdvanceRequest(time); - - boolean galtAdvanced = false; - - if (timeRegulatingFederates.contains(federate)) - { - LogicalTime newGALT = mobileFederateServices.timeFactory.makeFinal(); - for (Federate f : timeRegulatingFederates) - { - newGALT = min(newGALT, f.getLITS()); - } - - galtAdvanced = galt.compareTo(newGALT) < 0; - if (galtAdvanced) - { - galt = newGALT; - } - } - - if (galtAdvanced) - { - federationExecution.getFederatesLock().lock(); - try - { - for (Federate f : federationExecution.getFederates().values()) - { - f.galtAdvanced(galt); - } - } - finally - { - federationExecution.getFederatesLock().unlock(); - } - } - } - catch (IllegalTimeArithmetic ita) - { - log.error("unable to request time advance", ita); - } - finally - { - timeLock.unlock(); - } - } - - public void timeAdvanceRequestAvailable(Federate federate, LogicalTime time) - { - timeAdvanceRequest(federate, min(time, galt)); - } - - protected LogicalTime min(LogicalTime lhs, LogicalTime rhs) - { - return lhs.compareTo(rhs) <= 0 ? lhs : rhs; - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mne...@us...> - 2007-02-13 02:08:08
|
Revision: 108 http://svn.sourceforge.net/ohla/?rev=108&view=rev Author: mnewcomb Date: 2007-02-12 18:08:08 -0800 (Mon, 12 Feb 2007) Log Message: ----------- - refactoring Modified Paths: -------------- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java Modified: trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java =================================================================== --- trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java 2007-02-12 17:22:14 UTC (rev 107) +++ trunk/rti/src/java/net/sf/ohla/rti1516/federate/time/TimeManager.java 2007-02-13 02:08:08 UTC (rev 108) @@ -56,6 +56,28 @@ { private static final Logger log = LoggerFactory.getLogger(TimeManager.class); + protected enum TemporalState + { + TIME_ADVANCING, TIME_GRANTED + } + + protected enum TimeAdvanceType + { + TIME_ADVANCE_REQUEST, TIME_ADVANCE_REQUEST_AVAILABLE, + NEXT_MESSAGE_REQUEST, NEXT_MESSAGE_REQUEST_AVAILABLE, + FLUSH_QUEUE_REQUEST + } + + protected enum TimeRegulatingState + { + TIME_REGULATING, BECOMING_TIME_REGULATING, NOT_TIME_REGULATING + } + + protected enum TimeConstrainedState + { + TIME_CONSTRAINED, BECOMING_TIME_CONSTRAINED, NOT_TIME_CONSTRAINED + } + protected final Federate federate; protected final MobileFederateServices mobileFederateServices; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |