Bees v0.5.0 API

bees.core.resource
Class NodeOSNeighbor

java.lang.Object
  |
  +--bees.core.Capability
        |
        +--bees.core.NeighborImpl
              |
              +--bees.core.resource.NodeOSNeighbor
All Implemented Interfaces:
edu.utah.janosvm.kit.comm.jsi.JSIHandler

public final class NodeOSNeighbor
extends NeighborImpl
implements edu.utah.janosvm.kit.comm.jsi.JSIHandler

A neighbor implementation that uses NodeOS in/out channels.


Field Summary
static PermissionSet DEFAULT_PERMISSIONS
          Default permissions for a newly created NodeOSNeighbor object.
static Permission INCOMING_ADDRESS_SPEC__READ_PERMISSION
          Permission to read the incoming address spec.
static Permission INCOMING_PROTOCOL_SPEC__READ_PERMISSION
          Permission to read the incoming protocol spec.
static Permission OUTGOING_ADDRESS_SPEC__READ_PERMISSION
          Permission to read the outgoing address spec.
static Permission OUTGOING_PROTOCOL_SPEC__READ_PERMISSION
          Permission to read the outgoing protocol spec.
 
Fields inherited from class bees.core.NeighborImpl
CAPSULE__READ_PERMISSION, CAPSULE__WRITE_PERMISSION
 
Fields inherited from class bees.core.Capability
DELETE_PERMISSION, id, INVALID_ID
 
Constructor Summary
NodeOSNeighbor()
          Construct an empty NodeOSNeighbor object.
 
Method Summary
protected  void cancelReceivers(Neighbor neighbor, TypeID capsuleTypeID)
          Call back to be implemented by the class that will receive Capsules.
protected  void dequeueKey()
           
protected  void enqueueKey(java.security.Key sk, java.lang.String algorithm)
          Call back to be implemented by the class that will send and receive Capsules.
protected  void fromBytes(byte[] flattened)
          Bind this capability to the given object.
 TypeID getFingerPrint()
           
 java.lang.String getIncomingAddressSpec()
           
 java.lang.String getIncomingProtocolSpec()
           
 java.lang.String getInterfaceName()
           
 java.lang.String getOutgoingAddressSpec()
           
 java.lang.String getOutgoingProtocolSpec()
           
 void getSuites(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
           
 void handleMessage(edu.utah.janosvm.kit.comm.jsi.JSIHandlerContext jhc, edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
           
protected  void receiveBuffer(CapsuleReceiver cr)
          Call back to be implemented by the class that will receive Capsules.
 edu.utah.janosvm.kit.comm.jsi.JSIHandler resolveSpecifier(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm, edu.utah.janosvm.kit.comm.jsi.JSIPair jp)
           
 void revoke()
          Revoke access to the capability.
 void revokedPermission(Permission what)
          Callback...
protected  void sendBuffer(edu.utah.janos.nodeos.BufferHandle bh)
          Call back to be implemented by the class that will send Capsules.
protected  void setKey(java.security.Key sk, java.lang.String algorithm)
           
 java.lang.String toString()
           
 java.lang.String toVerboseString()
           
 
Methods inherited from class bees.core.NeighborImpl
getNeighbor, getNeighbor
 
Methods inherited from class bees.core.Capability
checkPermission, clear, clonePermission, deleteCapability, equals, fromBytes, revokePermission, revokePermissions, valid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INCOMING_PROTOCOL_SPEC__READ_PERMISSION

public static final Permission INCOMING_PROTOCOL_SPEC__READ_PERMISSION
Permission to read the incoming protocol spec.

INCOMING_ADDRESS_SPEC__READ_PERMISSION

public static final Permission INCOMING_ADDRESS_SPEC__READ_PERMISSION
Permission to read the incoming address spec.

OUTGOING_PROTOCOL_SPEC__READ_PERMISSION

public static final Permission OUTGOING_PROTOCOL_SPEC__READ_PERMISSION
Permission to read the outgoing protocol spec.

OUTGOING_ADDRESS_SPEC__READ_PERMISSION

public static final Permission OUTGOING_ADDRESS_SPEC__READ_PERMISSION
Permission to read the outgoing address spec.

DEFAULT_PERMISSIONS

public static final PermissionSet DEFAULT_PERMISSIONS
Default permissions for a newly created NodeOSNeighbor object.
Constructor Detail

NodeOSNeighbor

public NodeOSNeighbor()
Construct an empty NodeOSNeighbor object.
Method Detail

getIncomingProtocolSpec

public java.lang.String getIncomingProtocolSpec()
Returns:
The protocol spec for the InChannel.
Throws:
PermissionException - if the capability doesn't have read permission.

getIncomingAddressSpec

public java.lang.String getIncomingAddressSpec()
Returns:
The address spec for the InChannel.
Throws:
PermissionException - if the capability doesn't have read permission.

getOutgoingProtocolSpec

public java.lang.String getOutgoingProtocolSpec()
Returns:
The protocol spec for the OutChannel.
Throws:
PermissionException - if the capability doesn't have read permission.

getOutgoingAddressSpec

public java.lang.String getOutgoingAddressSpec()
Returns:
The address spec for the OutChannel.
Throws:
PermissionException - if the capability doesn't have read permission.

fromBytes

protected void fromBytes(byte[] flattened)
                  throws java.lang.Exception
Description copied from class: Capability
Bind this capability to the given object.
Overrides:
fromBytes in class Capability
See Also:
Capability.fromBytes(byte[])

revokedPermission

public void revokedPermission(Permission what)
Description copied from class: Capability
Callback... XXX Implement me.
Overrides:
revokedPermission in class Capability
See Also:
Capability.revokedPermission(Permission)

revoke

public void revoke()
Description copied from class: Capability
Revoke access to the capability.
Overrides:
revoke in class Capability
See Also:
Capability.revoke()

receiveBuffer

protected void receiveBuffer(CapsuleReceiver cr)
                      throws java.io.IOException
Description copied from class: NeighborImpl
Call back to be implemented by the class that will receive Capsules. This method is used to setup the connection between the implementation specific mechanism for receiving packets and the Bees mechanism for decoding and dispatching them.
Overrides:
receiveBuffer in class NeighborImpl
See Also:
NeighborImpl.receiveBuffer(CapsuleReceiver)

cancelReceivers

protected void cancelReceivers(Neighbor neighbor,
                               TypeID capsuleTypeID)
Description copied from class: NeighborImpl
Call back to be implemented by the class that will receive Capsules. This method is used to tear down the implementation specific receiver for the given Capsule type.
Overrides:
cancelReceivers in class NeighborImpl
See Also:
NeighborImpl.cancelReceivers(Neighbor, TypeID)

sendBuffer

protected void sendBuffer(edu.utah.janos.nodeos.BufferHandle bh)
                   throws java.io.IOException
Description copied from class: NeighborImpl
Call back to be implemented by the class that will send Capsules. This method is used to transmit an encoded buffer to the neighbor.
Overrides:
sendBuffer in class NeighborImpl
See Also:
NeighborImpl.sendBuffer(BufferHandle)

setKey

protected void setKey(java.security.Key sk,
                      java.lang.String algorithm)
               throws java.security.NoSuchAlgorithmException,
                      java.security.InvalidKeyException
Overrides:
setKey in class NeighborImpl

enqueueKey

protected void enqueueKey(java.security.Key sk,
                          java.lang.String algorithm)
                   throws java.security.NoSuchAlgorithmException,
                          java.security.InvalidKeyException
Description copied from class: NeighborImpl
Call back to be implemented by the class that will send and receive Capsules.
Overrides:
enqueueKey in class NeighborImpl
Following copied from class: bees.core.NeighborImpl
Parameters:
cr - The class that will receive and dispatch a type Capsule.
sk - The SecretKey to use when computing/verifying a MAC.
algorithm - The MAC algorithm to use.
Throws:
java.security.NoSuchAlgorithmException - if the MAC algorithm is not known.
java.security.InvalidKeyException - if the key is invalid.

dequeueKey

protected void dequeueKey()
Overrides:
dequeueKey in class NeighborImpl

getInterfaceName

public java.lang.String getInterfaceName()
Overrides:
getInterfaceName in class NeighborImpl
See Also:
NeighborImpl.getInterfaceName()

getFingerPrint

public TypeID getFingerPrint()
Overrides:
getFingerPrint in class NeighborImpl
See Also:
NeighborImpl.getFingerPrint()

resolveSpecifier

public edu.utah.janosvm.kit.comm.jsi.JSIHandler resolveSpecifier(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm,
                                                                 edu.utah.janosvm.kit.comm.jsi.JSIPair jp)
Specified by:
resolveSpecifier in interface edu.utah.janosvm.kit.comm.jsi.JSIHandler
See Also:
JSIHandler.resolveSpecifier(JSIMessage, JSIPair)

handleMessage

public void handleMessage(edu.utah.janosvm.kit.comm.jsi.JSIHandlerContext jhc,
                          edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
Specified by:
handleMessage in interface edu.utah.janosvm.kit.comm.jsi.JSIHandler
See Also:
JSIHandler.handleMessage(JSIHandlerContext, JSIMessage)

getSuites

public void getSuites(edu.utah.janosvm.kit.comm.jsi.JSIMessage jm)
Specified by:
getSuites in interface edu.utah.janosvm.kit.comm.jsi.JSIHandler
See Also:
JSIHandler.getSuites(JSIMessage)

toVerboseString

public java.lang.String toVerboseString()
Returns:
A more verbose description of this neighbor object.

toString

public java.lang.String toString()
Overrides:
toString in class NeighborImpl
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/