|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.javamud.run.Linker
Provides the ablility to link to MudObjects.
This class badly needs some synchronized
statements in it's
methods. (To prevent unexpected duplicate identities due to multi
threading).
Field Summary | |
protected MORegistry |
mudObjects
The global set of MudObjects |
Constructor Summary | |
Linker()
Constructor for the Linker object |
Method Summary | |
void |
deRef(MudObject m)
Used to dereference m from all MudObjects. |
MudObject |
find(String identity)
Locate a MudObject with the given identity. |
MudObject |
link(MudObject req,
MudObject to)
Record that req refers to to . |
MudObject |
link(MudObject req,
String identity)
Get a MudObject associated with identity. |
void |
register(MudObject mo)
Register mo with the Linker. |
void |
replace(MudObject o,
MudObject n)
Replaces o with n accross the whole MUD. |
MudObject |
require(String identity)
Find MudObject with given Identity or create a
NullMudObject with that Identity. |
void |
unlink(MudObject req,
MudObject target)
Record that req no longer referances target . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected MORegistry mudObjects
Constructor Detail |
public Linker()
Method Detail |
public void deRef(MudObject m)
m
- MudObject to dereferanceMudObject.deRef(MudObject)
public MudObject find(String identity)
identity
- Identity to find.
public MudObject link(MudObject req, MudObject to)
link(MudObject,String)
.
req
- MudObject to linkto
- MudObject to link to
unlink(MudObject,MudObject)
public MudObject link(MudObject req, String identity)
link
.
identity
- Identity to require
()req
- Requesting MudObject
link(MudObject,MudObject)
,
require(String)
public void register(MudObject mo) throws DuplicateIdentityException
MORegistry.add(MudObject)
will expire
any old identity.
mo
- MudObject to
register
DuplicateIdentityException
- Thrown if the new
identity already exists with another object. (Note: mo will
already have been removed from the registry at this point.)MORegistry.add(MudObject object)
public void replace(MudObject o, MudObject n) throws IllegalArgumentException
o
- Old MudObjectn
- New MudObject
IllegalArgumentException
- Thrown if identities do not
matchMudObject.replace(MudObject,MudObject)
public MudObject require(String identity)
Find
MudObject with given Identity or create a
NullMudObject with that Identity.
identity
- Identity to find/create.
find(String)
public void unlink(MudObject req, MudObject target)
req
- Requestortarget
- Targetlink(MudObject,MudObject)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |