Class LocalFederationManagement
java.lang.Object
org.eclipse.mosaic.rti.federation.LocalFederationManagement
- All Implemented Interfaces:
FederationManagement
- Direct Known Subclasses:
DistributedFederationManagement
This implementation of
FederationManagement allows local
administration only.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<String,FederateAmbassador> Mapping between federation id and federation ambassador instances.protected final Map<String,FederateDescriptor> Mapping between federation id and federation descriptors.protected final ComponentProviderThe simulation components of this federation.protected static final StringConstant representing the local host address.protected final org.slf4j.Loggerprotected final com.google.common.collect.Multimap<String,ProcessLoggingThread> protected WatchDog -
Constructor Summary
ConstructorsConstructorDescriptionLocalFederationManagement(ComponentProvider federation) Constructor with string identifying a federation as parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFederate(FederateDescriptor descriptor) Adds a federate to the federation.voidCreates an empty federation.protected voiddeployFederate(FederateDescriptor descriptor) Deploys a federate represented by its descriptor on the local machine.getAmbassador(String federateId) Returns a reference to the ambassador associated with the given federate id.Returns a collection of all ambassadors associated with joined federates.Returns the id of the simulated federation.booleanisFederateJoined(String federateId) Checks whether a federate is joined or not.voidsetWatchdog(WatchDog watchdog) Sets theWatchDogwhich detects broken federates.protected voidstartFederate(FederateDescriptor handle) Starts a federate represented by its handle on the local machine.protected voidstopFederate(FederateDescriptor handle, boolean forceStop) Stops a federate represented by its handle on the local machine.voidStops the federation.protected voidundeployFederate(FederateDescriptor handle) Undeploys a federate represented by its handle on the local machine.
-
Field Details
-
LOCALHOST
Constant representing the local host address.- See Also:
-
log
protected final org.slf4j.Logger log -
federation
The simulation components of this federation. -
federateDescriptors
Mapping between federation id and federation descriptors. -
federateAmbassadors
Mapping between federation id and federation ambassador instances. -
loggingThreads
-
watchDog
-
-
Constructor Details
-
LocalFederationManagement
Constructor with string identifying a federation as parameter.- Parameters:
federation- federation
-
-
Method Details
-
createFederation
public void createFederation()Description copied from interface:FederationManagementCreates an empty federation. After calling this method it is possible for federates to join the federation.- Specified by:
createFederationin interfaceFederationManagement
-
addFederate
Description copied from interface:FederationManagementAdds a federate to the federation. This method can be called either before or during runtime of the simulation of the federation.- Specified by:
addFederatein interfaceFederationManagement- Parameters:
descriptor- object containing all data that are necessary to manage the lifecycle of a federate- Throws:
Exception
-
isFederateJoined
Description copied from interface:FederationManagementChecks whether a federate is joined or not.- Specified by:
isFederateJoinedin interfaceFederationManagement- Parameters:
federateId- unique string identifying the federate- Returns:
- a boolean, whether a federate is joined or not
-
getAmbassador
Description copied from interface:FederationManagementReturns a reference to the ambassador associated with the given federate id.- Specified by:
getAmbassadorin interfaceFederationManagement- Parameters:
federateId- unique string identifying the federate- Returns:
- ambassador associated with the given federate id
-
getAmbassadors
Description copied from interface:FederationManagementReturns a collection of all ambassadors associated with joined federates.- Specified by:
getAmbassadorsin interfaceFederationManagement- Returns:
- collection of all ambassadors
-
stopFederation
Description copied from interface:FederationManagementStops the federation. All resources of federates are freed. Afterwards, no new federates are allowed to join.- Specified by:
stopFederationin interfaceFederationManagement- Throws:
Exception
-
deployFederate
Deploys a federate represented by its descriptor on the local machine.- Parameters:
descriptor- federate descriptor consisting all necessary data to deploy a federate- Throws:
Exception- if the federate could not be deployed
-
startFederate
Starts a federate represented by its handle on the local machine.- Parameters:
handle- federate handle consisting all necessary data to start a federate- Throws:
Exception- if the federate could not be started
-
stopFederate
Stops a federate represented by its handle on the local machine.- Parameters:
handle- federate handle consisting all necessary data to stop a federate- Throws:
Exception- if the federate could not be stopped
-
undeployFederate
Undeploys a federate represented by its handle on the local machine.- Parameters:
handle- federate handle consisting all necessary data to undeploy a federate- Throws:
Exception- if the federate could not be undeployed
-
getFederationId
Description copied from interface:FederationManagementReturns the id of the simulated federation.- Specified by:
getFederationIdin interfaceFederationManagement- Returns:
- the id of the simulated federation.
-
setWatchdog
Description copied from interface:FederationManagementSets theWatchDogwhich detects broken federates.- Specified by:
setWatchdogin interfaceFederationManagement
-