當前位置: 首頁>>代碼示例>>Java>>正文


Java RestoreInProgress類代碼示例

本文整理匯總了Java中hla.rti1516e.exceptions.RestoreInProgress的典型用法代碼示例。如果您正苦於以下問題:Java RestoreInProgress類的具體用法?Java RestoreInProgress怎麽用?Java RestoreInProgress使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RestoreInProgress類屬於hla.rti1516e.exceptions包,在下文中一共展示了RestoreInProgress類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: publish

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void publish(Object element, String name) throws RTIinternalError, NameNotFound, FederateNotExecutionMember, NotConnected, InvalidObjectClassHandle, InstantiationException, IllegalAccessException, AttributeNotDefined, ObjectClassNotDefined, SaveInProgress, RestoreInProgress, IllegalName, ObjectInstanceNameInUse, ObjectInstanceNameNotReserved, ObjectClassNotPublished, AttributeNotOwned, ObjectInstanceNotKnown, UpdateException {

		ObjectClassModel ocm = published.get(element.getClass().getAnnotation(ObjectClass.class).name());

		if(ocm == null){
			ocm = new ObjectClassModel(element.getClass());
			ocm.publish();
			this.published.put(element.getClass().getAnnotation(ObjectClass.class).name(), ocm);
		}
		
		ObjectClassEntity entity = null;
		if(name != null)
			entity = new ObjectClassEntity(name, element);
		else
			entity = new ObjectClassEntity(element.getClass().getName()+element.hashCode(), element);
		
		ocm.addEntity(entity);
		this.mapInstanceNameObjectClassEntity.put(entity.getInstanceName(), entity);

	}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:21,代碼來源:ObjectClassModelManager.java

示例2: subscribe

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void subscribe() throws AttributeNotDefined, ObjectClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {

		if(status == ObjectModelStatus.INITIALIZED){

			AttributeHandleSet attributeSet = rti_ambassador.getAttributeHandleSetFactory().create();
			for( AttributeHandle val: mapFieldNameAttributeHandle.values())
				attributeSet.add(val);

			rti_ambassador.subscribeObjectClassAttributes(objectClassHandle, attributeSet);
			mapObjectClassHandleAttributeHandleSet.put(objectClassHandle, attributeSet);
			status = ObjectModelStatus.SUBSCRIBED;
			
		}
		else{
			logger.error("You can't subscribe an uninitialized element!");
			throw new IllegalStateException("You can't subscribe an uninitialized element!");
		}

	}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:20,代碼來源:ObjectClassModel.java

示例3: publish

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void publish() throws FederateNotExecutionMember, NotConnected, AttributeNotDefined, ObjectClassNotDefined, SaveInProgress, 
RestoreInProgress, RTIinternalError{

	if(status == ObjectModelStatus.INITIALIZED){

		AttributeHandleSet attributeSet = rti_ambassador.getAttributeHandleSetFactory().create();
		
		for(AttributeHandle element: mapFieldNameAttributeHandle.values())
			attributeSet.add(element);
		
		rti_ambassador.publishObjectClassAttributes(objectClassHandle, attributeSet);
		mapObjectClassHandleAttributeHandleSet.put(objectClassHandle, attributeSet);
					
		status = ObjectModelStatus.PUBLISHED;
	}
	else{
		logger.error("You can't publish an uninitialized or an already published ObjectClassModel!");
		throw new IllegalStateException("You can't publish an uninitialized or an already published ObjectClassModel!");
	}

}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:22,代碼來源:ObjectClassModel.java

示例4: unpublish

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void unpublish() throws FederateNotExecutionMember, NotConnected, OwnershipAcquisitionPending, AttributeNotDefined, 
ObjectClassNotDefined, SaveInProgress, RestoreInProgress, RTIinternalError {

	if(status == ObjectModelStatus.PUBLISHED){

		AttributeHandleSet attributeSet = rti_ambassador.getAttributeHandleSetFactory().create();
		attributeSet.addAll(mapFieldNameAttributeHandle.values());
		rti_ambassador.unpublishObjectClassAttributes(objectClassHandle, attributeSet);
		mapObjectClassHandleAttributeHandleSet.remove(objectClassHandle);

		status = ObjectModelStatus.UNKNOWN;
	}
	else{
		logger.error("You can't unpublish an uninitialized or an unpublished ObjectClassModel!");
		throw new IllegalStateException("You can't unpublish an uninitialized or an unpublished ObjectClassModel!");
	}

}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:19,代碼來源:ObjectClassModel.java

