26: Using Places
- A place is a process that remains in one location on a single engine.
- Kinds of places
- An engine place is the place with the largest scope: it runs on a single Telescript engine and contains all other places running on that engine.
- All places within an engine place are virtual places.
- Larger locational entities
- A region is one or more engine places that run under the same authority.
- Each engine place in a region has a finder that knows the location of all the other engine places in the region. This knowledge ties the engine places of a region together.
- A telesphere is a network of one or more Telescript regions. It is, in essence, the entire Telescript networking world.
- Place nesting
- All virtual places must reside within another place. The engine place sits at the top level.
- A virtual place may have other places residing within itself.
- One place located within a second place is a subplace of the second place; the second place is the superplace of the first place.
- Place location
- Every place has a read-only address attribute that stores a teleaddress for the place.
- A teleaddress specifies the place's location and can be used to direct an agent to the place.
- A teleaddress contains three attributes
- authority, which contains the authority that created the place. This is the same type of authority used in the place's telename; it's assigned administratively
- location, a unique and assigned octet string that identifies a unique location for this place. If the place is not unique (that is, it shares the same location as its superplace), this attribute is a nil. Location may be assigned administratively or programatically.
- routingAdvice, a list of octet strings that denote regions (each region is denoted by its authority) that can route an agent to the location, put in order of decreasing preference.
- A place whose teleaddress has no location is located in its superplace's location. This allows a place and its subplaces to occupy the same location.
- A place whose teleaddress has a location is advertised. Its location is different than that of its superplace.
- All engine places are advertised.
- Every region maintains a specialized database called the finder.
- The finder contains information about the region's advertised places.
- Once an agent reaches a location's region, it can present a teleaddress to the finder. The finder can read the teleaddress and direct the agent to whatever of its advertised locations fits the teleaddress.
- Occupying a place
- A place may be occupied by other places and agents--or not occupied at all.
- Each process in the place is an occupant of the place.
- The engine allows references between a place and its occupants and references between occupants and their place of occupancy. This means that a place may call operations on its occupants and vice versa.
- As agents enter and exit a place, the number of the place's occupants changes.
- The place's contacts attribute is a list of the unprotected references to the place's occupants. The engine updates this list as processes enter and exit the place.
- Entering a place
- A process can enter a place in these ways:
- The place can instantiate the process.
- An agent occupying the place can instantiate the process.
- An agent can arrive as the result of a trip.
- Every place has an entering operation.
- The engine calls a place's entering operation whenever a process enters the place.
- The entering operation is a sponsored operation (discussed later), so it runs under the authority of the place.
- The engine passes as arguments the telename, class, permit and--optionally--the ticket (if an arriving agent) of the entering process.
- The entering operation can allow or deny occupancy depending on the arguments.
- If occupancy is allowed, the process occupies the place. The entering operation returns an object (whatever it wishes) that the engine stores as a record of the occupant. The engine updates the place's contacts attribute to include a reference to the new occupant.
- If occupancy is denied, the process throws an exception that states the denial.
- The entering operation may reset entering process's local permit if desired.
- Recording occupants
- Whenever an occupant successfully enters a place, the entering operation returns an object that the engine stores as a record of the occupant.
- The place can modify that record from time to time to keep track of its state of interaction with the occupant.
- The "who" op on any process returns its record so that the record can be read or changed.
- Exiting a place
- A process exits a place in these ways:
- The process finishes its live operation and dies.
- The process exhausts its permit (exceeds its age or other resources) and is killed.
- The process violates its permit and is terminated.
- An agent departs on a trip.
- When a process exits a place, the engine sends a signal to the place containing an ExitEvent object. (Events and signals are a multicast communication mechanism discussed in a later chapter.)
- The engine removes the reference to the exiting process from the place's contacts attribute.
- The occupant record is part of contacts, a dictionary mapping a process to its occupant record
TS Ref - 26 JUN 1996
Generated by the sweat of Mike Boom's brow.