orca.shirako.proxies
Class Proxy

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

public class Proxy
extends java.lang.Object
implements IProxy

The Proxy class represents a stub to a shirako actor. In shirako all inter-actor communication happens with the help of proxies. Proxies define a general interface, which is implementation independent and enables easy implementation of new communication protocols.


Field Summary
protected  boolean callback
          True if this proxy is used as a callback, false otherwise.
static java.lang.String PropertyProxyActorName
          Serialization property: the name of the actor represented by this proxy.
static java.lang.String PropertyProxyCallback
          Serialization property: true, if this is a callback proxy.
static java.lang.String PropertyProxyClass
          Serialization property: java class implementing this proxy.
static java.lang.String PropertyProxyType
          Serialization property: the type of this proxy: local, soap, xmlrpc, etc.
protected  java.lang.String proxyType
          Type of the proxy: local, soap, xmlrpc, etc...
 
Fields inherited from interface orca.shirako.api.IProxy
ProxyTypeLocal, ProxyTypeSoap
 
Constructor Summary
Proxy()
           
 
Method Summary
protected  ResourceSet abstractCloneAuthority(ResourceSet set)
          Clones the resource set, but without any of the concrete sets.
protected  ResourceSet abstractCloneBroker(ResourceSet set)
          Clones the resource set, but without any of the concrete sets.
 ResourceSet abstractCloneReturn(ResourceSet set)
          Clones the resource set, but without any of the concrete sets.
 ID getGuid()
          Returns the globally unique identifier of this actor.
 AuthToken getIdentity()
          Returns the identity of the actor.
 java.lang.String getName()
          Returns the actor name.
protected  IShirakoPlugin getPlugin(AuthToken caller)
          Returns the SlicesPlugin for the actor with the specified AuthToken
static IProxy getProxy(java.util.Properties p)
          Obtains a proxy object from the specified properties list.
 java.lang.String getType()
          Returns the type of this proxy
 java.util.Properties query(java.util.Properties properties, AuthToken caller)
           
static Proxy recoverProxy(java.util.Properties p, boolean register)
          Creates a proxy list from a properties list representing the serialization of the proxy.
 void reset(java.util.Properties p)
          Restores the proxy state from the specified properties list
 java.util.Properties save()
          Serializes the proxy to a properties list
 void save(java.util.Properties p)
          Serializes the proxy to a properties list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PropertyProxyType

public static final java.lang.String PropertyProxyType
Serialization property: the type of this proxy: local, soap, xmlrpc, etc.

See Also:
Constant Field Values

PropertyProxyActorName

public static final java.lang.String PropertyProxyActorName
Serialization property: the name of the actor represented by this proxy.

See Also:
Constant Field Values

PropertyProxyCallback

public static final java.lang.String PropertyProxyCallback
Serialization property: true, if this is a callback proxy.

See Also:
Constant Field Values

PropertyProxyClass

public static final java.lang.String PropertyProxyClass
Serialization property: java class implementing this proxy.

See Also:
Constant Field Values

proxyType

protected java.lang.String proxyType
Type of the proxy: local, soap, xmlrpc, etc...


callback

protected boolean callback
True if this proxy is used as a callback, false otherwise.

Constructor Detail

Proxy

public Proxy()
Method Detail

recoverProxy

public static Proxy recoverProxy(java.util.Properties p,
                                 boolean register)
                          throws java.lang.Exception
Creates a proxy list from a properties list representing the serialization of the proxy. Optionally, the resulting object may be registered with the ActorRegistry so that it becomes visible to the rest of the system.

Parameters:
p - Properties list representing the proxy
register - If true, the resulting proxy is registered with the container's ActorRegistry
Returns:
Throws:
java.lang.Exception

getProxy

public static IProxy getProxy(java.util.Properties p)
                       throws java.lang.Exception
Obtains a proxy object from the specified properties list. If a suitable proxy object has already been created and registered with the ActorRegistry, the already existing object is returned and no new object is created. Otherwise, the method creates the proxy object and registers it with the ActorRegistry

Parameters:
p - Properties list representing the proxy
Returns:
Throws:
java.lang.Exception

getPlugin

protected IShirakoPlugin getPlugin(AuthToken caller)
                            throws java.lang.Exception
Returns the SlicesPlugin for the actor with the specified AuthToken

Parameters:
caller - AuthToken of the actor
Returns:
Throws:
java.lang.Exception

abstractCloneBroker

protected ResourceSet abstractCloneBroker(ResourceSet set)
Clones the resource set, but without any of the concrete sets. Preserves only the request properties. This method should be used when sending a request to a broker.

Returns:
a resources set that is a copy of the current but without any concrete sets.

abstractCloneAuthority

protected ResourceSet abstractCloneAuthority(ResourceSet set)
Clones the resource set, but without any of the concrete sets. Preserves only the configuration properties. This method should be used when sending a redeem/extend/close request to an authority.

Returns:
a resources set that is a copy of the current but without any concrete sets.

abstractCloneReturn

public ResourceSet abstractCloneReturn(ResourceSet set)
Clones the resource set, but without any of the concrete sets. Preserves only the resource properties. This method should be used when sending an update ticket/update lease.

Returns:
a resources set that is a copy of the current but without any concrete sets.

query

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

save

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

Specified by:
save in interface ISerialize
Returns:
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
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
Parameters:
p -
Throws:
java.lang.Exception

getType

public java.lang.String getType()
Returns the type of this proxy

Specified by:
getType in interface IProxy
Returns:

getName

public java.lang.String getName()
Description copied from interface: IActorIdentity
Returns the actor name.

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

getIdentity

public AuthToken getIdentity()
Description copied from interface: IActorIdentity
Returns the identity of the actor.

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

getGuid

public ID getGuid()
Description copied from interface: IActorIdentity
Returns the globally unique identifier of this actor.

Specified by:
getGuid in interface IActorIdentity
Returns:


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