Bees v0.5.0 API

bees.core
Class CapabilityEnvelope

java.lang.Object
  |
  +--bees.core.CapabilityEnvelope
All Implemented Interfaces:
java.lang.Cloneable, edu.utah.janosvm.sys.CrossTeamCloneable

public final class CapabilityEnvelope
extends java.lang.Object
implements java.lang.Cloneable, edu.utah.janosvm.sys.CrossTeamCloneable

Container class used to transmit capabilities between domains. Passing an envelope to another Domain will introduce it to that domain, if it did not previously have the Capability. If the domain already had the Capability then any extra permissions in the envelope will be granted to the Capability in the domain.

See Also:
Capability, CapabilityReference, PermissionSet

Constructor Summary
CapabilityEnvelope(Capability cap)
          Construct a CapabilityEnvelope enclosing the given capability.
CapabilityEnvelope(CapabilityEnvelope ce)
          Construct a copy of the given CapabilityEnvelope with an anonymous name.
CapabilityEnvelope(java.lang.String name, Capability cap)
          Construct a CapabilityEnvelope enclosing the given capability and mapped to the given name.
CapabilityEnvelope(java.lang.String name, CapabilityEnvelope ce)
          Construct a copy of the given CapabilityEnvelope with a new name.
 
Method Summary
 CapabilityEnvelope boundPermissions(PermissionSet ps)
          Bound the enclosed capabilities to the given set.
 java.lang.Object clone()
           
static CapabilityEnvelope find(CapabilityEnvelope[] ce, java.lang.String name)
          Find a CapabilityEnvelope with the given name in the given array.
 java.lang.String getName()
           
 KernelObjectCoroutine lookup(StateResponder sr)
          Send a lookup event for the enclosed capability.
 KernelObjectCoroutine lookup(Unsealer unsealer, StateResponder sr)
           
 CapabilityEnvelope revokePermissions(PermissionSet ps)
          Revoke some permissions from the enclosed capability.
 CapabilityEnvelope seal(Sealer sealer)
           
 java.lang.String toString()
           
 Capability unseal()
          Unseal the envelope to get the enclosed capability.
 Capability unseal(KernelObjectCoroutine koc)
          Unseal the capability returned by a lookup reply.
 Capability unseal(Unsealer unsealer)
           
static void updateHash(KernelObjectStore kos, CapabilityEnvelope[] ce, bees.util.MD5 digest)
           
 void updateHash(KernelObjectStore kos, bees.util.MD5 digest)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CapabilityEnvelope

public CapabilityEnvelope(java.lang.String name,
                          Capability cap)
Construct a CapabilityEnvelope enclosing the given capability and mapped to the given name.
Parameters:
name - The domain local name this capability should be registered under or null.
cap - The capability to enclose.

CapabilityEnvelope

public CapabilityEnvelope(Capability cap)
Construct a CapabilityEnvelope enclosing the given capability.
Parameters:
cap - The capability to enclose.

CapabilityEnvelope

public CapabilityEnvelope(java.lang.String name,
                          CapabilityEnvelope ce)
Construct a copy of the given CapabilityEnvelope with a new name.
Parameters:
name - The new envelope name.
ce - The CapabilityEnvelope to copy.

CapabilityEnvelope

public CapabilityEnvelope(CapabilityEnvelope ce)
Construct a copy of the given CapabilityEnvelope with an anonymous name.
Parameters:
ce - The CapabilityEnvelope to copy.
Method Detail

find

public static CapabilityEnvelope find(CapabilityEnvelope[] ce,
                                      java.lang.String name)
Find a CapabilityEnvelope with the given name in the given array.
Parameters:
ce - The array of envelopes to search.
name - The envelope name to retrieve.
Returns:
The first CapabilityEnvelope that matches the given name or null if it couldn't be found.

updateHash

public static void updateHash(KernelObjectStore kos,
                              CapabilityEnvelope[] ce,
                              bees.util.MD5 digest)

getName

public java.lang.String getName()
Returns:
The local name of the capability.

revokePermissions

public CapabilityEnvelope revokePermissions(PermissionSet ps)
Revoke some permissions from the enclosed capability.
Parameters:
ps - The set of permissions to revoke.
Returns:
this

boundPermissions

public CapabilityEnvelope boundPermissions(PermissionSet ps)
Bound the enclosed capabilities to the given set.
Parameters:
ps - The set of permissions to bound the permissions by.
Returns:
this

seal

public CapabilityEnvelope seal(Sealer sealer)

lookup

public KernelObjectCoroutine lookup(Unsealer unsealer,
                                    StateResponder sr)

lookup

public KernelObjectCoroutine lookup(StateResponder sr)
Send a lookup event for the enclosed capability.
Parameters:
sr - The object to use when handling the coroutine state transitions.
Returns:
The KernelObjectCoroutine created to handle the messages.

unseal

public Capability unseal(KernelObjectCoroutine koc)
                  throws MissingCapabilityException
Unseal the capability returned by a lookup reply.
Parameters:
koc - The coroutine that performed the lookup.
Returns:
The referenced capability.
Throws:
MissingCapabilityException - if the referenced capability has been deleted.

unseal

public Capability unseal(Unsealer unsealer)
                  throws MissingCapabilityException,
                         java.lang.InstantiationException

unseal

public Capability unseal()
                  throws MissingCapabilityException,
                         java.lang.InstantiationException
Unseal the envelope to get the enclosed capability.
Returns:
The enclosed capability.
Throws:
java.lang.InstantiationException - if there was a problem creating the capability.
MissingCapabilityException - if the referenced capability has been deleted.

updateHash

public void updateHash(KernelObjectStore kos,
                       bees.util.MD5 digest)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
See Also:
Object.clone()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Bees v0.5.0 API

This documentation is Copyright (C) 2002 The University of Utah. All Rights Reserved. See the individual source files for distribution terms.
Documentation, software, and mailing lists for Bees v0.5.0 can be found at the Janos Project: http://www.cs.utah.edu/flux/janos/