java.lang.Cloneable
, CMLibrary
, CMObject
, java.lang.Comparable<CMObject>
, java.lang.Runnable
ServiceEngine
public interface ThreadEngine extends CMLibrary, java.lang.Runnable
idConverter
Modifier and Type | Method | Description |
---|---|---|
void |
clearDebri(Room room,
TickableGroup.LocalType typeCode) |
Deletes the ticks of all the objects in the
room of the given type.
|
boolean |
deleteTick(Tickable E,
int tickID) |
Searches the TickGroups for the given Tickable, on the
given tickID, and deletes it.
|
void |
dumpDebugStack(java.lang.String ID,
java.lang.Thread theThread) |
Dumps a stack trace, logging with the given ID
|
void |
executeRunnable(char threadGroupId,
java.lang.Runnable R) |
Execute a runnable in an available thread, right now,
or as soon as humanly possible.
|
void |
executeRunnable(java.lang.Runnable R) |
Execute a runnable in an available thread, right now,
or as soon as humanly possible.
|
void |
executeRunnable(java.lang.String threadGroupName,
java.lang.Runnable R) |
Execute a runnable in an available thread, right now,
or as soon as humanly possible.
|
java.lang.Runnable |
findRunnableByThread(java.lang.Thread thread) |
This is used for determining the runner on the given thread,
which involves scanning thread pools for some reason?
|
java.util.List<TickClient> |
findTickClient(java.lang.String name,
boolean exactOnly) |
Finds all the TickClients with tickers matching
the given name.
|
java.util.List<Tickable> |
getNamedTickingObjects(java.lang.String name) |
Does an In-String search of all ticking objects
and returns them.
|
java.lang.String |
getSystemReport(java.lang.String itemCode) |
Retreives special thread related information about
map objects.
|
long |
getTickGroupPeriod(Tickable E,
int tickID) |
Searches the TickGroups for the given Tickable, and returns
the number of milliseconds that its tick group is using as
a "tick".
|
java.lang.String |
getTickInfoReport(java.lang.String which) |
Retreives special internal information from
the thread engine of the callers thread
group, mostly for the web server.
|
java.lang.String |
getTickStatusSummary(Tickable obj) |
A bit out of date, this returns the status of the
given ticking object as a descriptive string.
|
long |
getTimeMsToNextTick(Tickable E,
int tickID) |
Searches the TickGroups for the given Tickable, and returns
the number of miliseconds (roughly) before it will tick
again.
|
boolean |
isAllSuspended() |
Returns whether all threads are currently in
the global suspended thread.
|
boolean |
isSuspended(Tickable E,
int tickID) |
Returns whether the given Tickable is currently
suspended from receiving tick time, despite being
assigned a tick group.
|
boolean |
isTicking(Tickable E,
int tickID) |
Searches the TickGroups for the given Tickable, returning true
if it was found still registered to a Tick Client.
|
void |
rejuv(Room here,
int tickID) |
Given a map room, this will find all the rejuvable items and
mobs associated with the room and force them to respawn.
|
void |
resumeAll() |
Resumes all thread ticking, assuming they were
all previously suspended.
|
void |
resumeTicking(Tickable E,
int tickID) |
Resumes the thread time for this tick,
if it was previously suspended.
|
void |
scheduleRunnable(java.lang.Runnable R,
long ellapsedMs) |
Schedule a runnable to be executed in the future.
|
boolean |
setTickPending(Tickable E,
int tickID) |
If the given Tickable is waiting multiple ticks
before they get time, this will set them to
pending, meaning they will wake up on the very
next opportunity.
|
TickClient |
startTickDown(Tickable E,
int tickID,
int numTicks) |
Starts a standard repeating "ticker", on standard Tick time.
|
TickClient |
startTickDown(Tickable E,
int tickID,
long tickTimeMs,
int numTicks) |
Starts a standard repeating "ticker", but with
a custom Tick time.
|
void |
suspendAll(CMRunnable[] exceptRs) |
Suspend all threads, preventing anything from
getting official tick time, except for the given
runnable, typically a Session.
|
void |
suspendResumeRecurse(CMObject O,
boolean skipEmbeddedAreas,
boolean suspend) |
Suspends or Resumes all embedded mobs, items, etc inside
the given area, room, mob, etc.
|
void |
suspendTicking(Tickable E,
int tickID) |
Suspends any actual thread time for this tick,
without removing it from its tick group.
|
void |
tickAllTickers(Room here) |
Given a map room, this will find and force-tick every one of those
objects, on the current tick group.
|
java.util.Iterator<TickableGroup> |
tickGroups() |
Returns an iterator over all the existing tick groups.
|
boolean |
unTickAll(Tickable E) |
A special method that deletes all known ticks of
all tick ids from the given object, but also deletes
all ticks of any objects dependent on it, such as
item on mobs, effects on things, in rooms, etc.
|
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
TickClient startTickDown(Tickable E, int tickID, long tickTimeMs, int numTicks)
E
- The Ticking objecttickID
- the tick id denoting the type of eventtickTimeMs
- the time between ticks, usually globalnumTicks
- the number of given ticks between Tickable ticksTickClient startTickDown(Tickable E, int tickID, int numTicks)
E
- The Ticking objecttickID
- the tick id denoting the type of eventnumTicks
- the number of given ticks between Tickable ticksboolean isTicking(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ANYlong getTimeMsToNextTick(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ANYjava.util.Iterator<TickableGroup> tickGroups()
long getTickGroupPeriod(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ANYboolean deleteTick(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ALLboolean unTickAll(Tickable E)
E
- the object to go completely quietboolean setTickPending(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ALLvoid suspendTicking(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ALLresumeTicking(Tickable, int)
,
suspendResumeRecurse(CMObject, boolean, boolean)
,
isSuspended(Tickable, int)
,
suspendAll(CMRunnable[])
,
resumeAll()
,
isAllSuspended()
void resumeTicking(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ALLsuspendTicking(Tickable, int)
,
suspendResumeRecurse(CMObject, boolean, boolean)
,
isSuspended(Tickable, int)
,
suspendAll(CMRunnable[])
,
resumeAll()
,
isAllSuspended()
void suspendResumeRecurse(CMObject O, boolean skipEmbeddedAreas, boolean suspend)
O
- the object to suspend ticks on and well insideskipEmbeddedAreas
- true to skip ships and the likesuspend
- true to suspend, false to resumeresumeTicking(Tickable, int)
,
suspendTicking(Tickable, int)
,
isSuspended(Tickable, int)
,
suspendAll(CMRunnable[])
,
resumeAll()
,
isAllSuspended()
boolean isSuspended(Tickable E, int tickID)
E
- the Tickable to search fortickID
- the assigned tick id, or -1 for ALLresumeTicking(Tickable, int)
,
suspendTicking(Tickable, int)
,
suspendResumeRecurse(CMObject, boolean, boolean)
,
suspendAll(CMRunnable[])
,
resumeAll()
,
isAllSuspended()
void suspendAll(CMRunnable[] exceptRs)
exceptRs
- null, or the runnables to NOT suspendresumeTicking(Tickable, int)
,
suspendTicking(Tickable, int)
,
suspendResumeRecurse(CMObject, boolean, boolean)
,
isSuspended(Tickable, int)
,
resumeAll()
,
isAllSuspended()
void resumeAll()
boolean isAllSuspended()
resumeTicking(Tickable, int)
,
suspendTicking(Tickable, int)
,
suspendResumeRecurse(CMObject, boolean, boolean)
,
isSuspended(Tickable, int)
,
suspendAll(CMRunnable[])
,
resumeAll()
void scheduleRunnable(java.lang.Runnable R, long ellapsedMs)
R
- the runnable to executeellapsedMs
- the number of milliseconds before executingscheduleRunnable(Runnable, long)
,
executeRunnable(Runnable)
,
executeRunnable(char, Runnable)
,
executeRunnable(String, Runnable)
void executeRunnable(java.lang.Runnable R)
R
- the runnable to executescheduleRunnable(Runnable, long)
,
executeRunnable(Runnable)
,
executeRunnable(char, Runnable)
,
executeRunnable(String, Runnable)
void executeRunnable(java.lang.String threadGroupName, java.lang.Runnable R)
threadGroupName
- the thread group to execute it inR
- the runnable to executescheduleRunnable(Runnable, long)
,
executeRunnable(Runnable)
,
executeRunnable(char, Runnable)
,
executeRunnable(String, Runnable)
void executeRunnable(char threadGroupId, java.lang.Runnable R)
threadGroupId
- the thread group to execute it inR
- the runnable to executescheduleRunnable(Runnable, long)
,
executeRunnable(Runnable)
,
executeRunnable(char, Runnable)
,
executeRunnable(String, Runnable)
void tickAllTickers(Room here)
here
- the room to tick objects invoid rejuv(Room here, int tickID)
here
- the room to force rejuv items intickID
- -1 for items and mobs, or TICKID_MOB or TICKID_ROOM_ITEM_REJUVvoid clearDebri(Room room, TickableGroup.LocalType typeCode)
room
- the mob to delete objects fromtypeCode
- the type of objectsTickableGroup.LocalType
java.lang.String getTickInfoReport(java.lang.String which)
which
- the special encoded variable to returnjava.lang.String getSystemReport(java.lang.String itemCode)
itemCode
- the special variable to get value ofjava.lang.String getTickStatusSummary(Tickable obj)
obj
- the object that is maybe tickingjava.util.List<Tickable> getNamedTickingObjects(java.lang.String name)
name
- the partial namejava.util.List<TickClient> findTickClient(java.lang.String name, boolean exactOnly)
name
- the string name to matchexactOnly
- true for exact only, false for partialjava.lang.Runnable findRunnableByThread(java.lang.Thread thread)
thread
- the thread to get the runnable forvoid dumpDebugStack(java.lang.String ID, java.lang.Thread theThread)
ID
- the log id, a string of your choicetheThread
- the thread to dump