10.8. File too/Proxy

class tom.State (Proxy)

This extension of State only provides the isProxy method, which allows one to discern between proxy and non-proxy objects.

instance tom.State (Proxy)

methods


boolean
  isProxy;

Undocumented.


State
  replacementForPortCoder PortEncoder coder;

Return the object to be encoded by the coder instead of the receiving object. This method is repeatedly invoked until an object returns self. The default implementation retrieves a proxy from the coder's connection.

class too.Proxy

inherits

State supers: State

instance too.Proxy

variables

Connection connection;

The Connection to which we belong.

int identity;

Our identity with our connection.

methods


id
  initWithConnection Connection c
            identity int ident;

Undocumented.


Connection
  proxy_connection;

Undocumented.


int
  proxy_identity;

Undocumented.


State
  replacementForPortCoder PortEncoder coder;

Return self, since we know how to be sent over the wire.


void
  encodeUsingCoder Encoder coder;

Have the coder encode us as a proxy; otherwise fail (which is the case when archiving instead of wiring).

class too.LocalProxy

inherits

State supers: Proxy

instance too.LocalProxy

variables

public Any original;

The object for which we stand.

methods


id
  initWithConnection Connection c
            identity int i
                 for All object;

Designated initializer.

class too.RemoteProxy

inherits

State supers: Proxy

instance too.RemoteProxy

variables

redeclare ConnectedConnection connection;

Our connection is connected.

methods


boolean
  isProxy;

Undocumented.


InvocationResult
  forwardSelector selector sel
        arguments pointer args;

The low-level forwarding method. This method is invoked for forwarding a invocation completing method and this is used by the Proxy.


void
  dealloc;

Inform our connection from our death. This messages the Connection class, since messaging objects from dealloc methods is not allowed. We identify ourselves by our identity since passing around a dead object (which we are) is asking for trouble.

class too.NonProxy

Instances of (subclasses of) NonProxy are never proxies. They always send a copy over the wire.

inherits

State supers: State

instance too.NonProxy

methods


id (self)
  replacementForPortCoder PortEncoder c;

Return self as we do not want to be proxied.

class tom.Number (Proxy)

inherits

State supers: NonProxy

instance tom.Number (Proxy)

class tom.Invocation (Proxy)

inherits

State supers: NonProxy

instance tom.Invocation (Proxy)

class tom.InvocationResult (Proxy)

inherits

State supers: NonProxy

instance tom.InvocationResult (Proxy)

class tom.Selector (Proxy)

inherits

State supers: NonProxy

instance tom.Selector (Proxy)

class tom.Collection (Proxy)

inherits

State supers: NonProxy

instance tom.Collection (Proxy)

class tom.MutableCollection (Proxy)

inherits

State supers: State

instance tom.MutableCollection (Proxy)

methods


id
  replacementForPortCoder PortEncoder c;

This is naughty: a Collection, through its inheritance of NonProxy returns self when asked its replacementForPortCoder. However, a MutableCollection must be proxied for maintaining the right semantics. Hence, we redirect the method to our direct (though repeated) superclass, State.