示例5: reserveObjectInstanceName

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
private ObjectInstanceHandle reserveObjectInstanceName(ObjectClassEntity entity) throws IllegalName, SaveInProgress, RestoreInProgress, 
FederateNotExecutionMember, NotConnected, RTIinternalError, 
ObjectInstanceNameInUse, ObjectInstanceNameNotReserved, 
ObjectClassNotPublished, ObjectClassNotDefined {

	// Reserve the name.
	rti_ambassador.reserveObjectInstanceName(entity.getInstanceName());

	// Need to wait here until name reservation callback is recieved.
	while (entity.getStatus() == NameReservationStatus.UNKNOWN)
		Thread.yield();

	if (entity.getStatus() == NameReservationStatus.FAILED) {
		logger.error("Name Resevation Failed [name= "+entity+" ]");
		throw new IllegalName("Name Resevation Failed [name= "+entity+" ]");
	}

	// If name is reserved then register the instance.
	if (entity.getStatus() == NameReservationStatus.SUCCEDED)
		return  rti_ambassador.registerObjectInstance(objectClassHandle,entity.getInstanceName());

	return null;
}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:24,代碼來源:ObjectClassModel.java

示例6: updatePublishedInteraction

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的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!");
		}

	}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:17,代碼來源:InteractionClassModel.java

示例7: diconnectFromRTI

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
@Override
public void diconnectFromRTI() throws InvalidResignAction, OwnershipAcquisitionPending, 
FederateOwnsAttributes, FederateNotExecutionMember, NotConnected, 
RTIinternalError, FederateIsExecutionMember, CallNotAllowedFromWithinCallback, 
SaveInProgress, RestoreInProgress {

	 try {
		this.executionTask.shutdown();
		this.runningThread.join(3000);
	} catch (InterruptedException e) {
		e.printStackTrace();
	}finally{
		this.hlamodule.disconnect();
	}

}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:17,代碼來源:SEEAbstractFederate.java

示例8: requestAttributeValueUpdate

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
@SuppressWarnings({ "unchecked", "rawtypes" })
public void requestAttributeValueUpdate(Class objectClass) throws AttributeNotDefined, ObjectClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError, UnsubscribeException {

	if(fedamb.objectClassModelIsAlreadySubscribed(objectClass)){
		
		String classHandleName = ((Class<ObjectClass>)objectClass).getAnnotation(ObjectClass.class).name();
		ObjectClassModel model = fedamb.getObjectManager().getSubscribedMap().get(classHandleName);
		ObjectClassHandle objectClassHandle = model.getObjectClassHandle();
		AttributeHandleSet attributeSet = model.getAttributeHandleSet(objectClassHandle);
		rtiamb.requestAttributeValueUpdate(objectClassHandle, attributeSet, null);
	}
	else{	
		logger.error("Error: "+objectClass+" is not subscribed!");
		throw new UnsubscribeException("Error: "+objectClass+" is not subscribed!");
	}
		

}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:19,代碼來源:SEEHLAModule.java

示例9: initialize

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public static void initialize(RTIambassador rti_ambassador) throws NameNotFound, FederateNotExecutionMember, NotConnected, 
RTIinternalError, InvalidObjectClassHandle, AttributeNotDefined, 
ObjectClassNotDefined, SaveInProgress, RestoreInProgress {

	if(initialized)
		return;

	createReferenceFrameEncoders();

	// Get a handle to the ReferenceFrame class.
	obj_class_handle = rti_ambassador.getObjectClassHandle("ReferenceFrame");

	// Get handles to all the ReferenceFrame attributes.
	name_handle = rti_ambassador.getAttributeHandle(obj_class_handle, "name");
	parent_frame_handle = rti_ambassador.getAttributeHandle(obj_class_handle, "parent_name");
	state_handle = rti_ambassador.getAttributeHandle(obj_class_handle,  "state");

	// Generate an attribute handle set.
	attributeSet = rti_ambassador.getAttributeHandleSetFactory().create();
	attributeSet.add(name_handle);
	attributeSet.add(parent_frame_handle);
	attributeSet.add(state_handle);

	initialized = true;

}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:27,代碼來源:ReferenceFrameObject.java

示例10: publish

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void publish() throws FederateNotExecutionMember, NotConnected, AttributeNotDefined, ObjectClassNotDefined, SaveInProgress, 
RestoreInProgress, RTIinternalError{

	if(status == ObjectModelStatus.INITIALIZED){

		AttributeHandleSet attributeSet = rti_ambassador.getAttributeHandleSetFactory().create();
		
		for(AttributeHandle element: mapFieldNameAttributeHandle.values())
			attributeSet.add(element);
		
		rti_ambassador.publishObjectClassAttributes(objectClassHandle, attributeSet);
					
		status = ObjectModelStatus.PUBLISHED;
	}
	else{
		logger.error("You can't publish an uninitialized or an already published ObjectClassModel!");
		throw new IllegalStateException("You can't publish an uninitialized or an already published ObjectClassModel!");
	}

}
 
開發者ID:SMASH-Lab,項目名稱:HLA-Development-Kit,代碼行數:21,代碼來源:ObjectClassModel.java

示例11: publishElement

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void publishElement(Object element, String name) throws NameNotFound, FederateNotExecutionMember, NotConnected, 
RTIinternalError, InvalidObjectClassHandle, PublishException, InstantiationException, 
IllegalAccessException, AttributeNotDefined, ObjectClassNotDefined, SaveInProgress, 
RestoreInProgress, IllegalName, ObjectInstanceNameInUse, ObjectInstanceNameNotReserved, 
ObjectClassNotPublished, AttributeNotOwned, ObjectInstanceNotKnown, UpdateException  {

	if(!fedamb.objectClassEntityIsAlreadyPublished(element)){
		fedamb.publishObjectClassEntity(element, name);
		logger.info("The Object '"+element+"' has been published.");
	}
	else{
		logger.warn("Object: "+element+", is already published");
		throw new PublishException("Object: "+element+", is already published.");
	}

}
 
開發者ID:SMASH-Lab,項目名稱:HLA-Development-Kit,代碼行數:17,代碼來源:DKFHLAModule.java

示例12: diconnectFromRTI

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void diconnectFromRTI() throws InvalidResignAction, OwnershipAcquisitionPending, 
FederateOwnsAttributes, FederateNotExecutionMember, NotConnected, 
RTIinternalError, FederateIsExecutionMember, CallNotAllowedFromWithinCallback, 
SaveInProgress, RestoreInProgress {


	try {
		this.executionTask.shutdown();
		this.runningThread.join(3000);
	} catch (InterruptedException e) {
		e.printStackTrace();
	}finally{
		this.hlamodule.disconnect();
	}

}
 
開發者ID:SMASH-Lab,項目名稱:HLA-Development-Kit,代碼行數:17,代碼來源:DKFAbstractFederate.java

示例13: subscribe

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public void subscribe(Class objectClass) throws RTIinternalError, InstantiationException, IllegalAccessException, NameNotFound, 
FederateNotExecutionMember, NotConnected, InvalidObjectClassHandle, AttributeNotDefined,
ObjectClassNotDefined, SaveInProgress, RestoreInProgress {


	ObjectClassModel ocm = new ObjectClassModel(objectClass);
	ocm.subscribe();

	this.subscribed.put(((Class<ObjectClass>)objectClass).getAnnotation(ObjectClass.class).name(), ocm);
	this.mapHandleClassObjectClass.put(ocm.getObjectClassHandle(), objectClass);
}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:13,代碼來源:ObjectClassModelManager.java

示例14: unsubscribe

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void unsubscribe() throws ObjectClassNotDefined, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, NotConnected, RTIinternalError {

		if(status == ObjectModelStatus.SUBSCRIBED){

			rti_ambassador.unsubscribeObjectClass(this.objectClassHandle);
			mapObjectClassHandleAttributeHandleSet.remove(objectClassHandle);
			status = ObjectModelStatus.UNKNOWN;
		}
		else{
			logger.error("You can't unsubscribe "+this.objectClassHandle+" because it is not subscribed");
			throw new IllegalStateException("You can't unsubscribe "+this.objectClassHandle+" because it is not subscribed");
		}

	}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:15,代碼來源:ObjectClassModel.java

示例15: updatePublishedObject

import hla.rti1516e.exceptions.RestoreInProgress; //導入依賴的package包/類
public void updatePublishedObject(ObjectClassEntity element) throws UpdateException, IllegalName, SaveInProgress, RestoreInProgress, FederateNotExecutionMember, 
NotConnected, RTIinternalError, ObjectInstanceNameInUse, ObjectInstanceNameNotReserved, ObjectClassNotPublished, 
ObjectClassNotDefined, AttributeNotOwned, AttributeNotDefined, ObjectInstanceNotKnown {

	ObjectClassEntity entity = entityMap.get(element.getElement());

	if(entity == null){
		logger.error("Can't find the ' "+element+" ' !");
		throw new IllegalStateException("Can't find the ' "+element+" ' !");
	}

	if(status == ObjectModelStatus.PUBLISHED) {
		if(entity.getObjectInstanceHandle() == null)
			entity.setObjectInstanceHandle(reserveObjectInstanceName(entity));
		
		Map<String, byte[]> ris = parser.encode(element.getElement());
		for(Entry<String, AttributeHandle> entry : mapFieldNameAttributeHandle.entrySet())
			attribute_values.put(entry.getValue(), ris.get(entry.getKey()));
		
		rti_ambassador.updateAttributeValues(entity.getObjectInstanceHandle(), attribute_values , null);
	}
	else{
		logger.error("Can't update the Object ' "+element+" ', because it is not published!");
		throw new IllegalStateException("Can't update the Object ' "+element+" ', because it is not published!");
	}

}
 
開發者ID:SMASH-Lab,項目名稱:SEE-HLA-Starter-Kit,代碼行數:28,代碼來源:ObjectClassModel.java


注:本文中的hla.rti1516e.exceptions.RestoreInProgress類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。