gov.nasa.arc.brahms.vm.data
Class VMObjectInstance

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.BrahmsObject
      extended by gov.nasa.arc.brahms.common.data.ModelElement
          extended by gov.nasa.arc.brahms.common.data.NamedModelElement
              extended by gov.nasa.arc.brahms.common.data.Concept
                  extended by gov.nasa.arc.brahms.common.data.ActiveConcept
                      extended by gov.nasa.arc.brahms.common.data.ActiveInstance
                          extended by gov.nasa.arc.brahms.common.data.ObjectInstance
                              extended by gov.nasa.arc.brahms.vm.data.VMObjectInstance
All Implemented Interfaces:
IConceptInstance, Type, gov.nasa.arc.brahms.common.IConstants, gov.nasa.arc.brahms.vm.ci.ICIActor, IVMInstance, java.io.Serializable

public class VMObjectInstance
extends ObjectInstance
implements IVMInstance, gov.nasa.arc.brahms.vm.ci.ICIActor

The VMObjectInstance is an ObjectInstance with extensions for use in the Brahms virtual machine. An 'object' in Brahms is the second most central element in a Brahms model. An object represents a specific artifact in the world. It is possible to model the activities of an artifact in an organization. For example the data processing activities of a computer system can be modeled. The activities can be defined in the object's class (which will be inherited by the object) and/or can be defined for the object itself.

Version:
$Revision: 1.5 $ $Date: 2009/11/23 22:12:31 $ $Author: rnado $
Author:
Ron van Hoof
See Also:
ObjectInstance, Serialized Form

Field Summary
static long EXCEPTION_TIMEOUT
          Constant specifying the recommended default time-out after an exception
static int NUM_RETRIES
          Constant specifying the recommended default number of retries
 
Fields inherited from class gov.nasa.arc.brahms.common.data.Concept
ATTRIBUTES_PROPERTY, RELATIONS_PROPERTY
 
Fields inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
NAME_PROPERTY
 
Fields inherited from interface gov.nasa.arc.brahms.common.IConstants
ABORT, ACTIVECLASS, ACTIVECONCEPT, ACTIVEINSTANCE, AGENT, ANONYMOUS, ANYAGENT, AREA, AREADEF, ASSIGNED, ATTRIBUTE, BASEAREADEF, BASECLASS, BASECONCEPTUALCLASS, BASEGROUP, BASELIBRARY, BOOLEAN, BROADCAST, BUILDING, BYTE, CCLOCK, CDATE, CHAR, CITY, CLASS, CLOCK, COLLECTALL, COMMUNICATE, COMPLETE, COMPOSITE, COMPUTER, CONCEPT, CONCEPTUALCLASS, CONCEPTUALCONCEPT, CONCEPTUALOBJECT, CONTINUE, COPY, CREATEAGENT, CREATEAREA, CREATEOBJECT, current, CURRENT, DATAFRAME, DATE, DB, DETECTABLE, DIV, DOUBLE, EMAIL, EMPTY_STRING, END, ENDACTIVITY, ENTAGENT, EQ, EXCEPTION, EXPR, FACE2FACE, FACTFRAME, FALSE, FAX, FLOAT, FOREACH, FORONE, G2, GE, GEOGRAPHYCONCEPT, GESTURE, GET, GROUP, GT, IMPASSE, INT, INVALID, JAVA, JAVA_TYPE, KNOWN_MODIFIER, KNOWNVAL_MODIFIER, LE, LOCAL, LONG, LT, MAP, MINUS, MOD, MOVE, MULT, NE, NEW, NONE, NOT_MODIFIER, NOWORK, O, OA, OBJECT, ONTOLOGY, PAGER, PARAMETER, PATH, PHONE, PLUS, PRIMITIVE, PRIVATE, PROAGENT, PROTECTED, PRSAGENT, PUBLIC, PUT, RECEIVE, RELATION, sACTIVECLASS, sACTIVECONCEPT, sACTIVEINSTANCE, sAGENT, sARCHIVE, sAREA, sAREADEF, sBOOLEAN, sBYTE, sBYTECODEEXT, sCHAR, sCLASS, sCOMPUTER, sCONCEPT, sCONCEPTUALCLASS, sCONCEPTUALCONCEPT, sCONCEPTUALOBJECT, sCOPY, sCURRENT, sDETECTABLE, sDOUBLE, sEMAIL, sEND, SEND, sFACE2FACE, sFAX, sFILEEXT, sFLOAT, sGEOGRAPHYCONCEPT, sGROUP, SHORT, SIMAGENT, sINT, sJAVA_TYPE, sLONG, sMAP, sNEW, sNONE, sNOWORK, sOBJECT, SOURCECODE, sPAGER, sPARAMETER, sPATH, sPHONE, sPRIVATE, sPROJECTEXT, sPROTECTED, sPUBLIC, sSHORT, sSTART, sSTRING, sSYMBOL, START, STRING, sUNKNOWN, sVOID, SYMBOL, TRUE, UDT, UML, UNASSIGNED, UNDEFINED, unknown, UNKNOWN, UNKNOWN_MODIFIER, V, VARIABLE, VOID, WHENEVER, WORKFRAME, WORLD, XML
 
Constructor Summary
VMObjectInstance()
          Constructor, creates a new object for use in the virtual machine.
VMObjectInstance(java.lang.String name)
          Constructor, creates a new object with the specified name for use in the virtual machine.
VMObjectInstance(java.lang.String file, int line)
          Constructor, creates a new object for use in the virtual machine and for which its specification is stored in the specified file at the specified line number.
VMObjectInstance(java.lang.String name, java.lang.String file, int line)
          Constructor, creates a new object with the specified name for use in the virtual machine and for which its specification is stored in the specified file at the specified line number.
 
Method Summary
 void addJunkFilter(java.lang.String conversationID)
          Adds the specified conversation identifier to the junk filter to ensure that any incoming messages with that conversation identifier are ignored.
 IConceptCtx createContext()
          Creates a new context for this concept for use in a virtual machine.
 void deregister()
          Unregisters the agent from the CI.
 boolean equals(java.lang.Object obj)
          Tests whether two VMObjectInstances are equal.
 gov.nasa.arc.brahms.vm.ci.BrahmsCIActor getActor()
          Returns this object's Collaborative Infrastructure actor.
 gov.nasa.ci.corba.api.directory.Advertisement getAdvertisement()
          Returns the object's advertisement.
 gov.nasa.ci.corba.api.Credentials getCredentials()
          Returns the object's credentials.
 gov.nasa.ci.corba.api.data.IDataDistributionService getDataDistributionService()
          Returns a reference to the data distribution service used to publish data and used to subscribe for data.
 gov.nasa.ci.api.actor.IActorDescriptor getDescriptor()
          Returns the actor's descriptor.
 gov.nasa.ci.corba.api.directory.IDirectoryService getDirectoryService()
          Returns a reference to the directory service used to register/deregister the actor and to lookup other actors.
 java.util.Enumeration getInitialFacts(boolean includeParents)
          Returns the object's initial facts.
protected  Relation getIsInstanceOfRelation()
          Returns the isInstanceOf relation as defined by BaseClass.
 gov.nasa.ci.corba.api.logging.ILoggingService getLoggingService()
          Returns a reference to the logging service used to log debug, informational, warning, error and fatal messages reported by the actor.
 gov.nasa.ci.api.actor.IManagedActor getManagedActor()
          Returns the actor's management interface.
 gov.nasa.ci.corba.api.management.IManagementService getManagementService()
          Returns a reference to the management service used to allow for the remote monitoring and control of the actor.
 gov.nasa.ci.corba.api.time.ITimeService getTimeService()
          Returns a reference to the time service used to provide time information and time notification services.
 gov.nasa.ci.corba.api.transport.ITransportService getTransportService()
          Returns a reference to the transport service used to create and send messages.
 boolean isCopy()
          Returns whether this object is a copy of a remote object.
 void processMessage(gov.nasa.ci.api.communication.ICommunicativeAct message)
          Invoked when a new ICommunicativeAct was received intended for this actor.
 void register()
          Registers the agent with the CI
 void setAdvertisement(gov.nasa.ci.corba.api.directory.Advertisement advertisement)
          Sets the object's advertisement.
 void setCopy(boolean copy)
          Sets the indicator for whether this object is a copy of a remote object.
 void setCredentials(gov.nasa.ci.corba.api.Credentials credentials)
          Sets the object's credentials.
 
Methods inherited from class gov.nasa.arc.brahms.common.data.ObjectInstance
addAggregate, delete, getActivitiesRecursive, getActivitiesRecursive, getActivityByDescriptorRecursive, getAggregate, getAggregates, getAttributeRecursive, getAttributesRecursive, getInitialBeliefsRecursive, getInitialFactsRecursive, getParent, getParents, getRelationRecursive, getRelationsRecursive, getThoughtframesRecursive, getWorkframesRecursive, hasAggregates, isInstanceOf, isPartOf, isResource, removeAggregate, setID, setParent, setResource
 
Methods inherited from class gov.nasa.arc.brahms.common.data.ActiveInstance
getLocation, setLocation
 
Methods inherited from class gov.nasa.arc.brahms.common.data.ActiveConcept
addActivity, addInitialBelief, addInitialFact, addThoughtframe, addWorkframe, getActivities, getActivities, getActivities, getActivities, getActivityByDescriptor, getActivityByDescriptor, getAttribute, getAttributes, getCost, getInitialBeliefs, getInitialBeliefs, getInitialFacts, getLocalActivityByDescriptor, getRelation, getRelations, getThoughtframe, getThoughtframes, getThoughtframes, getThoughtframes, getTimeUnit, getWorkframe, getWorkframes, getWorkframes, getWorkframes, hasActivities, hasInitialBeliefs, hasInitialFacts, hasThoughtframes, hasWorkframes, removeActivity, removeThoughtframe, removeWorkframe, setCost, setTimeUnit
 
Methods inherited from class gov.nasa.arc.brahms.common.data.Concept
addAttribute, addRelation, compareTypes, getAttribute, getAttributes, getContext, getFullyQualifiedName, getIcon, getModel, getName, getPackage, getRelation, getRelations, getType, hasAttributes, hasRelations, isLocal, isSerializable, removeAttribute, removeRelation, setContext, setIcon, setLocal, setModel, setPackage, setSerializable, toString
 
Methods inherited from class gov.nasa.arc.brahms.common.data.NamedModelElement
getDisplayText, getOwner, setDisplayText, setFullyQualifiedName, setName, setOwner
 
Methods inherited from class gov.nasa.arc.brahms.common.data.BrahmsObject
export, getFile, getID, getLine, getSerialNumber, isBCC, isDynamic, isLoaded, isResolved, setBCC, setDynamic, setFile, setID, setLine, setLoaded, setResolved, setSerialNumber
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.nasa.arc.brahms.vm.data.IVMInstance
getContext, getFullyQualifiedName, getID, getName, isDynamic, isLocal, isSerializable, setDynamic, setSerializable
 
Methods inherited from interface gov.nasa.arc.brahms.common.data.Type
getSerialNumber
 

Field Detail

EXCEPTION_TIMEOUT

public static final long EXCEPTION_TIMEOUT
Constant specifying the recommended default time-out after an exception

See Also:
Constant Field Values

NUM_RETRIES

public static final int NUM_RETRIES
Constant specifying the recommended default number of retries

See Also:
Constant Field Values
Constructor Detail

VMObjectInstance

public VMObjectInstance()
Constructor, creates a new object for use in the virtual machine.


VMObjectInstance

public VMObjectInstance(java.lang.String name)
Constructor, creates a new object with the specified name for use in the virtual machine.

Parameters:
name - the name of the object

VMObjectInstance

public VMObjectInstance(java.lang.String file,
                        int line)
Constructor, creates a new object for use in the virtual machine and for which its specification is stored in the specified file at the specified line number.

Parameters:
file - the file in which the object is specified
line - the line number at which the object's specification starts in the file

VMObjectInstance

public VMObjectInstance(java.lang.String name,
                        java.lang.String file,
                        int line)
Constructor, creates a new object with the specified name for use in the virtual machine and for which its specification is stored in the specified file at the specified line number.

Parameters:
name - the name of the object
file - the file in which the object is specified
line - the line number at which the object's specification starts in the file
Method Detail

setCopy

public void setCopy(boolean copy)
Sets the indicator for whether this object is a copy of a remote object.

Parameters:
copy - true if it is a copy, false if not

isCopy

public boolean isCopy()
Returns whether this object is a copy of a remote object.

Returns:
boolean true if this object is a copy, false if not

getActor

public gov.nasa.arc.brahms.vm.ci.BrahmsCIActor getActor()
                                                 throws VMException
Returns this object's Collaborative Infrastructure actor.

Returns:
BrahmsCIActor this object's CI actor
Throws:
VMException - if an error occurs creating the CI actor

getDescriptor

public gov.nasa.ci.api.actor.IActorDescriptor getDescriptor()
Returns the actor's descriptor.

Specified by:
getDescriptor in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
IActorDescriptor the descriptor

getCredentials

public gov.nasa.ci.corba.api.Credentials getCredentials()
Returns the object's credentials.

Specified by:
getCredentials in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
Credentials the object's credentials

setCredentials

public void setCredentials(gov.nasa.ci.corba.api.Credentials credentials)
Sets the object's credentials.

Specified by:
setCredentials in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Parameters:
credentials - the object's Credentials

getAdvertisement

public gov.nasa.ci.corba.api.directory.Advertisement getAdvertisement()
Returns the object's advertisement.

Specified by:
getAdvertisement in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
Advertisement the object's advertisement

setAdvertisement

public void setAdvertisement(gov.nasa.ci.corba.api.directory.Advertisement advertisement)
Sets the object's advertisement.

Specified by:
setAdvertisement in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Parameters:
advertisement - the object's Advertisement

register

public void register()
              throws ConceptRegistrationException
Registers the agent with the CI

Specified by:
register in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Throws:
ConceptRegistrationException - if there's an error registering the concept

deregister

public void deregister()
                throws VMException
Unregisters the agent from the CI.

