本文整理汇总了Java中hla.rti1516e.exceptions.InteractionClassNotDefined类的典型用法代码示例。如果您正苦于以下问题:Java InteractionClassNotDefined类的具体用法?Java InteractionClassNotDefined怎么用?Java InteractionClassNotDefined使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InteractionClassNotDefined类属于hla.rti1516e.exceptions包,在下文中一共展示了InteractionClassNotDefined类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updatePublishedInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void updatePublishedInteraction() throws InteractionClassNotPublished, InteractionParameterNotDefined, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {
if(status == ObjectModelStatus.PUBLISHED) {
Map<String, byte[]> ris = parser.encode(interactionEntity.getElement());
for(Entry<String, ParameterHandle> entry : mapFieldNameParameterHandle.entrySet())
parameter_values.put(entry.getValue(), ris.get(entry.getKey()));
rti_ambassador.sendInteraction(interactionClassHandle, parameter_values, null);
}
else{
logger.error("Can't update the ' "+interactionEntity+" ', because it is not published!");
throw new IllegalStateException("Can't update the ' "+interactionEntity+" ', because it is not published!");
}
}
示例2: publish
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void publish(Object interaction) throws RTIinternalError, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidInteractionClassHandle, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, InteractionClassNotPublished, InteractionParameterNotDefined {
InteractionClassModel icm = published.get(interaction.getClass().getAnnotation(InteractionClass.class).name());
if(icm == null){
icm = new InteractionClassModel(interaction.getClass());
icm.addEntity(interaction);
icm.publish();
this.published.put(interaction.getClass().getAnnotation(InteractionClass.class).name(), icm);
this.mapInstanceNameInteractionClassEntity.put(icm.getEntity().getInstanceName(), icm.getEntity());
}
}
示例3: subscribe
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void subscribe(Class interactionClass) throws RTIinternalError, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidInteractionClassHandle, FederateServiceInvocationsAreBeingReportedViaMOM, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, InstantiationException, IllegalAccessException {
InteractionClassModel icm = new InteractionClassModel(interactionClass);
icm.addEntity(interactionClass.newInstance());
icm.subscribe();
this.subscribed.put(((Class<? extends InteractionClass>)interactionClass).getAnnotation(InteractionClass.class).name(), icm);
this.mapInteractionClassHandleClass.put(icm.getInteractionClassHandle(), interactionClass);
}
示例4: subscribe
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void subscribe() throws FederateServiceInvocationsAreBeingReportedViaMOM, InteractionClassNotDefined, SaveInProgress,
RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {
if(status == ObjectModelStatus.INITIALIZED){
rti_ambassador.subscribeInteractionClass(this.interactionClassHandle);
status = ObjectModelStatus.SUBSCRIBED;
}
else{
logger.error("You can't subscribe an uninitialized interaction!");
throw new IllegalStateException("You can't subscribe an uninitialized interaction!");
}
}
示例5: unsubscribe
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void unsubscribe() throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {
if(status == ObjectModelStatus.SUBSCRIBED){
rti_ambassador.unsubscribeInteractionClass(this.interactionClassHandle);
status = ObjectModelStatus.UNKNOWN;
}
else{
logger.error("You can't unsubscribe "+this.interactionClassHandle+" because it is not subscribed");
throw new IllegalStateException("You can't unsubscribe "+this.interactionClassHandle+" because it is not subscribed");
}
}
示例6: publish
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void publish() throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {
if(status == ObjectModelStatus.INITIALIZED){
rti_ambassador.publishInteractionClass(interactionClassHandle);
status = ObjectModelStatus.PUBLISHED;
}
else{
logger.error("You can't publish an uninitialized or an already published InteractionClassModel!");
throw new IllegalStateException("You can't publish an uninitialized or an already published InteractionClassModel!");
}
}
示例7: unpublish
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void unpublish() throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {
if(status == ObjectModelStatus.PUBLISHED){
rti_ambassador.unpublishInteractionClass(interactionClassHandle);
status = ObjectModelStatus.UNKNOWN;
}
else{
logger.error("You can't unpublish an uninitialized or an unpublished InteractionClassModel!");
throw new IllegalStateException("You can't unpublish an uninitialized or an unpublished InteractionClassModel!");
}
}
示例8: publishInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@Override
public void publishInteraction(Object interaction) throws RTIinternalError, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidInteractionClassHandle, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, InteractionClassNotPublished, InteractionParameterNotDefined, PublishException {
if(interactionClassIsValid(interaction.getClass()))
this.hlamodule.publishInteraction(interaction);
else{
logger.error("Interaction: '"+ interaction +"' is not valid!");
throw new PublishException("Interaction: '"+ interaction +"' is not valid!");
}
}
示例9: updateInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@Override
public void updateInteraction(Object interaction) throws InteractionClassNotPublished, InteractionParameterNotDefined, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError, UpdateException {
if(interactionClassIsValid(interaction.getClass()))
this.hlamodule.updateInteraction(interaction);
else{
logger.error("Interaction: '"+ interaction +"' is not valid!");
throw new UpdateException("Interaction: '"+ interaction +"' is not valid!");
}
}
示例10: subscribeInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes" })
public void subscribeInteraction(Class interactionClass) throws RTIinternalError, InstantiationException, IllegalAccessException, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidInteractionClassHandle, FederateServiceInvocationsAreBeingReportedViaMOM, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, SubscribeException {
if(interactionClassIsValid(interactionClass))
this.hlamodule.subscribeInteractionObject(interactionClass);
else{
logger.error("Interaction: '"+ interactionClass +"' is not valid!");
throw new SubscribeException("Interaction: '"+ interactionClass +"' is not valid!");
}
}
示例11: unsubscribeInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes" })
public void unsubscribeInteraction(Class interactionClass) throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError, UnsubscribeException {
if(interactionClassIsValid(interactionClass))
this.hlamodule.unsubscribeInteractionObject(interactionClass);
else{
logger.error("Interaction: '"+ interactionClass +"' is not valid!");
throw new UnsubscribeException("Interaction: '"+ interactionClass +"' is not valid!");
}
}
示例12: publishInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void publishInteraction(Object interaction) throws PublishException, RTIinternalError, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidInteractionClassHandle, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, InteractionClassNotPublished, InteractionParameterNotDefined {
if(!fedamb.interactionClassEntityIsAlreadyPublished(interaction)){
fedamb.publishInteractionClassEntity(interaction);
logger.info("The Interaction ' "+interaction+" ' has been published.");
}
else{
logger.warn("Interaction: "+interaction+", is already published");
throw new PublishException("Interaction: "+interaction+", is already published.");
}
}
示例13: updateInteraction
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
public void updateInteraction(Object interaction) throws InteractionClassNotPublished, InteractionParameterNotDefined, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError, UpdateException {
if(fedamb.interactionClassEntityIsAlreadyPublished(interaction)){
fedamb.updateInteractionClassEntityOnRTI(interaction);
logger.info("The Interaction ' "+interaction+" ' has been updated on the HLA/RTI platform.");
}
else{
logger.warn("Interaction: "+interaction+", not published.");
throw new UpdateException("You can't update an unpublished interaction.");
}
}
示例14: subscribeInteractionObject
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void subscribeInteractionObject(Class interactionClass) throws RTIinternalError, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidInteractionClassHandle, FederateServiceInvocationsAreBeingReportedViaMOM, InteractionClassNotDefined, SaveInProgress, RestoreInProgress, InstantiationException, IllegalAccessException {
if(!fedamb.interactionClassModelIsAlreadySubscribed(interactionClass)){
fedamb.subscribeInteractionClassModel(interactionClass);
logger.info("The InteractionClass ' "+interactionClass+" ' has been subscribed.");
}
else
logger.warn("The InteractionClass ' "+interactionClass+" ' is already subscribed.");
}
示例15: unsubscribeInteractionObject
import hla.rti1516e.exceptions.InteractionClassNotDefined; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
public void unsubscribeInteractionObject(Class interactionClass) throws InteractionClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError, UnsubscribeException {
if(fedamb.interactionClassModelIsAlreadySubscribed(interactionClass)){
fedamb.unsubscribeInteractionClassModel(interactionClass);
logger.info("The InteractionClass '"+interactionClass+" ' has been unsubscribed.");
}
else{
logger.error("Error during unsubscribe the "+interactionClass);
throw new UnsubscribeException("Error during unsubscribe the "+interactionClass);
}
}