Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

alice.tucson
Class User  view User download User.java

java.lang.Object
  extended byalice.tucson.User
All Implemented Interfaces:
TucsonInterface
Direct Known Subclasses:
Agent

public class User
extends java.lang.Object
implements TucsonInterface

Defines the basic TuCSoN user, capable of accessing the TuCSoN infrastructure It uses a generic tuplemedium TCP/IP user, providing a suitable interface tuned on TuCSoN specificity

Version:
1.0

Field Summary
protected static TupleCentreId defaultTid
           
protected  alice.tuplemedium.runtime.User user
           
 
Constructor Summary
User(AgentId id)
          Constructs the user specifying its identifier
User(java.lang.String name)
          Constructs the user specifying its name
 
Method Summary
 AgentId getId()
          Gets the identifier of the user
 alice.logictuple.LogicTuple getSpec()
          Gets the behaviour specification of the default tuple centre
 alice.logictuple.LogicTuple getSpec(TupleCentreId tid)
          Gets the behaviour specification of a specified tuple centre
 alice.logictuple.LogicTuple in(alice.logictuple.LogicTuple t)
          Gets (blocking) a matching logic tuples from the default tuple centre
 alice.logictuple.LogicTuple in(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Gets (blocking) a matching logic tuples from the specified tuple centre
 alice.logictuple.LogicTuple inp(alice.logictuple.LogicTuple t)
          Gets if present (without blocking) a matching logic tuples from the default tuple centre
 alice.logictuple.LogicTuple inp(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Gets if present (without blocking) a matching logic tuples from the specified tuple centre
 void out(alice.logictuple.LogicTuple t)
          Places (synchronously) a tuples on the default tuple centre
 void out(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Places (synchronously) a tuples on the specified tuple centre
 void outAsync(alice.logictuple.LogicTuple t)
          Places (asynchronously) a tuples on the default tuple centre
 void outAsync(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Places (asynchronously) a tuples on the specified tuple centre
 alice.logictuple.LogicTuple rd(alice.logictuple.LogicTuple t)
          Reads (blocking) a matching logic tuples from the default tuple centre
 alice.logictuple.LogicTuple rd(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Reads (blocking) a matching logic tuples from the specified tuple centre
 alice.logictuple.LogicTuple rdp(alice.logictuple.LogicTuple t)
          Reads if present (without blocking) a matching logic tuples from the default tuple centre
 alice.logictuple.LogicTuple rdp(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Reads if present (without blocking) a matching logic tuples from the specified tuple centre
 void setDaemonPort(int port)
          Specifies the port of the TuCSoN infrastructure If none specified, the default one is used.
 alice.logictuple.LogicTuple setSpec(alice.logictuple.LogicTuple t)
          Reads if present (without blocking) a matching logic tuples from the default tuple centre
 alice.logictuple.LogicTuple setSpec(TupleCentreId tid, alice.logictuple.LogicTuple t)
          Sets the behaviour specification of a specified tuple centre
 void shutdown()
          Shutdowns the user
private  alice.logictuple.LogicTuple unify(alice.tuplemedium.TupleTemplate template, alice.tuplemedium.Tuple tuple)
          Helper service, which unifies a tuple template and a tuple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

user

protected alice.tuplemedium.runtime.User user

defaultTid

protected static final TupleCentreId defaultTid
Constructor Detail

User

public User(AgentId id)
Constructs the user specifying its identifier


User

public User(java.lang.String name)
Constructs the user specifying its name

Method Detail

getId

public AgentId getId()
Gets the identifier of the user


setDaemonPort

public void setDaemonPort(int port)
Specifies the port of the TuCSoN infrastructure If none specified, the default one is used.


out

public void out(TupleCentreId tid,
                alice.logictuple.LogicTuple t)
         throws NoTucsonNodeException,
                TucsonIOException,
                alice.logictuple.InvalidLogicTupleException
Places (synchronously) a tuples on the specified tuple centre

Specified by:
out in interface TucsonInterface

outAsync

public void outAsync(TupleCentreId tid,
                     alice.logictuple.LogicTuple t)
              throws NoTucsonNodeException,
                     TucsonIOException,
                     alice.logictuple.InvalidLogicTupleException
Places (asynchronously) a tuples on the specified tuple centre

Specified by:
outAsync in interface TucsonInterface

in

public alice.logictuple.LogicTuple in(TupleCentreId tid,
                                      alice.logictuple.LogicTuple t)
                               throws NoTucsonNodeException,
                                      TucsonIOException,
                                      alice.logictuple.InvalidLogicTupleException
Gets (blocking) a matching logic tuples from the specified tuple centre

Specified by:
in in interface TucsonInterface

rd

public alice.logictuple.LogicTuple rd(TupleCentreId tid,
                                      alice.logictuple.LogicTuple t)
                               throws NoTucsonNodeException,
                                      TucsonIOException,
                                      alice.logictuple.InvalidLogicTupleException
Reads (blocking) a matching logic tuples from the specified tuple centre

Specified by:
rd in interface TucsonInterface

inp

public alice.logictuple.LogicTuple inp(TupleCentreId tid,
                                       alice.logictuple.LogicTuple t)
                                throws NoTucsonNodeException,
                                       TucsonIOException,
                                       alice.logictuple.InvalidLogicTupleException
Gets if present (without blocking) a matching logic tuples from the specified tuple centre

Specified by:
inp in interface TucsonInterface

rdp

public alice.logictuple.LogicTuple rdp(TupleCentreId tid,
                                       alice.logictuple.LogicTuple t)
                                throws NoTucsonNodeException,
                                       TucsonIOException,
                                       alice.logictuple.InvalidLogicTupleException
Reads if present (without blocking) a matching logic tuples from the specified tuple centre

Specified by:
rdp in interface TucsonInterface

setSpec

public alice.logictuple.LogicTuple setSpec(TupleCentreId tid,
                                           alice.logictuple.LogicTuple t)
                                    throws NoTucsonNodeException,
                                           TucsonIOException,
                                           alice.logictuple.InvalidLogicTupleException
Sets the behaviour specification of a specified tuple centre

Specified by:
setSpec in interface TucsonInterface

getSpec

public alice.logictuple.LogicTuple getSpec(TupleCentreId tid)
                                    throws NoTucsonNodeException,
                                           TucsonIOException
Gets the behaviour specification of a specified tuple centre

Specified by:
getSpec in interface TucsonInterface

out

public void out(alice.logictuple.LogicTuple t)
         throws NoTucsonNodeException,
                TucsonIOException,
                alice.logictuple.InvalidLogicTupleException
Places (synchronously) a tuples on the default tuple centre

Specified by:
out in interface TucsonInterface

outAsync

public void outAsync(alice.logictuple.LogicTuple t)
              throws NoTucsonNodeException,
                     TucsonIOException,
                     alice.logictuple.InvalidLogicTupleException
Places (asynchronously) a tuples on the default tuple centre

Specified by:
outAsync in interface TucsonInterface

in

public alice.logictuple.LogicTuple in(alice.logictuple.LogicTuple t)
                               throws NoTucsonNodeException,
                                      TucsonIOException,
                                      alice.logictuple.InvalidLogicTupleException
Gets (blocking) a matching logic tuples from the default tuple centre

Specified by:
in in interface TucsonInterface

rd

public alice.logictuple.LogicTuple rd(alice.logictuple.LogicTuple t)
                               throws NoTucsonNodeException,
                                      TucsonIOException,
                                      alice.logictuple.InvalidLogicTupleException
Reads (blocking) a matching logic tuples from the default tuple centre

Specified by:
rd in interface TucsonInterface

inp

public alice.logictuple.LogicTuple inp(alice.logictuple.LogicTuple t)
                                throws NoTucsonNodeException,
                                       TucsonIOException,
                                       alice.logictuple.InvalidLogicTupleException
Gets if present (without blocking) a matching logic tuples from the default tuple centre

Specified by:
inp in interface TucsonInterface

rdp

public alice.logictuple.LogicTuple rdp(alice.logictuple.LogicTuple t)
                                throws NoTucsonNodeException,
                                       TucsonIOException,
                                       alice.logictuple.InvalidLogicTupleException
Reads if present (without blocking) a matching logic tuples from the default tuple centre

Specified by:
rdp in interface TucsonInterface

setSpec

public alice.logictuple.LogicTuple setSpec(alice.logictuple.LogicTuple t)
                                    throws NoTucsonNodeException,
                                           TucsonIOException,
                                           alice.logictuple.InvalidLogicTupleException
Reads if present (without blocking) a matching logic tuples from the default tuple centre

Specified by:
setSpec in interface TucsonInterface

getSpec

public alice.logictuple.LogicTuple getSpec()
                                    throws NoTucsonNodeException,
                                           TucsonIOException
Gets the behaviour specification of the default tuple centre

Specified by:
getSpec in interface TucsonInterface

shutdown

public void shutdown()
Shutdowns the user


unify

private alice.logictuple.LogicTuple unify(alice.tuplemedium.TupleTemplate template,
                                          alice.tuplemedium.Tuple tuple)
Helper service, which unifies a tuple template and a tuple