com.ibm.aglets
Class RemoteAgletRef

java.lang.Object
  extended bycom.ibm.awb.weakref.WeakRef
      extended bycom.ibm.aglets.RemoteAgletRef
All Implemented Interfaces:
AgletRef, Ref

public final class RemoteAgletRef
extends WeakRef
implements AgletRef

Version:
1.00 $Date: 2001/07/28 06:32:11 $
Author:
Mitsuru Oshima, ONO Kouichi

Nested Class Summary
(package private) static class RemoteAgletRef.RefKey
           
(package private) static class RemoteAgletRef.RemoteRefTable
           
 
Field Summary
(package private) static Message _get_info_message
           
private  AgletInfo _info
           
private  Name _name
           
private static RemoteAgletRef.RemoteRefTable _table
           
private  Ticket _ticket
           
 
Fields inherited from class com.ibm.awb.weakref.WeakRef
 
Constructor Summary
  RemoteAgletRef()
           
(package private) RemoteAgletRef(Ticket t, Name n)
           
 
Method Summary
 void activate()
          Activate the aglet
 void checkValidation()
           
 void delegateMessage(Message msg)
          Delegates a message
protected  Ref findRef()
           
protected  Ref findRef(java.io.ObjectInputStream s)
           
 java.lang.String getAddress()
          Gets the address of the target aglet
 Aglet getAglet()
          Gets the aglet.
 AgletInfo getAgletInfo()
          Gets the information of the aglet
static RemoteAgletRef getAgletRef(Ticket ticket, Name n)
           
private  void getInfo()
           
 java.lang.String getRefClassName()
           
protected  java.lang.Object getRefID()
           
(package private) static java.lang.Object getRefID(java.net.URL address, Name n)
           
 boolean isActive()
          Checks if it's active.
 boolean isRemote()
          Checks if it's valid.
 boolean isState(int s)
          Check the state
 boolean isValid()
          Checks if it's valid.
 void resume()
          Resume the aglet
 FutureReply sendFutureMessage(Message msg)
          Sends a message in asynchronous way.
 java.lang.Object sendMessage(Message msg)
          Sends a message in synchronous way.
 void sendOnewayMessage(Message msg)
          Sends a oneway message
(package private)  void setAgletInfo(AgletInfo i)
          set info
static void showRefTable(java.io.PrintStream out)
           
 java.lang.String toString()
           
 void writeInfo(java.io.ObjectOutputStream s)
           
 
Methods inherited from class com.ibm.awb.weakref.WeakRef
getRef, referenced, setRef, unreferenced, updateRef
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.awb.weakref.Ref
getRef, referenced, setRef, unreferenced
 

Field Detail

_table

private static RemoteAgletRef.RemoteRefTable _table

_ticket

private Ticket _ticket

_info

private AgletInfo _info

_name

private Name _name

_get_info_message

static Message _get_info_message
Constructor Detail

RemoteAgletRef

public RemoteAgletRef()

RemoteAgletRef

RemoteAgletRef(Ticket t,
               Name n)
Method Detail

activate

public void activate()
              throws java.io.IOException,
                     AgletException
Description copied from interface: AgletRef
Activate the aglet

Specified by:
activate in interface AgletRef
Throws:
java.io.IOException
AgletException

checkValidation

public void checkValidation()
                     throws InvalidAgletException
Specified by:
checkValidation in interface AgletRef
Throws:
InvalidAgletException

delegateMessage

public void delegateMessage(Message msg)
                     throws InvalidAgletException
Delegates a message

Specified by:
delegateMessage in interface AgletRef
Throws:
InvalidAgletException

findRef

protected Ref findRef()
Specified by:
findRef in class WeakRef

findRef

protected Ref findRef(java.io.ObjectInputStream s)
               throws java.io.IOException,
                      java.lang.ClassNotFoundException
Specified by:
findRef in class WeakRef
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getAddress

public java.lang.String getAddress()
                            throws InvalidAgletException
Gets the address of the target aglet

Specified by:
getAddress in interface AgletRef
Returns:
the address
Throws:
InvalidAgletException

getAglet

public Aglet getAglet()
               throws InvalidAgletException
Gets the aglet. If the aglet is access protected it will require the right key to get access.

Specified by:
getAglet in interface AgletRef
Returns:
the aglet
Throws:
java.lang.SecurityException - if the current execution is not allowed.
InvalidAgletException

getAgletInfo

public AgletInfo getAgletInfo()
Gets the information of the aglet

Specified by:
getAgletInfo in interface AgletRef
Returns:
the AgletInfo of the aglet

getAgletRef

public static RemoteAgletRef getAgletRef(Ticket ticket,
                                         Name n)

getInfo

private void getInfo()
              throws InvalidAgletException
Throws:
InvalidAgletException

getRefClassName

public java.lang.String getRefClassName()
Specified by:
getRefClassName in interface Ref

getRefID

protected java.lang.Object getRefID()
Specified by:
getRefID in class WeakRef

getRefID

static java.lang.Object getRefID(java.net.URL address,
                                 Name n)

isActive

public boolean isActive()
Description copied from interface: AgletRef
Checks if it's active.

Specified by:
isActive in interface AgletRef

isRemote

public boolean isRemote()
Description copied from interface: AgletRef
Checks if it's valid.

Specified by:
isRemote in interface AgletRef

isState

public boolean isState(int s)
Check the state

Specified by:
isState in interface AgletRef

isValid

public boolean isValid()
Description copied from interface: AgletRef
Checks if it's valid.

Specified by:
isValid in interface AgletRef

resume

public void resume()
            throws AgletException
Description copied from interface: AgletRef
Resume the aglet

Specified by:
resume in interface AgletRef
Throws:
AgletException

sendFutureMessage

public FutureReply sendFutureMessage(Message msg)
                              throws InvalidAgletException
Sends a message in asynchronous way.

Specified by:
sendFutureMessage in interface AgletRef
Parameters:
msg - the message to send
Throws:
InvalidAgletException

sendMessage

public java.lang.Object sendMessage(Message msg)
                             throws MessageException,
                                    InvalidAgletException,
                                    NotHandledException
Sends a message in synchronous way.

Specified by:
sendMessage in interface AgletRef
Parameters:
msg - the message to send
Throws:
MessageException
InvalidAgletException
NotHandledException

sendOnewayMessage

public void sendOnewayMessage(Message msg)
                       throws InvalidAgletException
Sends a oneway message

Specified by:
sendOnewayMessage in interface AgletRef
Parameters:
msg - the message to send
Throws:
InvalidAgletException

setAgletInfo

void setAgletInfo(AgletInfo i)
set info


showRefTable

public static void showRefTable(java.io.PrintStream out)

toString

public java.lang.String toString()
Overrides:
toString in class WeakRef

writeInfo

public void writeInfo(java.io.ObjectOutputStream s)
               throws java.io.IOException
Specified by:
writeInfo in interface Ref
Throws:
java.io.IOException