orca.shirako.proxies.local
Class LocalProxy

java.lang.Object
  extended by orca.shirako.proxies.Proxy
      extended by orca.shirako.proxies.local.LocalProxy
All Implemented Interfaces:
IActorIdentity, IProxy, ISerialize
Direct Known Subclasses:
LocalBroker, LocalReturn

public class LocalProxy
extends Proxy

Acts as a proxy or skeleton for a local actor, e.g., instances of LocalProxy carry all cross-actor calls when the client and server are co-located (running in the same JVM). Most of the heavy lifting is in subclasses: LocalAuthority, LocalAgent, and LocalReturn.

The subclasses perform some destination-specific translations, e.g., to the reservation type. They also must pass arguments by copy rather by reference. We are fast and loose in a few cases where we know that the caller doesn't modify an argument or that the destination won't keep it.

LocalProxy and its descendants have no caller-specific state and therefore may be passed by reference.


Field Summary
protected  AuthToken actorAuth
           
protected  java.lang.String actorName
          The actor which this proxy represents.
protected  LoggingTool logger
          The logger
static java.lang.String PropertyLocalProxyActorName
          Serialization property: the name of the local actor
 
Fields inherited from class orca.shirako.proxies.Proxy
callback, PropertyProxyActorName, PropertyProxyCallback, PropertyProxyClass, PropertyProxyType, proxyType
 
Fields inherited from interface orca.shirako.api.IProxy
ProxyTypeLocal, ProxyTypeSoap
 
Constructor Summary
LocalProxy()
           
LocalProxy(IActor actor)
          Creates a new proxy representing the specified actor
 
Method Summary
 IActor getActor()
          Returns the actor represented by this proxy
protected  IConcreteSetFactory getFactory()
           
 AuthToken getIdentity()
          Returns the identity of the actor.
 java.lang.String getName()
          Returns the actor name.
 java.util.Properties query(java.util.Properties properties, AuthToken caller)
          
 void reset(java.util.Properties p)
          Restores the proxy state from the specified properties list
 void save(java.util.Properties p)
          Serializes the proxy to a properties list
 
Methods inherited from class orca.shirako.proxies.Proxy
abstractCloneAuthority, abstractCloneBroker, abstractCloneReturn, getGuid, getPlugin, getProxy, getType, recoverProxy, save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PropertyLocalProxyActorName

public static final java.lang.String PropertyLocalProxyActorName
Serialization property: the name of the local actor

See Also:
Constant Field Values

actorName

protected java.lang.String actorName
The actor which this proxy represents. Note: here we used to have the actual actor object. However, since we can start/stop actors, we cannot keep the actual actor object. Instead, we keep the name and make a lookup. See getActor().


actorAuth

protected AuthToken actorAuth

logger

protected LoggingTool logger
The logger

Constructor Detail

LocalProxy

public LocalProxy()

LocalProxy

public LocalProxy(IActor actor)
Creates a new proxy representing the specified actor

Parameters:
actor - The actor object to be represented by this proxy
Method Detail

query

public java.util.Properties query(java.util.Properties properties,
                                  AuthToken caller)
                           throws java.lang.Exception

Overrides:
query in class Proxy
Throws:
java.lang.Exception

getFactory

protected IConcreteSetFactory getFactory()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

save

public void save(java.util.Properties p)
          throws java.lang.Exception
Serializes the proxy to a properties list

Specified by:
save in interface ISerialize
Overrides:
save in class Proxy
Parameters:
p - The output properties list
Throws:
java.lang.Exception

reset

public void reset(java.util.Properties p)
           throws java.lang.Exception
Restores the proxy state from the specified properties list

Specified by:
reset in interface ISerialize
Overrides:
reset in class Proxy
Parameters:
p - properties list containing the serialized version of the object
Throws:
java.lang.Exception

getIdentity

public AuthToken getIdentity()
Returns the identity of the actor.

Specified by:
getIdentity in interface IActorIdentity
Overrides:
getIdentity in class Proxy
Returns:
the actor's identity

getName

public java.lang.String getName()
Returns the actor name.

Specified by:
getName in interface IActorIdentity
Overrides:
getName in class Proxy
Returns:
the actor name. Note that actor names are expected to be unique.

getActor

public IActor getActor()
Returns the actor represented by this proxy

Returns:


Copyright © 2007 Network/Internet Computing Lab. All Rights Reserved.