Specified by:
deregister in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Throws:
VMException - if an error occurs during the de-registration

processMessage

public void processMessage(gov.nasa.ci.api.communication.ICommunicativeAct message)
Invoked when a new ICommunicativeAct was received intended for this actor.

Specified by:
processMessage in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Parameters:
message - the ICommunicativeAct intended for this actor

addJunkFilter

public void addJunkFilter(java.lang.String conversationID)
Adds the specified conversation identifier to the junk filter to ensure that any incoming messages with that conversation identifier are ignored.

Specified by:
addJunkFilter in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Parameters:
conversationID - the conversation id for the messages that need to be ignored

getManagedActor

public gov.nasa.ci.api.actor.IManagedActor getManagedActor()
Returns the actor's management interface. This interface is only available when the actor is successfully registered with the CI.

Specified by:
getManagedActor in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
IManagedActor the management interface, null if not registered

getDirectoryService

public gov.nasa.ci.corba.api.directory.IDirectoryService getDirectoryService()
                                                                      throws gov.nasa.ci.corba.api.ServiceException
Returns a reference to the directory service used to register/deregister the actor and to lookup other actors.

Specified by:
getDirectoryService in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
IDirectoryService the directory service reference
Throws:
gov.nasa.ci.corba.api.ServiceException - if there was an error obtaining the service

getTransportService

public gov.nasa.ci.corba.api.transport.ITransportService getTransportService()
                                                                      throws gov.nasa.ci.corba.api.ServiceException
Returns a reference to the transport service used to create and send messages.

Specified by:
getTransportService in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
ITransportService the transport service reference
Throws:
gov.nasa.ci.corba.api.ServiceException - if there was an error obtaining the service

getDataDistributionService

public gov.nasa.ci.corba.api.data.IDataDistributionService getDataDistributionService()
                                                                               throws gov.nasa.ci.corba.api.ServiceException
Returns a reference to the data distribution service used to publish data and used to subscribe for data.

Specified by:
getDataDistributionService in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
IDataDistributionService the data distribution service reference
Throws:
gov.nasa.ci.corba.api.ServiceException - if there was an error obtaining the service

getManagementService

public gov.nasa.ci.corba.api.management.IManagementService getManagementService()
                                                                         throws gov.nasa.ci.corba.api.ServiceException
Returns a reference to the management service used to allow for the remote monitoring and control of the actor.

Specified by:
getManagementService in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
IManagementService the management service reference
Throws:
gov.nasa.ci.corba.api.ServiceException - if there was an error obtaining the service

getTimeService

public gov.nasa.ci.corba.api.time.ITimeService getTimeService()
                                                       throws gov.nasa.ci.corba.api.ServiceException
Returns a reference to the time service used to provide time information and time notification services.

Specified by:
getTimeService in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
ITimeService the time service reference
Throws:
gov.nasa.ci.corba.api.ServiceException - if there was an error obtaining the service

getLoggingService

public gov.nasa.ci.corba.api.logging.ILoggingService getLoggingService()
                                                                throws gov.nasa.ci.corba.api.ServiceException
Returns a reference to the logging service used to log debug, informational, warning, error and fatal messages reported by the actor.

Specified by:
getLoggingService in interface gov.nasa.arc.brahms.vm.ci.ICIActor
Returns:
ILoggingService the logging service reference
Throws:
gov.nasa.ci.corba.api.ServiceException - if there was an error obtaining the service

createContext

public IConceptCtx createContext()
Creates a new context for this concept for use in a virtual machine.

Note: This method always returns a new instance and does not verify whether one is already created.

Overrides:
createContext in class ObjectInstance
Returns:
IConceptCtx the concept's context

getIsInstanceOfRelation

protected Relation getIsInstanceOfRelation()
Returns the isInstanceOf relation as defined by BaseClass.

Returns:
Relation the isInstanceOf relation

getInitialFacts

public java.util.Enumeration getInitialFacts(boolean includeParents)
Returns the object's initial facts. If the includeParents flag is false it excludes the initial facts defined for its parent classes or superclasses. If the flag is true it includes the initial facts defined for its parent classes or superclasses. This list includes the engine generated facts specifiying the parent classes of the agent.

Overrides:
getInitialFacts in class ActiveConcept
Parameters:
includeParents - true if also the initial facts of its parent classes and superclasses are to be included, false otherwise
Returns:
Enumeration a list of all the object's initial facts

equals

public boolean equals(java.lang.Object obj)
Tests whether two VMObjectInstances are equal. The VM maintains a single instance of any VMObjectInstance with a given FQN in its static model, so the equality check can be reduced to an identity check

Overrides:
equals in class Concept
Parameters:
obj - the Object to be compared for equality
Returns:
true if the two VMObjectInstances are equal, false otherwise


Copyright © 1997-2012 All Rights Reserved.