repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.setClassLoader
public void setClassLoader (ClassLoader loader) { _loader = loader; PresentsConnection conn = getConnection(); if (conn != null) { conn.setClassLoader(loader); } }
java
public void setClassLoader (ClassLoader loader) { _loader = loader; PresentsConnection conn = getConnection(); if (conn != null) { conn.setClassLoader(loader); } }
[ "public", "void", "setClassLoader", "(", "ClassLoader", "loader", ")", "{", "_loader", "=", "loader", ";", "PresentsConnection", "conn", "=", "getConnection", "(", ")", ";", "if", "(", "conn", "!=", "null", ")", "{", "conn", ".", "setClassLoader", "(", "lo...
Configures this session with a custom class loader that will be used when unserializing classes from the network.
[ "Configures", "this", "session", "with", "a", "custom", "class", "loader", "that", "will", "be", "used", "when", "unserializing", "classes", "from", "the", "network", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L196-L203
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.endSession
@EventThread public void endSession () { _clmgr.clientSessionWillEnd(this); // queue up a request for our connection to be closed (if we have a connection, that is) Connection conn = getConnection(); if (conn != null) { // go ahead and clear out our connection now to...
java
@EventThread public void endSession () { _clmgr.clientSessionWillEnd(this); // queue up a request for our connection to be closed (if we have a connection, that is) Connection conn = getConnection(); if (conn != null) { // go ahead and clear out our connection now to...
[ "@", "EventThread", "public", "void", "endSession", "(", ")", "{", "_clmgr", ".", "clientSessionWillEnd", "(", "this", ")", ";", "// queue up a request for our connection to be closed (if we have a connection, that is)", "Connection", "conn", "=", "getConnection", "(", ")",...
Forcibly terminates a client's session. This must be called from the dobjmgr thread.
[ "Forcibly", "terminates", "a", "client", "s", "session", ".", "This", "must", "be", "called", "from", "the", "dobjmgr", "thread", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L341-L378
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.handleMessage
public void handleMessage (Message message) { // if the client has been getting crazy with the cheeze whiz, stick a fork in them; the // first time through we end our session, subsequently _throttle is null and we just drop // any messages that come in until we've fully shutdown if (...
java
public void handleMessage (Message message) { // if the client has been getting crazy with the cheeze whiz, stick a fork in them; the // first time through we end our session, subsequently _throttle is null and we just drop // any messages that come in until we've fully shutdown if (...
[ "public", "void", "handleMessage", "(", "Message", "message", ")", "{", "// if the client has been getting crazy with the cheeze whiz, stick a fork in them; the", "// first time through we end our session, subsequently _throttle is null and we just drop", "// any messages that come in until we'v...
from interface Connection.MessageHandler
[ "from", "interface", "Connection", ".", "MessageHandler" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L437-L452
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.dispatchMessage
protected void dispatchMessage (Message message) { _messagesIn++; // count 'em up! // we dispatch to a message dispatcher that is specialized for the particular class of // message that we received MessageDispatcher disp = _disps.get(message.getClass()); if (disp == null) { ...
java
protected void dispatchMessage (Message message) { _messagesIn++; // count 'em up! // we dispatch to a message dispatcher that is specialized for the particular class of // message that we received MessageDispatcher disp = _disps.get(message.getClass()); if (disp == null) { ...
[ "protected", "void", "dispatchMessage", "(", "Message", "message", ")", "{", "_messagesIn", "++", ";", "// count 'em up!", "// we dispatch to a message dispatcher that is specialized for the particular class of", "// message that we received", "MessageDispatcher", "disp", "=", "_di...
Processes a message without throttling.
[ "Processes", "a", "message", "without", "throttling", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L457-L471
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.startSession
protected void startSession (Name authname, AuthRequest req, PresentsConnection conn, Object authdata) { _authname = authname; _areq = req; _authdata = authdata; setConnection(conn); // resolve our client object before we get fully underway _clmgr.resolveClie...
java
protected void startSession (Name authname, AuthRequest req, PresentsConnection conn, Object authdata) { _authname = authname; _areq = req; _authdata = authdata; setConnection(conn); // resolve our client object before we get fully underway _clmgr.resolveClie...
[ "protected", "void", "startSession", "(", "Name", "authname", ",", "AuthRequest", "req", ",", "PresentsConnection", "conn", ",", "Object", "authdata", ")", "{", "_authname", "=", "authname", ";", "_areq", "=", "req", ";", "_authdata", "=", "authdata", ";", "...
Initializes this client instance with the specified username, connection instance and client object and begins a client session.
[ "Initializes", "this", "client", "instance", "with", "the", "specified", "username", "connection", "instance", "and", "client", "object", "and", "begins", "a", "client", "session", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L494-L507
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.resumeSession
protected void resumeSession (AuthRequest req, PresentsConnection conn) { // check to see if we've already got a connection object, in which case it's probably stale Connection oldconn = getConnection(); if (oldconn != null && !oldconn.isClosed()) { log.info("Closing stale connec...
java
protected void resumeSession (AuthRequest req, PresentsConnection conn) { // check to see if we've already got a connection object, in which case it's probably stale Connection oldconn = getConnection(); if (oldconn != null && !oldconn.isClosed()) { log.info("Closing stale connec...
[ "protected", "void", "resumeSession", "(", "AuthRequest", "req", ",", "PresentsConnection", "conn", ")", "{", "// check to see if we've already got a connection object, in which case it's probably stale", "Connection", "oldconn", "=", "getConnection", "(", ")", ";", "if", "("...
Called by the client manager when a new connection arrives that authenticates as this already established client. This must only be called from the congmr thread.
[ "Called", "by", "the", "client", "manager", "when", "a", "new", "connection", "arrives", "that", "authenticates", "as", "this", "already", "established", "client", ".", "This", "must", "only", "be", "called", "from", "the", "congmr", "thread", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L513-L547
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.finishResumeSession
@EventThread protected void finishResumeSession () { // if we have no client object for whatever reason; we're hosed, shut ourselves down if (_clobj == null) { log.info("Missing client object for resuming session " + this + "."); endSession(); return; ...
java
@EventThread protected void finishResumeSession () { // if we have no client object for whatever reason; we're hosed, shut ourselves down if (_clobj == null) { log.info("Missing client object for resuming session " + this + "."); endSession(); return; ...
[ "@", "EventThread", "protected", "void", "finishResumeSession", "(", ")", "{", "// if we have no client object for whatever reason; we're hosed, shut ourselves down", "if", "(", "_clobj", "==", "null", ")", "{", "log", ".", "info", "(", "\"Missing client object for resuming s...
This is called from the dobjmgr thread to complete the session resumption. We call some call backs and send the bootstrap info to the client.
[ "This", "is", "called", "from", "the", "dobjmgr", "thread", "to", "complete", "the", "session", "resumption", ".", "We", "call", "some", "call", "backs", "and", "send", "the", "bootstrap", "info", "to", "the", "client", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L553-L581
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.safeEndSession
@AnyThread protected void safeEndSession () { if (!_omgr.isRunning()) { log.info("Dropping end session request as we're shutting down " + this + "."); } else { _omgr.postRunnable(new Runnable() { public void run () { endSession(); ...
java
@AnyThread protected void safeEndSession () { if (!_omgr.isRunning()) { log.info("Dropping end session request as we're shutting down " + this + "."); } else { _omgr.postRunnable(new Runnable() { public void run () { endSession(); ...
[ "@", "AnyThread", "protected", "void", "safeEndSession", "(", ")", "{", "if", "(", "!", "_omgr", ".", "isRunning", "(", ")", ")", "{", "log", ".", "info", "(", "\"Dropping end session request as we're shutting down \"", "+", "this", "+", "\".\"", ")", ";", "...
Queues up a runnable on the object manager thread where we can safely end the session.
[ "Queues", "up", "a", "runnable", "on", "the", "object", "manager", "thread", "where", "we", "can", "safely", "end", "the", "session", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L598-L610
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.unmapSubscrip
protected synchronized void unmapSubscrip (int oid) { ClientProxy rec; synchronized (_subscrips) { rec = _subscrips.remove(oid); } if (rec != null) { rec.unsubscribe(); } else { boolean alreadyDestroyed = _destroyedSubs.remove(oid); ...
java
protected synchronized void unmapSubscrip (int oid) { ClientProxy rec; synchronized (_subscrips) { rec = _subscrips.remove(oid); } if (rec != null) { rec.unsubscribe(); } else { boolean alreadyDestroyed = _destroyedSubs.remove(oid); ...
[ "protected", "synchronized", "void", "unmapSubscrip", "(", "int", "oid", ")", "{", "ClientProxy", "rec", ";", "synchronized", "(", "_subscrips", ")", "{", "rec", "=", "_subscrips", ".", "remove", "(", "oid", ")", ";", "}", "if", "(", "rec", "!=", "null",...
Makes a note that this client is no longer subscribed to this object. The subscription map is used to clean up after the client when it goes away.
[ "Makes", "a", "note", "that", "this", "client", "is", "no", "longer", "subscribed", "to", "this", "object", ".", "The", "subscription", "map", "is", "used", "to", "clean", "up", "after", "the", "client", "when", "it", "goes", "away", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L637-L651
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.clearSubscrips
protected void clearSubscrips (boolean verbose) { for (ClientProxy rec : _subscrips.values()) { if (verbose) { log.info("Clearing subscription", "client", this, "obj", rec.object.getOid()); } rec.unsubscribe(); } _subscrips.clear(); }
java
protected void clearSubscrips (boolean verbose) { for (ClientProxy rec : _subscrips.values()) { if (verbose) { log.info("Clearing subscription", "client", this, "obj", rec.object.getOid()); } rec.unsubscribe(); } _subscrips.clear(); }
[ "protected", "void", "clearSubscrips", "(", "boolean", "verbose", ")", "{", "for", "(", "ClientProxy", "rec", ":", "_subscrips", ".", "values", "(", ")", ")", "{", "if", "(", "verbose", ")", "{", "log", ".", "info", "(", "\"Clearing subscription\"", ",", ...
Clears out the tracked client subscriptions. Called when the client goes away and shouldn't be called otherwise.
[ "Clears", "out", "the", "tracked", "client", "subscriptions", ".", "Called", "when", "the", "client", "goes", "away", "and", "shouldn", "t", "be", "called", "otherwise", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L657-L666
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.sendBootstrap
protected void sendBootstrap () { // log.info("Sending bootstrap " + this + "."); // create and populate our bootstrap data BootstrapData data = createBootstrapData(); populateBootstrapData(data); // create a send bootstrap notification postMessage(new BootstrapNoti...
java
protected void sendBootstrap () { // log.info("Sending bootstrap " + this + "."); // create and populate our bootstrap data BootstrapData data = createBootstrapData(); populateBootstrapData(data); // create a send bootstrap notification postMessage(new BootstrapNoti...
[ "protected", "void", "sendBootstrap", "(", ")", "{", "// log.info(\"Sending bootstrap \" + this + \".\");", "// create and populate our bootstrap data", "BootstrapData", "data", "=", "createBootstrapData", "(", ")", ";", "populateBootstrapData", "(", "data", ")", ";", ...
This is called once we have a handle on the client distributed object. It sends a bootstrap notification to the client with all the information it will need to interact with the server.
[ "This", "is", "called", "once", "we", "have", "a", "handle", "on", "the", "client", "distributed", "object", ".", "It", "sends", "a", "bootstrap", "notification", "to", "the", "client", "with", "all", "the", "information", "it", "will", "need", "to", "inte...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L735-L745
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.setConnection
protected synchronized void setConnection (PresentsConnection conn) { long now = System.currentTimeMillis(); if (_conn != null) { // if our connection is being cleared out, record the amount of time we were connected // to our total connected time if (conn == null...
java
protected synchronized void setConnection (PresentsConnection conn) { long now = System.currentTimeMillis(); if (_conn != null) { // if our connection is being cleared out, record the amount of time we were connected // to our total connected time if (conn == null...
[ "protected", "synchronized", "void", "setConnection", "(", "PresentsConnection", "conn", ")", "{", "long", "now", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "if", "(", "_conn", "!=", "null", ")", "{", "// if our connection is being cleared out, record t...
Sets our connection reference in a thread safe way. Also establishes the back reference to us as the connection's message handler.
[ "Sets", "our", "connection", "reference", "in", "a", "thread", "safe", "way", ".", "Also", "establishes", "the", "back", "reference", "to", "us", "as", "the", "connection", "s", "message", "handler", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L846-L877
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.finishCompoundMessage
protected void finishCompoundMessage () { if (--_compoundDepth == 0) { CompoundDownstreamMessage downstream = _compound; _compound = null; if (!downstream.msgs.isEmpty()) { postMessage(downstream, null); } } }
java
protected void finishCompoundMessage () { if (--_compoundDepth == 0) { CompoundDownstreamMessage downstream = _compound; _compound = null; if (!downstream.msgs.isEmpty()) { postMessage(downstream, null); } } }
[ "protected", "void", "finishCompoundMessage", "(", ")", "{", "if", "(", "--", "_compoundDepth", "==", "0", ")", "{", "CompoundDownstreamMessage", "downstream", "=", "_compound", ";", "_compound", "=", "null", ";", "if", "(", "!", "downstream", ".", "msgs", "...
Sends the compound message created in startCompoundMessage.
[ "Sends", "the", "compound", "message", "created", "in", "startCompoundMessage", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L928-L937
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.postMessage
protected boolean postMessage (DownstreamMessage msg, PresentsConnection expect) { PresentsConnection conn = getConnection(); // make sure that the connection they expect us to be using is the one we're using; there // are circumstances were sufficient delay between request and response giv...
java
protected boolean postMessage (DownstreamMessage msg, PresentsConnection expect) { PresentsConnection conn = getConnection(); // make sure that the connection they expect us to be using is the one we're using; there // are circumstances were sufficient delay between request and response giv...
[ "protected", "boolean", "postMessage", "(", "DownstreamMessage", "msg", ",", "PresentsConnection", "expect", ")", "{", "PresentsConnection", "conn", "=", "getConnection", "(", ")", ";", "// make sure that the connection they expect us to be using is the one we're using; there", ...
Queues a message for delivery to the client.
[ "Queues", "a", "message", "for", "delivery", "to", "the", "client", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L940-L978
train
threerings/narya
core/src/main/java/com/threerings/presents/server/PresentsSession.java
PresentsSession.throttleUpdated
protected void throttleUpdated () { int messagesPerSec; synchronized(_pendingThrottles) { if (_pendingThrottles.size() == 0) { log.warning("Received throttleUpdated but have no pending throttles", "client", this); return; ...
java
protected void throttleUpdated () { int messagesPerSec; synchronized(_pendingThrottles) { if (_pendingThrottles.size() == 0) { log.warning("Received throttleUpdated but have no pending throttles", "client", this); return; ...
[ "protected", "void", "throttleUpdated", "(", ")", "{", "int", "messagesPerSec", ";", "synchronized", "(", "_pendingThrottles", ")", "{", "if", "(", "_pendingThrottles", ".", "size", "(", ")", "==", "0", ")", "{", "log", ".", "warning", "(", "\"Received throt...
Notifies this client that its throttle was updated.
[ "Notifies", "this", "client", "that", "its", "throttle", "was", "updated", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsSession.java#L983-L1002
train
threerings/narya
core/src/main/java/com/threerings/presents/util/FutureResult.java
FutureResult.get
public V get (long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return _sync.innerGet(unit.toNanos(timeout)); }
java
public V get (long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { return _sync.innerGet(unit.toNanos(timeout)); }
[ "public", "V", "get", "(", "long", "timeout", ",", "TimeUnit", "unit", ")", "throws", "InterruptedException", ",", "ExecutionException", ",", "TimeoutException", "{", "return", "_sync", ".", "innerGet", "(", "unit", ".", "toNanos", "(", "timeout", ")", ")", ...
from interface Future
[ "from", "interface", "Future" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/FutureResult.java#L67-L71
train
threerings/narya
core/src/main/java/com/threerings/presents/util/FutureResult.java
FutureResult.requestProcessed
public void requestProcessed (Object result) { @SuppressWarnings("unchecked") V value = (V)result; _sync.innerSet(value); }
java
public void requestProcessed (Object result) { @SuppressWarnings("unchecked") V value = (V)result; _sync.innerSet(value); }
[ "public", "void", "requestProcessed", "(", "Object", "result", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "V", "value", "=", "(", "V", ")", "result", ";", "_sync", ".", "innerSet", "(", "value", ")", ";", "}" ]
from interface InvocationService.ResultListener
[ "from", "interface", "InvocationService", ".", "ResultListener" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/util/FutureResult.java#L74-L78
train
threerings/narya
core/src/main/java/com/threerings/admin/client/TabbedDSetEditor.java
TabbedDSetEditor.createEditor
protected DSetEditor<E> createEditor ( DObject setter, String setName, Class<?> entryClass, String[] editableFields, ObjectEditorTable.FieldInterpreter interp, EntryGrouper<E> grouper, String group) { return new DSetEditor<E>(setter, setName, entryClass, editableFields, inter...
java
protected DSetEditor<E> createEditor ( DObject setter, String setName, Class<?> entryClass, String[] editableFields, ObjectEditorTable.FieldInterpreter interp, EntryGrouper<E> grouper, String group) { return new DSetEditor<E>(setter, setName, entryClass, editableFields, inter...
[ "protected", "DSetEditor", "<", "E", ">", "createEditor", "(", "DObject", "setter", ",", "String", "setName", ",", "Class", "<", "?", ">", "entryClass", ",", "String", "[", "]", "editableFields", ",", "ObjectEditorTable", ".", "FieldInterpreter", "interp", ","...
Creates a DSetEditor for displaying the given group.
[ "Creates", "a", "DSetEditor", "for", "displaying", "the", "given", "group", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/client/TabbedDSetEditor.java#L213-L219
train
threerings/narya
core/src/main/java/com/threerings/presents/peer/server/persist/NodeRecord.java
NodeRecord.getPeerHostName
public String getPeerHostName (String region) { return (ALWAYS_CONNECT_INTERNAL || Objects.equal(this.region, region)) ? hostName : publicHostName; }
java
public String getPeerHostName (String region) { return (ALWAYS_CONNECT_INTERNAL || Objects.equal(this.region, region)) ? hostName : publicHostName; }
[ "public", "String", "getPeerHostName", "(", "String", "region", ")", "{", "return", "(", "ALWAYS_CONNECT_INTERNAL", "||", "Objects", ".", "equal", "(", "this", ".", "region", ",", "region", ")", ")", "?", "hostName", ":", "publicHostName", ";", "}" ]
Returns the host name to which peers in the specified region should connect.
[ "Returns", "the", "host", "name", "to", "which", "peers", "in", "the", "specified", "region", "should", "connect", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/peer/server/persist/NodeRecord.java#L117-L122
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.setClassLoader
public void setClassLoader (ClassLoader loader) { _loader = loader; if (_comm != null) { _comm.setClassLoader(loader); } }
java
public void setClassLoader (ClassLoader loader) { _loader = loader; if (_comm != null) { _comm.setClassLoader(loader); } }
[ "public", "void", "setClassLoader", "(", "ClassLoader", "loader", ")", "{", "_loader", "=", "loader", ";", "if", "(", "_comm", "!=", "null", ")", "{", "_comm", ".", "setClassLoader", "(", "loader", ")", ";", "}", "}" ]
Configures the client with a custom class loader which will be used when reading objects off of the network.
[ "Configures", "the", "client", "with", "a", "custom", "class", "loader", "which", "will", "be", "used", "when", "reading", "objects", "off", "of", "the", "network", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L292-L298
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.registerFlushDelay
public void registerFlushDelay (Class<?> objclass, long delay) { ClientDObjectMgr omgr = (ClientDObjectMgr)getDObjectManager(); omgr.registerFlushDelay(objclass, delay); }
java
public void registerFlushDelay (Class<?> objclass, long delay) { ClientDObjectMgr omgr = (ClientDObjectMgr)getDObjectManager(); omgr.registerFlushDelay(objclass, delay); }
[ "public", "void", "registerFlushDelay", "(", "Class", "<", "?", ">", "objclass", ",", "long", "delay", ")", "{", "ClientDObjectMgr", "omgr", "=", "(", "ClientDObjectMgr", ")", "getDObjectManager", "(", ")", ";", "omgr", ".", "registerFlushDelay", "(", "objclas...
Instructs the distributed object manager associated with this client to allow objects of the specified class to linger around the specified number of milliseconds after their last subscriber has been removed before the client finally removes its object proxy and flushes the object. Normally, objects are flushed immedia...
[ "Instructs", "the", "distributed", "object", "manager", "associated", "with", "this", "client", "to", "allow", "objects", "of", "the", "specified", "class", "to", "linger", "around", "the", "specified", "number", "of", "milliseconds", "after", "their", "last", "...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L344-L348
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.logon
public synchronized boolean logon () { // if we have a communicator reference, we're already logged on if (_comm != null) { return false; } // notify our observers immediately _observers.apply(new ObserverOps.Session(this) { @Override protected void n...
java
public synchronized boolean logon () { // if we have a communicator reference, we're already logged on if (_comm != null) { return false; } // notify our observers immediately _observers.apply(new ObserverOps.Session(this) { @Override protected void n...
[ "public", "synchronized", "boolean", "logon", "(", ")", "{", "// if we have a communicator reference, we're already logged on", "if", "(", "_comm", "!=", "null", ")", "{", "return", "false", ";", "}", "// notify our observers immediately", "_observers", ".", "apply", "(...
Requests that this client connect and logon to the server with which it was previously configured. @return false if we're already logged on, true if a logon attempt was initiated.
[ "Requests", "that", "this", "client", "connect", "and", "logon", "to", "the", "server", "with", "which", "it", "was", "previously", "configured", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L504-L537
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.logoff
public boolean logoff (boolean abortable) { // if we have no communicator, we're not logged on anyway if (_comm == null) { log.warning("Ignoring request to logoff because we're not logged on."); return true; } // if the request is abortable, let's run it past...
java
public boolean logoff (boolean abortable) { // if we have no communicator, we're not logged on anyway if (_comm == null) { log.warning("Ignoring request to logoff because we're not logged on."); return true; } // if the request is abortable, let's run it past...
[ "public", "boolean", "logoff", "(", "boolean", "abortable", ")", "{", "// if we have no communicator, we're not logged on anyway", "if", "(", "_comm", "==", "null", ")", "{", "log", ".", "warning", "(", "\"Ignoring request to logoff because we're not logged on.\"", ")", "...
Requests that the client log off of the server to which it is connected. @param abortable If true, the client will call <code>clientWillDisconnect</code> on all of the client observers and abort the logoff process if any of them return false. If false, <code>clientWillDisconnect</code> will not be called at all. @ret...
[ "Requests", "that", "the", "client", "log", "off", "of", "the", "server", "to", "which", "it", "is", "connected", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L588-L613
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.prepareStandaloneLogon
public String[] prepareStandaloneLogon () { _standalone = true; // notify our observers immediately _observers.apply(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs.clientWillLogon(_client); } }); ...
java
public String[] prepareStandaloneLogon () { _standalone = true; // notify our observers immediately _observers.apply(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs.clientWillLogon(_client); } }); ...
[ "public", "String", "[", "]", "prepareStandaloneLogon", "(", ")", "{", "_standalone", "=", "true", ";", "// notify our observers immediately", "_observers", ".", "apply", "(", "new", "ObserverOps", ".", "Session", "(", "this", ")", "{", "@", "Override", "protect...
Prepares the client for a standalone mode logon. Returns the set of bootstrap service groups that should be supplied to the invocation manager to create our fake bootstrap record.
[ "Prepares", "the", "client", "for", "a", "standalone", "mode", "logon", ".", "Returns", "the", "set", "of", "bootstrap", "service", "groups", "that", "should", "be", "supplied", "to", "the", "invocation", "manager", "to", "create", "our", "fake", "bootstrap", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L619-L629
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.standaloneLogon
public void standaloneLogon (BootstrapData data, DObjectManager omgr) { if (!_standalone) { throw new IllegalStateException("Must call prepareStandaloneLogon() first."); } gotBootstrap(data, omgr); }
java
public void standaloneLogon (BootstrapData data, DObjectManager omgr) { if (!_standalone) { throw new IllegalStateException("Must call prepareStandaloneLogon() first."); } gotBootstrap(data, omgr); }
[ "public", "void", "standaloneLogon", "(", "BootstrapData", "data", ",", "DObjectManager", "omgr", ")", "{", "if", "(", "!", "_standalone", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Must call prepareStandaloneLogon() first.\"", ")", ";", "}", "gotBoo...
Logs this client on in standalone mode with the faked bootstrap data and shared local distributed object manager.
[ "Logs", "this", "client", "on", "in", "standalone", "mode", "with", "the", "faked", "bootstrap", "data", "and", "shared", "local", "distributed", "object", "manager", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L635-L641
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.standaloneLogoff
public void standaloneLogoff () { notifyObservers(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs.clientDidLogoff(_client); } }); cleanup(null); // this will set _standalone to false }
java
public void standaloneLogoff () { notifyObservers(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs.clientDidLogoff(_client); } }); cleanup(null); // this will set _standalone to false }
[ "public", "void", "standaloneLogoff", "(", ")", "{", "notifyObservers", "(", "new", "ObserverOps", ".", "Session", "(", "this", ")", "{", "@", "Override", "protected", "void", "notify", "(", "SessionObserver", "obs", ")", "{", "obs", ".", "clientDidLogoff", ...
For standalone mode, this notifies observers that the client has logged off and cleans up.
[ "For", "standalone", "mode", "this", "notifies", "observers", "that", "the", "client", "has", "logged", "off", "and", "cleans", "up", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L646-L654
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.setOutgoingMessageThrottle
protected synchronized void setOutgoingMessageThrottle (int msgsPerSec) { log.info("Updating outgoing message throttle", "msgsPerSec", msgsPerSec); _outThrottle.reinit(msgsPerSec, 1000L); _comm.postMessage(new ThrottleUpdatedMessage()); }
java
protected synchronized void setOutgoingMessageThrottle (int msgsPerSec) { log.info("Updating outgoing message throttle", "msgsPerSec", msgsPerSec); _outThrottle.reinit(msgsPerSec, 1000L); _comm.postMessage(new ThrottleUpdatedMessage()); }
[ "protected", "synchronized", "void", "setOutgoingMessageThrottle", "(", "int", "msgsPerSec", ")", "{", "log", ".", "info", "(", "\"Updating outgoing message throttle\"", ",", "\"msgsPerSec\"", ",", "msgsPerSec", ")", ";", "_outThrottle", ".", "reinit", "(", "msgsPerSe...
Configures the outgoing message throttle. This is done when the server informs us that a new rate is in effect.
[ "Configures", "the", "outgoing", "message", "throttle", ".", "This", "is", "done", "when", "the", "server", "informs", "us", "that", "a", "new", "rate", "is", "in", "effect", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L744-L749
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.tick
protected void tick () { // if we're not connected, skip it if (_comm == null) { return; } long now = RunAnywhere.currentTimeMillis(); if (_dcalc != null) { // if our current calculator is done, clear it out if (_dcalc.isDone()) { ...
java
protected void tick () { // if we're not connected, skip it if (_comm == null) { return; } long now = RunAnywhere.currentTimeMillis(); if (_dcalc != null) { // if our current calculator is done, clear it out if (_dcalc.isDone()) { ...
[ "protected", "void", "tick", "(", ")", "{", "// if we're not connected, skip it", "if", "(", "_comm", "==", "null", ")", "{", "return", ";", "}", "long", "now", "=", "RunAnywhere", ".", "currentTimeMillis", "(", ")", ";", "if", "(", "_dcalc", "!=", "null",...
Called every five seconds; ensures that we ping the server if we haven't communicated in a long while and periodically resyncs the client and server clock deltas.
[ "Called", "every", "five", "seconds", ";", "ensures", "that", "we", "ping", "the", "server", "if", "we", "haven", "t", "communicated", "in", "a", "long", "while", "and", "periodically", "resyncs", "the", "client", "and", "server", "clock", "deltas", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L771-L802
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.gotClientObject
protected void gotClientObject (ClientObject clobj) { // keep this around _clobj = clobj; // let the client know that logon has now fully succeeded notifyObservers(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs...
java
protected void gotClientObject (ClientObject clobj) { // keep this around _clobj = clobj; // let the client know that logon has now fully succeeded notifyObservers(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs...
[ "protected", "void", "gotClientObject", "(", "ClientObject", "clobj", ")", "{", "// keep this around", "_clobj", "=", "clobj", ";", "// let the client know that logon has now fully succeeded", "notifyObservers", "(", "new", "ObserverOps", ".", "Session", "(", "this", ")",...
Called by the invocation director when it successfully subscribes to the client object immediately following logon.
[ "Called", "by", "the", "invocation", "director", "when", "it", "successfully", "subscribes", "to", "the", "client", "object", "immediately", "following", "logon", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L838-L849
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.getClientObjectFailed
protected void getClientObjectFailed (final Exception cause) { // pass the buck onto the listeners notifyObservers(new ObserverOps.Client(this) { @Override protected void notify (ClientObserver obs) { obs.clientFailedToLogon(_client, cause); } }); ...
java
protected void getClientObjectFailed (final Exception cause) { // pass the buck onto the listeners notifyObservers(new ObserverOps.Client(this) { @Override protected void notify (ClientObserver obs) { obs.clientFailedToLogon(_client, cause); } }); ...
[ "protected", "void", "getClientObjectFailed", "(", "final", "Exception", "cause", ")", "{", "// pass the buck onto the listeners", "notifyObservers", "(", "new", "ObserverOps", ".", "Client", "(", "this", ")", "{", "@", "Override", "protected", "void", "notify", "("...
Called by the invocation director if it fails to subscribe to the client object after logon.
[ "Called", "by", "the", "invocation", "director", "if", "it", "fails", "to", "subscribe", "to", "the", "client", "object", "after", "logon", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L854-L862
train
threerings/narya
core/src/main/java/com/threerings/presents/client/Client.java
Client.clientObjectDidChange
protected void clientObjectDidChange (ClientObject clobj) { _clobj = clobj; _cloid = _clobj.getOid(); // report to our observers notifyObservers(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs.clientObjectDidCha...
java
protected void clientObjectDidChange (ClientObject clobj) { _clobj = clobj; _cloid = _clobj.getOid(); // report to our observers notifyObservers(new ObserverOps.Session(this) { @Override protected void notify (SessionObserver obs) { obs.clientObjectDidCha...
[ "protected", "void", "clientObjectDidChange", "(", "ClientObject", "clobj", ")", "{", "_clobj", "=", "clobj", ";", "_cloid", "=", "_clobj", ".", "getOid", "(", ")", ";", "// report to our observers", "notifyObservers", "(", "new", "ObserverOps", ".", "Session", ...
Called by the invocation director when it discovers that the client object has changed.
[ "Called", "by", "the", "invocation", "director", "when", "it", "discovers", "that", "the", "client", "object", "has", "changed", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/Client.java#L867-L878
train
xbib/marc
src/main/java/org/xbib/marc/MarcField.java
MarcField.getSubfield
public Deque<Subfield> getSubfield(String subfieldId) { return subfields.stream() .filter(subfield -> subfield.getId().equals(subfieldId)) .collect(Collectors.toCollection(LinkedList::new)); }
java
public Deque<Subfield> getSubfield(String subfieldId) { return subfields.stream() .filter(subfield -> subfield.getId().equals(subfieldId)) .collect(Collectors.toCollection(LinkedList::new)); }
[ "public", "Deque", "<", "Subfield", ">", "getSubfield", "(", "String", "subfieldId", ")", "{", "return", "subfields", ".", "stream", "(", ")", ".", "filter", "(", "subfield", "->", "subfield", ".", "getId", "(", ")", ".", "equals", "(", "subfieldId", ")"...
Return all subfields of a given subfield ID. Multiple occurences may occur. @param subfieldId subfield ID @return list of subfields
[ "Return", "all", "subfields", "of", "a", "given", "subfield", "ID", ".", "Multiple", "occurences", "may", "occur", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcField.java#L151-L155
train
xbib/marc
src/main/java/org/xbib/marc/MarcField.java
MarcField.matchValue
public MarcField matchValue(Pattern pattern) { if (value != null && pattern.matcher(value).matches()) { return this; } for (Subfield subfield : subfields) { if (pattern.matcher(subfield.getValue()).matches()) { return this; } } ...
java
public MarcField matchValue(Pattern pattern) { if (value != null && pattern.matcher(value).matches()) { return this; } for (Subfield subfield : subfields) { if (pattern.matcher(subfield.getValue()).matches()) { return this; } } ...
[ "public", "MarcField", "matchValue", "(", "Pattern", "pattern", ")", "{", "if", "(", "value", "!=", "null", "&&", "pattern", ".", "matcher", "(", "value", ")", ".", "matches", "(", ")", ")", "{", "return", "this", ";", "}", "for", "(", "Subfield", "s...
Search for fields that match a pattern. @param pattern the pattern to match @return thhis MARC field if pattern matches, or null if not
[ "Search", "for", "fields", "that", "match", "a", "pattern", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcField.java#L277-L287
train
xbib/marc
src/main/java/org/xbib/marc/MarcField.java
MarcField.toTagIndicatorKey
public String toTagIndicatorKey() { return (tag == null ? EMPTY_STRING : tag) + KEY_DELIMITER + (indicator == null ? EMPTY_STRING : indicator); }
java
public String toTagIndicatorKey() { return (tag == null ? EMPTY_STRING : tag) + KEY_DELIMITER + (indicator == null ? EMPTY_STRING : indicator); }
[ "public", "String", "toTagIndicatorKey", "(", ")", "{", "return", "(", "tag", "==", "null", "?", "EMPTY_STRING", ":", "tag", ")", "+", "KEY_DELIMITER", "+", "(", "indicator", "==", "null", "?", "EMPTY_STRING", ":", "indicator", ")", ";", "}" ]
A MARC field can be denoted by a key, independent of values. This key is a string, consisting of tag and indicator delimited by a dollar sign. @return the tag/indicator-based key of this MARC field
[ "A", "MARC", "field", "can", "be", "denoted", "by", "a", "key", "independent", "of", "values", ".", "This", "key", "is", "a", "string", "consisting", "of", "tag", "and", "indicator", "delimited", "by", "a", "dollar", "sign", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcField.java#L305-L307
train
xbib/marc
src/main/java/org/xbib/marc/MarcField.java
MarcField.toKey
public String toKey() { return (tag == null ? EMPTY_STRING : tag) + KEY_DELIMITER + (indicator == null ? EMPTY_STRING : indicator) + KEY_DELIMITER + subfieldIds; }
java
public String toKey() { return (tag == null ? EMPTY_STRING : tag) + KEY_DELIMITER + (indicator == null ? EMPTY_STRING : indicator) + KEY_DELIMITER + subfieldIds; }
[ "public", "String", "toKey", "(", ")", "{", "return", "(", "tag", "==", "null", "?", "EMPTY_STRING", ":", "tag", ")", "+", "KEY_DELIMITER", "+", "(", "indicator", "==", "null", "?", "EMPTY_STRING", ":", "indicator", ")", "+", "KEY_DELIMITER", "+", "subfi...
A MARC field can be denoted by a key, independent of values. This key is a string, consisting of tag, indicator, subfield IDs, delimited by a dollar sign. @return the key of this MARC field
[ "A", "MARC", "field", "can", "be", "denoted", "by", "a", "key", "independent", "of", "values", ".", "This", "key", "is", "a", "string", "consisting", "of", "tag", "indicator", "subfield", "IDs", "delimited", "by", "a", "dollar", "sign", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcField.java#L323-L326
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/BodyManager.java
BodyManager.updateOccupantStatus
public void updateOccupantStatus (BodyObject body, final byte status) { // no need to NOOP if (body.status != status) { // update the status in their body object body.setStatus(status); body.getLocal(BodyLocal.class).statusTime = System.currentTimeMillis(); ...
java
public void updateOccupantStatus (BodyObject body, final byte status) { // no need to NOOP if (body.status != status) { // update the status in their body object body.setStatus(status); body.getLocal(BodyLocal.class).statusTime = System.currentTimeMillis(); ...
[ "public", "void", "updateOccupantStatus", "(", "BodyObject", "body", ",", "final", "byte", "status", ")", "{", "// no need to NOOP", "if", "(", "body", ".", "status", "!=", "status", ")", "{", "// update the status in their body object", "body", ".", "setStatus", ...
Updates the connection status for the given body object's occupant info in the specified location.
[ "Updates", "the", "connection", "status", "for", "the", "given", "body", "object", "s", "occupant", "info", "in", "the", "specified", "location", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/BodyManager.java#L68-L86
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/BodyManager.java
BodyManager.setIdle
public void setIdle (ClientObject caller, boolean idle) { BodyObject bobj = _locator.forClient(caller); // determine the body's proposed new status byte nstatus = (idle) ? OccupantInfo.IDLE : OccupantInfo.ACTIVE; if (bobj == null || bobj.status == nstatus) { return; // i...
java
public void setIdle (ClientObject caller, boolean idle) { BodyObject bobj = _locator.forClient(caller); // determine the body's proposed new status byte nstatus = (idle) ? OccupantInfo.IDLE : OccupantInfo.ACTIVE; if (bobj == null || bobj.status == nstatus) { return; // i...
[ "public", "void", "setIdle", "(", "ClientObject", "caller", ",", "boolean", "idle", ")", "{", "BodyObject", "bobj", "=", "_locator", ".", "forClient", "(", "caller", ")", ";", "// determine the body's proposed new status", "byte", "nstatus", "=", "(", "idle", ")...
from interface BodyProvider
[ "from", "interface", "BodyProvider" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/BodyManager.java#L89-L102
train
threerings/narya
core/src/main/java/com/threerings/presents/server/ReportingInvoker.java
ReportingInvoker.getStats
public Stats getStats (boolean snapshot) { synchronized (this) { if (snapshot) { _recent = _current; _current = new Stats(); _current.maxQueueSize = _queue.size(); } return _recent; } }
java
public Stats getStats (boolean snapshot) { synchronized (this) { if (snapshot) { _recent = _current; _current = new Stats(); _current.maxQueueSize = _queue.size(); } return _recent; } }
[ "public", "Stats", "getStats", "(", "boolean", "snapshot", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "snapshot", ")", "{", "_recent", "=", "_current", ";", "_current", "=", "new", "Stats", "(", ")", ";", "_current", ".", "maxQueueSize",...
Returns a recent snapshot of runtime statistics tracked by the invoker. @param snapshot if true, the current stats will be snapshotted and reset and the new snapshot will be returned. If false, the previous snapshot will be returned. If no snapshot has ever been taken, the current stats that have been accumulting sinc...
[ "Returns", "a", "recent", "snapshot", "of", "runtime", "statistics", "tracked", "by", "the", "invoker", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/ReportingInvoker.java#L62-L72
train
threerings/narya
core/src/main/java/com/threerings/util/Resulting.java
Resulting.requestProcessed
public final void requestProcessed (Object result) { @SuppressWarnings("unchecked") T casted = (T)result; requestCompleted(casted); }
java
public final void requestProcessed (Object result) { @SuppressWarnings("unchecked") T casted = (T)result; requestCompleted(casted); }
[ "public", "final", "void", "requestProcessed", "(", "Object", "result", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "T", "casted", "=", "(", "T", ")", "result", ";", "requestCompleted", "(", "casted", ")", ";", "}" ]
from InvocationService.ResultListener
[ "from", "InvocationService", ".", "ResultListener" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/util/Resulting.java#L202-L206
train
threerings/narya
core/src/main/java/com/threerings/util/Resulting.java
Resulting.requestFailed
public void requestFailed (Exception cause) { if (_chain != null) { _chain.requestFailed(cause); } else if (_invChain != null) { _invChain.requestFailed((cause instanceof InvocationException) ? cause.getMessage() : InvocationCodes.INTERNAL_ERR...
java
public void requestFailed (Exception cause) { if (_chain != null) { _chain.requestFailed(cause); } else if (_invChain != null) { _invChain.requestFailed((cause instanceof InvocationException) ? cause.getMessage() : InvocationCodes.INTERNAL_ERR...
[ "public", "void", "requestFailed", "(", "Exception", "cause", ")", "{", "if", "(", "_chain", "!=", "null", ")", "{", "_chain", ".", "requestFailed", "(", "cause", ")", ";", "}", "else", "if", "(", "_invChain", "!=", "null", ")", "{", "_invChain", ".", ...
Override this to handle a request failed in your own way.
[ "Override", "this", "to", "handle", "a", "request", "failed", "in", "your", "own", "way", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/util/Resulting.java#L211-L238
train
threerings/narya
core/src/main/java/com/threerings/util/Resulting.java
Resulting.requestCompleted
public void requestCompleted (T result) { if (_chain != null) { _chain.requestCompleted(result); } else if (_invChain instanceof InvocationService.ResultListener) { ((InvocationService.ResultListener)_invChain).requestProcessed(result); } else if (_invChain instance...
java
public void requestCompleted (T result) { if (_chain != null) { _chain.requestCompleted(result); } else if (_invChain instanceof InvocationService.ResultListener) { ((InvocationService.ResultListener)_invChain).requestProcessed(result); } else if (_invChain instance...
[ "public", "void", "requestCompleted", "(", "T", "result", ")", "{", "if", "(", "_chain", "!=", "null", ")", "{", "_chain", ".", "requestCompleted", "(", "result", ")", ";", "}", "else", "if", "(", "_invChain", "instanceof", "InvocationService", ".", "Resul...
Override this to handle a request completion in your own way.
[ "Override", "this", "to", "handle", "a", "request", "completion", "in", "your", "own", "way", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/util/Resulting.java#L243-L254
train
threerings/narya
core/src/main/java/com/threerings/crowd/client/PlaceController.java
PlaceController.init
public void init (CrowdContext ctx, PlaceConfig config) { // keep these around _ctx = ctx; _config = config; // create our user interface _view = createPlaceView(_ctx); // initialize our delegates applyToDelegates(new DelegateOp(PlaceControllerDelegate.class...
java
public void init (CrowdContext ctx, PlaceConfig config) { // keep these around _ctx = ctx; _config = config; // create our user interface _view = createPlaceView(_ctx); // initialize our delegates applyToDelegates(new DelegateOp(PlaceControllerDelegate.class...
[ "public", "void", "init", "(", "CrowdContext", "ctx", ",", "PlaceConfig", "config", ")", "{", "// keep these around", "_ctx", "=", "ctx", ";", "_config", "=", "config", ";", "// create our user interface", "_view", "=", "createPlaceView", "(", "_ctx", ")", ";", ...
Initializes this place controller with a reference to the context that they can use to access client services and to the configuration record for this place. The controller should create as much of its user interface that it can without having access to the place object because this will be invoked in parallel with the...
[ "Initializes", "this", "place", "controller", "with", "a", "reference", "to", "the", "context", "that", "they", "can", "use", "to", "access", "client", "services", "and", "to", "the", "configuration", "record", "for", "this", "place", ".", "The", "controller",...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/PlaceController.java#L73-L92
train
threerings/narya
core/src/main/java/com/threerings/crowd/client/PlaceController.java
PlaceController.addDelegate
protected void addDelegate (PlaceControllerDelegate delegate) { if (_delegates == null) { _delegates = Lists.newArrayList(); } _delegates.add(delegate); }
java
protected void addDelegate (PlaceControllerDelegate delegate) { if (_delegates == null) { _delegates = Lists.newArrayList(); } _delegates.add(delegate); }
[ "protected", "void", "addDelegate", "(", "PlaceControllerDelegate", "delegate", ")", "{", "if", "(", "_delegates", "==", "null", ")", "{", "_delegates", "=", "Lists", ".", "newArrayList", "(", ")", ";", "}", "_delegates", ".", "add", "(", "delegate", ")", ...
Adds the supplied delegate to the list for this controller.
[ "Adds", "the", "supplied", "delegate", "to", "the", "list", "for", "this", "controller", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/PlaceController.java#L238-L244
train
threerings/narya
core/src/main/java/com/threerings/admin/client/ConfigObjectManager.java
ConfigObjectManager.gotConfigInfo
public void gotConfigInfo (String[] keys, int[] oids) { _csubscribers = new ConfigObjectSubscriber[keys.length]; for (int ii = 0; ii < keys.length; ii++) { _csubscribers[ii] = new ConfigObjectSubscriber(); _csubscribers[ii].subscribeConfig(keys[ii], oids[ii]); } }
java
public void gotConfigInfo (String[] keys, int[] oids) { _csubscribers = new ConfigObjectSubscriber[keys.length]; for (int ii = 0; ii < keys.length; ii++) { _csubscribers[ii] = new ConfigObjectSubscriber(); _csubscribers[ii].subscribeConfig(keys[ii], oids[ii]); } }
[ "public", "void", "gotConfigInfo", "(", "String", "[", "]", "keys", ",", "int", "[", "]", "oids", ")", "{", "_csubscribers", "=", "new", "ConfigObjectSubscriber", "[", "keys", ".", "length", "]", ";", "for", "(", "int", "ii", "=", "0", ";", "ii", "<"...
documentation inherited from interface AdminService.ConfigInfoListener
[ "documentation", "inherited", "from", "interface", "AdminService", ".", "ConfigInfoListener" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/admin/client/ConfigObjectManager.java#L78-L85
train
xbib/marc
src/main/java/org/xbib/marc/MarcRecord.java
MarcRecord.getFields
public List<MarcField> getFields(String tag) { return marcFields.stream().filter(marcField -> marcField.getTag().equals(tag)) .collect(Collectors.toList()); }
java
public List<MarcField> getFields(String tag) { return marcFields.stream().filter(marcField -> marcField.getTag().equals(tag)) .collect(Collectors.toList()); }
[ "public", "List", "<", "MarcField", ">", "getFields", "(", "String", "tag", ")", "{", "return", "marcFields", ".", "stream", "(", ")", ".", "filter", "(", "marcField", "->", "marcField", ".", "getTag", "(", ")", ".", "equals", "(", "tag", ")", ")", "...
Return the MARC fields of this record with a given tag. @param tag the MARC tag @return the MARC field list matching the given tag.
[ "Return", "the", "MARC", "fields", "of", "this", "record", "with", "a", "given", "tag", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcRecord.java#L121-L124
train
xbib/marc
src/main/java/org/xbib/marc/MarcRecord.java
MarcRecord.filterKey
public List<MarcField> filterKey(Pattern pattern) { return marcFields.stream() .map(field -> field.matchKey(pattern)) .filter(Objects::nonNull) .collect(Collectors.toList()); }
java
public List<MarcField> filterKey(Pattern pattern) { return marcFields.stream() .map(field -> field.matchKey(pattern)) .filter(Objects::nonNull) .collect(Collectors.toList()); }
[ "public", "List", "<", "MarcField", ">", "filterKey", "(", "Pattern", "pattern", ")", "{", "return", "marcFields", ".", "stream", "(", ")", ".", "map", "(", "field", "->", "field", ".", "matchKey", "(", "pattern", ")", ")", ".", "filter", "(", "Objects...
Return a list of MARC fields of this record where key pattern matches were found. @param pattern the pattern @return a list of MARC fields
[ "Return", "a", "list", "of", "MARC", "fields", "of", "this", "record", "where", "key", "pattern", "matches", "were", "found", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcRecord.java#L132-L137
train
xbib/marc
src/main/java/org/xbib/marc/MarcRecord.java
MarcRecord.filterValue
public List<MarcField> filterValue(Pattern pattern) { return marcFields.stream().map(field -> field.matchValue(pattern)).filter(Objects::nonNull).collect(Collectors.toList()); }
java
public List<MarcField> filterValue(Pattern pattern) { return marcFields.stream().map(field -> field.matchValue(pattern)).filter(Objects::nonNull).collect(Collectors.toList()); }
[ "public", "List", "<", "MarcField", ">", "filterValue", "(", "Pattern", "pattern", ")", "{", "return", "marcFields", ".", "stream", "(", ")", ".", "map", "(", "field", "->", "field", ".", "matchValue", "(", "pattern", ")", ")", ".", "filter", "(", "Obj...
Return a list of MARC fields of this record where pattern matches were found. @param pattern the pattern @return a list of MARC fields
[ "Return", "a", "list", "of", "MARC", "fields", "of", "this", "record", "where", "pattern", "matches", "were", "found", "." ]
d8426fcfc686507cab59b3d8181b08f83718418c
https://github.com/xbib/marc/blob/d8426fcfc686507cab59b3d8181b08f83718418c/src/main/java/org/xbib/marc/MarcRecord.java#L145-L148
train
threerings/narya
core/src/main/java/com/threerings/presents/server/SessionFactory.java
SessionFactory.newSessionFactory
public static SessionFactory newSessionFactory ( final Class<? extends Credentials> credsClass, final Class<? extends PresentsSession> sessionClass, final Class<? extends Name> nameClass, final Class<? extends ClientResolver> resolverClass) { return new SessionFactory() { ...
java
public static SessionFactory newSessionFactory ( final Class<? extends Credentials> credsClass, final Class<? extends PresentsSession> sessionClass, final Class<? extends Name> nameClass, final Class<? extends ClientResolver> resolverClass) { return new SessionFactory() { ...
[ "public", "static", "SessionFactory", "newSessionFactory", "(", "final", "Class", "<", "?", "extends", "Credentials", ">", "credsClass", ",", "final", "Class", "<", "?", "extends", "PresentsSession", ">", "sessionClass", ",", "final", "Class", "<", "?", "extends...
Creates a session factory that handles clients with the supplied credentials and authentication name.
[ "Creates", "a", "session", "factory", "that", "handles", "clients", "with", "the", "supplied", "credentials", "and", "authentication", "name", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/SessionFactory.java#L49-L64
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.init
public void init (DObjectManager omgr, final int cloid, Client client) { // sanity check if (_clobj != null) { log.warning("Zoiks, client object around during invmgr init!"); cleanup(); } // keep these for later _omgr = omgr; _client = client;...
java
public void init (DObjectManager omgr, final int cloid, Client client) { // sanity check if (_clobj != null) { log.warning("Zoiks, client object around during invmgr init!"); cleanup(); } // keep these for later _omgr = omgr; _client = client;...
[ "public", "void", "init", "(", "DObjectManager", "omgr", ",", "final", "int", "cloid", ",", "Client", "client", ")", "{", "// sanity check", "if", "(", "_clobj", "!=", "null", ")", "{", "log", ".", "warning", "(", "\"Zoiks, client object around during invmgr ini...
Initializes the invocation director. This is called when the client establishes a connection with the server. @param omgr the distributed object manager via which the invocation manager will send and receive events. @param cloid the oid of the object on which invocation notifications as well as invocation responses wi...
[ "Initializes", "the", "invocation", "director", ".", "This", "is", "called", "when", "the", "client", "establishes", "a", "connection", "with", "the", "server", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L65-L101
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.registerReceiver
public void registerReceiver (InvocationDecoder decoder) { // add the receiver to the list _reclist.add(decoder); // if we're already online, assign a receiver id to this decoder if (_clobj != null) { assignReceiverId(decoder); } }
java
public void registerReceiver (InvocationDecoder decoder) { // add the receiver to the list _reclist.add(decoder); // if we're already online, assign a receiver id to this decoder if (_clobj != null) { assignReceiverId(decoder); } }
[ "public", "void", "registerReceiver", "(", "InvocationDecoder", "decoder", ")", "{", "// add the receiver to the list", "_reclist", ".", "add", "(", "decoder", ")", ";", "// if we're already online, assign a receiver id to this decoder", "if", "(", "_clobj", "!=", "null", ...
Registers an invocation notification receiver by way of its notification event decoder.
[ "Registers", "an", "invocation", "notification", "receiver", "by", "way", "of", "its", "notification", "event", "decoder", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L131-L140
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.unregisterReceiver
public void unregisterReceiver (String receiverCode) { // remove the receiver from the list for (Iterator<InvocationDecoder> iter = _reclist.iterator(); iter.hasNext(); ) { InvocationDecoder decoder = iter.next(); if (decoder.getReceiverCode().equals(receiverCode)) { ...
java
public void unregisterReceiver (String receiverCode) { // remove the receiver from the list for (Iterator<InvocationDecoder> iter = _reclist.iterator(); iter.hasNext(); ) { InvocationDecoder decoder = iter.next(); if (decoder.getReceiverCode().equals(receiverCode)) { ...
[ "public", "void", "unregisterReceiver", "(", "String", "receiverCode", ")", "{", "// remove the receiver from the list", "for", "(", "Iterator", "<", "InvocationDecoder", ">", "iter", "=", "_reclist", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ...
Removes a receiver registration.
[ "Removes", "a", "receiver", "registration", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L145-L168
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.assignReceiverIds
protected void assignReceiverIds () { // pack all the events into a single transaction _clobj.startTransaction(); try { // clear out our previous registrations _clobj.setReceivers(new DSet<Registration>()); for (InvocationDecoder decoder : _reclist) { ...
java
protected void assignReceiverIds () { // pack all the events into a single transaction _clobj.startTransaction(); try { // clear out our previous registrations _clobj.setReceivers(new DSet<Registration>()); for (InvocationDecoder decoder : _reclist) { ...
[ "protected", "void", "assignReceiverIds", "(", ")", "{", "// pack all the events into a single transaction", "_clobj", ".", "startTransaction", "(", ")", ";", "try", "{", "// clear out our previous registrations", "_clobj", ".", "setReceivers", "(", "new", "DSet", "<", ...
Called when we log on; generates mappings for all receivers registered prior to logon.
[ "Called", "when", "we", "log", "on", ";", "generates", "mappings", "for", "all", "receivers", "registered", "prior", "to", "logon", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L173-L187
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.eventReceived
public void eventReceived (DEvent event) { if (event instanceof InvocationResponseEvent) { InvocationResponseEvent ire = (InvocationResponseEvent)event; handleInvocationResponse(ire.getRequestId(), ire.getMethodId(), ire.getArgs()); } else if (event instanceof InvocationNoti...
java
public void eventReceived (DEvent event) { if (event instanceof InvocationResponseEvent) { InvocationResponseEvent ire = (InvocationResponseEvent)event; handleInvocationResponse(ire.getRequestId(), ire.getMethodId(), ire.getArgs()); } else if (event instanceof InvocationNoti...
[ "public", "void", "eventReceived", "(", "DEvent", "event", ")", "{", "if", "(", "event", "instanceof", "InvocationResponseEvent", ")", "{", "InvocationResponseEvent", "ire", "=", "(", "InvocationResponseEvent", ")", "event", ";", "handleInvocationResponse", "(", "ir...
Process notification and response events arriving on user object.
[ "Process", "notification", "and", "response", "events", "arriving", "on", "user", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L257-L273
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.handleInvocationResponse
protected void handleInvocationResponse (int reqId, int methodId, Object[] args) { // look up the invocation marshaller registered for that response ListenerMarshaller listener = _listeners.remove(reqId); if (listener == null) { log.warning("Received invocation response for which...
java
protected void handleInvocationResponse (int reqId, int methodId, Object[] args) { // look up the invocation marshaller registered for that response ListenerMarshaller listener = _listeners.remove(reqId); if (listener == null) { log.warning("Received invocation response for which...
[ "protected", "void", "handleInvocationResponse", "(", "int", "reqId", ",", "int", "methodId", ",", "Object", "[", "]", "args", ")", "{", "// look up the invocation marshaller registered for that response", "ListenerMarshaller", "listener", "=", "_listeners", ".", "remove"...
Dispatches an invocation response.
[ "Dispatches", "an", "invocation", "response", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L278-L307
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.handleInvocationNotification
protected void handleInvocationNotification (int receiverId, int methodId, Object[] args) { // look up the decoder registered for this receiver InvocationDecoder decoder = _receivers.get(receiverId); if (decoder == null) { log.warning("Received notification for which we have no r...
java
protected void handleInvocationNotification (int receiverId, int methodId, Object[] args) { // look up the decoder registered for this receiver InvocationDecoder decoder = _receivers.get(receiverId); if (decoder == null) { log.warning("Received notification for which we have no r...
[ "protected", "void", "handleInvocationNotification", "(", "int", "receiverId", ",", "int", "methodId", ",", "Object", "[", "]", "args", ")", "{", "// look up the decoder registered for this receiver", "InvocationDecoder", "decoder", "=", "_receivers", ".", "get", "(", ...
Dispatches an invocation notification.
[ "Dispatches", "an", "invocation", "notification", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L312-L331
train
threerings/narya
core/src/main/java/com/threerings/presents/client/InvocationDirector.java
InvocationDirector.handleClientObjectChanged
protected void handleClientObjectChanged (int newCloid) { // subscribe to the new client object _omgr.subscribeToObject(newCloid, new Subscriber<ClientObject>() { public void objectAvailable (ClientObject clobj) { // grab a reference to our old receiver registrations ...
java
protected void handleClientObjectChanged (int newCloid) { // subscribe to the new client object _omgr.subscribeToObject(newCloid, new Subscriber<ClientObject>() { public void objectAvailable (ClientObject clobj) { // grab a reference to our old receiver registrations ...
[ "protected", "void", "handleClientObjectChanged", "(", "int", "newCloid", ")", "{", "// subscribe to the new client object", "_omgr", ".", "subscribeToObject", "(", "newCloid", ",", "new", "Subscriber", "<", "ClientObject", ">", "(", ")", "{", "public", "void", "obj...
Called when the server has informed us that our previous client object is going the way of the Dodo because we're changing screen names. We subscribe to the new object and report to the client once we've got our hands on it.
[ "Called", "when", "the", "server", "has", "informed", "us", "that", "our", "previous", "client", "object", "is", "going", "the", "way", "of", "the", "Dodo", "because", "we", "re", "changing", "screen", "names", ".", "We", "subscribe", "to", "the", "new", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/InvocationDirector.java#L338-L372
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java
PlaceRegistry.createPlace
public PlaceManager createPlace (PlaceConfig config) throws InstantiationException, InvocationException { return createPlace(config, null, null); }
java
public PlaceManager createPlace (PlaceConfig config) throws InstantiationException, InvocationException { return createPlace(config, null, null); }
[ "public", "PlaceManager", "createPlace", "(", "PlaceConfig", "config", ")", "throws", "InstantiationException", ",", "InvocationException", "{", "return", "createPlace", "(", "config", ",", "null", ",", "null", ")", ";", "}" ]
Creates and registers a new place manager with no delegates. @see #createPlace(PlaceConfig,List)
[ "Creates", "and", "registers", "a", "new", "place", "manager", "with", "no", "delegates", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L82-L86
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java
PlaceRegistry.createPlace
public PlaceManager createPlace (PlaceConfig config, List<PlaceManagerDelegate> delegates) throws InstantiationException, InvocationException { return createPlace(config, delegates, null); }
java
public PlaceManager createPlace (PlaceConfig config, List<PlaceManagerDelegate> delegates) throws InstantiationException, InvocationException { return createPlace(config, delegates, null); }
[ "public", "PlaceManager", "createPlace", "(", "PlaceConfig", "config", ",", "List", "<", "PlaceManagerDelegate", ">", "delegates", ")", "throws", "InstantiationException", ",", "InvocationException", "{", "return", "createPlace", "(", "config", ",", "delegates", ",", ...
Creates and registers a new place manager along with the place object to be managed. The registry takes care of tracking the creation of the object and informing the manager when it is created. @param config the configuration object for the place to be created. The {@link PlaceManager} derived class that should be ins...
[ "Creates", "and", "registers", "a", "new", "place", "manager", "along", "with", "the", "place", "object", "to", "be", "managed", ".", "The", "registry", "takes", "care", "of", "tracking", "the", "creation", "of", "the", "object", "and", "informing", "the", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L109-L113
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java
PlaceRegistry.enumeratePlaces
public Iterator<PlaceObject> enumeratePlaces () { final Iterator<PlaceManager> itr = _pmgrs.values().iterator(); return new Iterator<PlaceObject>() { public boolean hasNext () { return itr.hasNext(); } public PlaceObject next () { P...
java
public Iterator<PlaceObject> enumeratePlaces () { final Iterator<PlaceManager> itr = _pmgrs.values().iterator(); return new Iterator<PlaceObject>() { public boolean hasNext () { return itr.hasNext(); } public PlaceObject next () { P...
[ "public", "Iterator", "<", "PlaceObject", ">", "enumeratePlaces", "(", ")", "{", "final", "Iterator", "<", "PlaceManager", ">", "itr", "=", "_pmgrs", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "return", "new", "Iterator", "<", "PlaceObject", ...
Returns an enumeration of all of the registered place objects. This should only be accessed on the dobjmgr thread and shouldn't be kept around across event dispatches.
[ "Returns", "an", "enumeration", "of", "all", "of", "the", "registered", "place", "objects", ".", "This", "should", "only", "be", "accessed", "on", "the", "dobjmgr", "thread", "and", "shouldn", "t", "be", "kept", "around", "across", "event", "dispatches", "."...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L132-L147
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java
PlaceRegistry.createPlace
protected PlaceManager createPlace (PlaceConfig config, List<PlaceManagerDelegate> delegates, PreStartupHook hook) throws InstantiationException, InvocationException { PlaceManager pmgr = null; try { // create a place manager using the cla...
java
protected PlaceManager createPlace (PlaceConfig config, List<PlaceManagerDelegate> delegates, PreStartupHook hook) throws InstantiationException, InvocationException { PlaceManager pmgr = null; try { // create a place manager using the cla...
[ "protected", "PlaceManager", "createPlace", "(", "PlaceConfig", "config", ",", "List", "<", "PlaceManagerDelegate", ">", "delegates", ",", "PreStartupHook", "hook", ")", "throws", "InstantiationException", ",", "InvocationException", "{", "PlaceManager", "pmgr", "=", ...
Creates a place manager using the supplied config, injects dependencies into and registers the supplied list of delegates, runs the supplied pre-startup hook and finally returns it.
[ "Creates", "a", "place", "manager", "using", "the", "supplied", "config", "injects", "dependencies", "into", "and", "registers", "the", "supplied", "list", "of", "delegates", "runs", "the", "supplied", "pre", "-", "startup", "hook", "and", "finally", "returns", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L176-L229
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java
PlaceRegistry.unmapPlaceManager
protected void unmapPlaceManager (PlaceManager pmgr) { int ploid = pmgr.getPlaceObject().getOid(); // remove it from the table if (_pmgrs.remove(ploid) == null) { log.warning("Requested to unmap unmapped place manager", "pmgr", pmgr); // } else { // Log.info(...
java
protected void unmapPlaceManager (PlaceManager pmgr) { int ploid = pmgr.getPlaceObject().getOid(); // remove it from the table if (_pmgrs.remove(ploid) == null) { log.warning("Requested to unmap unmapped place manager", "pmgr", pmgr); // } else { // Log.info(...
[ "protected", "void", "unmapPlaceManager", "(", "PlaceManager", "pmgr", ")", "{", "int", "ploid", "=", "pmgr", ".", "getPlaceObject", "(", ")", ".", "getOid", "(", ")", ";", "// remove it from the table", "if", "(", "_pmgrs", ".", "remove", "(", "ploid", ")",...
Called by the place manager when it has been shut down.
[ "Called", "by", "the", "place", "manager", "when", "it", "has", "been", "shut", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceRegistry.java#L256-L267
train
threerings/narya
core/src/main/java/com/threerings/io/Streamer.java
Streamer.isStreamable
public synchronized static boolean isStreamable (Class<?> target) { // if we have not yet initialized ourselves, do so now maybeInit(); // if we already have a streamer, or it's an enum, it's good if (_streamers.containsKey(target) || target.isEnum()) { return true; ...
java
public synchronized static boolean isStreamable (Class<?> target) { // if we have not yet initialized ourselves, do so now maybeInit(); // if we already have a streamer, or it's an enum, it's good if (_streamers.containsKey(target) || target.isEnum()) { return true; ...
[ "public", "synchronized", "static", "boolean", "isStreamable", "(", "Class", "<", "?", ">", "target", ")", "{", "// if we have not yet initialized ourselves, do so now", "maybeInit", "(", ")", ";", "// if we already have a streamer, or it's an enum, it's good", "if", "(", "...
Returns true if the supplied target class can be streamed using a streamer.
[ "Returns", "true", "if", "the", "supplied", "target", "class", "can", "be", "streamed", "using", "a", "streamer", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/Streamer.java#L69-L88
train
threerings/narya
core/src/main/java/com/threerings/io/Streamer.java
Streamer.getStreamerClass
public static Class<?> getStreamerClass (Object object) { return (object instanceof Enum<?>) ? ((Enum<?>)object).getDeclaringClass() : object.getClass(); }
java
public static Class<?> getStreamerClass (Object object) { return (object instanceof Enum<?>) ? ((Enum<?>)object).getDeclaringClass() : object.getClass(); }
[ "public", "static", "Class", "<", "?", ">", "getStreamerClass", "(", "Object", "object", ")", "{", "return", "(", "object", "instanceof", "Enum", "<", "?", ">", ")", "?", "(", "(", "Enum", "<", "?", ">", ")", "object", ")", ".", "getDeclaringClass", ...
Returns the class that should be used when streaming this object. In general that is the object's natural class, but for enum values, that might be its declaring class as enums use classes in a way that would otherwise pollute our id to class mapping space.
[ "Returns", "the", "class", "that", "should", "be", "used", "when", "streaming", "this", "object", ".", "In", "general", "that", "is", "the", "object", "s", "natural", "class", "but", "for", "enum", "values", "that", "might", "be", "its", "declaring", "clas...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/Streamer.java#L95-L99
train
threerings/narya
core/src/main/java/com/threerings/io/Streamer.java
Streamer.getCollectionClass
public static Class<?> getCollectionClass (Class<?> clazz) { if (Streamable.class.isAssignableFrom(clazz)) { // the class is natively streamable, let's ignore it return null; } for (Class<?> collClass : BasicStreamers.CollectionStreamer.SPECIFICITY_ORDER) { ...
java
public static Class<?> getCollectionClass (Class<?> clazz) { if (Streamable.class.isAssignableFrom(clazz)) { // the class is natively streamable, let's ignore it return null; } for (Class<?> collClass : BasicStreamers.CollectionStreamer.SPECIFICITY_ORDER) { ...
[ "public", "static", "Class", "<", "?", ">", "getCollectionClass", "(", "Class", "<", "?", ">", "clazz", ")", "{", "if", "(", "Streamable", ".", "class", ".", "isAssignableFrom", "(", "clazz", ")", ")", "{", "// the class is natively streamable, let's ignore it",...
If the specified class is not Streamable and is a Collection type, return the most specific supported Collection interface type; otherwise return null.
[ "If", "the", "specified", "class", "is", "not", "Streamable", "and", "is", "a", "Collection", "type", "return", "the", "most", "specific", "supported", "Collection", "interface", "type", ";", "otherwise", "return", "null", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/Streamer.java#L105-L117
train
threerings/narya
core/src/main/java/com/threerings/io/Streamer.java
Streamer.create
protected static Streamer create (Class<?> target) throws IOException { // validate that the class is really streamable boolean isInner = false, isStatic = Modifier.isStatic(target.getModifiers()); try { isInner = (target.getDeclaringClass() != null); } catch (Thr...
java
protected static Streamer create (Class<?> target) throws IOException { // validate that the class is really streamable boolean isInner = false, isStatic = Modifier.isStatic(target.getModifiers()); try { isInner = (target.getDeclaringClass() != null); } catch (Thr...
[ "protected", "static", "Streamer", "create", "(", "Class", "<", "?", ">", "target", ")", "throws", "IOException", "{", "// validate that the class is really streamable", "boolean", "isInner", "=", "false", ",", "isStatic", "=", "Modifier", ".", "isStatic", "(", "t...
Create the appropriate Streamer for a newly-seen class.
[ "Create", "the", "appropriate", "Streamer", "for", "a", "newly", "-", "seen", "class", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/io/Streamer.java#L229-L317
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.applyToOccupants
public void applyToOccupants (OccupantOp op) { if (_plobj != null) { for (OccupantInfo info : _plobj.occupantInfo) { op.apply(info); } } }
java
public void applyToOccupants (OccupantOp op) { if (_plobj != null) { for (OccupantInfo info : _plobj.occupantInfo) { op.apply(info); } } }
[ "public", "void", "applyToOccupants", "(", "OccupantOp", "op", ")", "{", "if", "(", "_plobj", "!=", "null", ")", "{", "for", "(", "OccupantInfo", "info", ":", "_plobj", ".", "occupantInfo", ")", "{", "op", ".", "apply", "(", "info", ")", ";", "}", "}...
Applies the supplied occupant operation to each occupant currently present in this place.
[ "Applies", "the", "supplied", "occupant", "operation", "to", "each", "occupant", "currently", "present", "in", "this", "place", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L152-L159
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.init
public void init (PlaceRegistry registry, InvocationManager invmgr, RootDObjectManager omgr, BodyLocator locator, PlaceConfig config) { _registry = registry; _invmgr = invmgr; _omgr = omgr; _locator = locator; _config = config; // initialize our...
java
public void init (PlaceRegistry registry, InvocationManager invmgr, RootDObjectManager omgr, BodyLocator locator, PlaceConfig config) { _registry = registry; _invmgr = invmgr; _omgr = omgr; _locator = locator; _config = config; // initialize our...
[ "public", "void", "init", "(", "PlaceRegistry", "registry", ",", "InvocationManager", "invmgr", ",", "RootDObjectManager", "omgr", ",", "BodyLocator", "locator", ",", "PlaceConfig", "config", ")", "{", "_registry", "=", "registry", ";", "_invmgr", "=", "invmgr", ...
Called by the place registry after creating this place manager.
[ "Called", "by", "the", "place", "registry", "after", "creating", "this", "place", "manager", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L188-L211
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.addDelegate
public void addDelegate (PlaceManagerDelegate delegate) { if (_delegates == null) { _delegates = Lists.newArrayList(); } if (_omgr != null) { delegate.init(this, _omgr, _invmgr); delegate.didInit(_config); } _delegates.add(delegate); }
java
public void addDelegate (PlaceManagerDelegate delegate) { if (_delegates == null) { _delegates = Lists.newArrayList(); } if (_omgr != null) { delegate.init(this, _omgr, _invmgr); delegate.didInit(_config); } _delegates.add(delegate); }
[ "public", "void", "addDelegate", "(", "PlaceManagerDelegate", "delegate", ")", "{", "if", "(", "_delegates", "==", "null", ")", "{", "_delegates", "=", "Lists", ".", "newArrayList", "(", ")", ";", "}", "if", "(", "_omgr", "!=", "null", ")", "{", "delegat...
Adds the supplied delegate to the list for this manager.
[ "Adds", "the", "supplied", "delegate", "to", "the", "list", "for", "this", "manager", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L216-L226
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.applyToDelegates
public void applyToDelegates (DelegateOp op) { if (_delegates != null) { for (int ii = 0, ll = _delegates.size(); ii < ll; ii++) { PlaceManagerDelegate delegate = _delegates.get(ii); if (op.shouldApply(delegate)) { op.apply(delegate); ...
java
public void applyToDelegates (DelegateOp op) { if (_delegates != null) { for (int ii = 0, ll = _delegates.size(); ii < ll; ii++) { PlaceManagerDelegate delegate = _delegates.get(ii); if (op.shouldApply(delegate)) { op.apply(delegate); ...
[ "public", "void", "applyToDelegates", "(", "DelegateOp", "op", ")", "{", "if", "(", "_delegates", "!=", "null", ")", "{", "for", "(", "int", "ii", "=", "0", ",", "ll", "=", "_delegates", ".", "size", "(", ")", ";", "ii", "<", "ll", ";", "ii", "++...
Applies the supplied operation to this manager's registered delegates.
[ "Applies", "the", "supplied", "operation", "to", "this", "manager", "s", "registered", "delegates", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L231-L241
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.startup
public void startup (PlaceObject plobj) { // keep track of this _plobj = plobj; // we usually want to create and register a speaker service instance that clients can use // to speak in this place if (shouldCreateSpeakService()) { plobj.setSpeakService(addProvider...
java
public void startup (PlaceObject plobj) { // keep track of this _plobj = plobj; // we usually want to create and register a speaker service instance that clients can use // to speak in this place if (shouldCreateSpeakService()) { plobj.setSpeakService(addProvider...
[ "public", "void", "startup", "(", "PlaceObject", "plobj", ")", "{", "// keep track of this", "_plobj", "=", "plobj", ";", "// we usually want to create and register a speaker service instance that clients can use", "// to speak in this place", "if", "(", "shouldCreateSpeakService",...
Called by the place manager after the place object has been successfully created.
[ "Called", "by", "the", "place", "manager", "after", "the", "place", "object", "has", "been", "successfully", "created", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L260-L289
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.registerMessageHandler
@Deprecated public void registerMessageHandler (String name, MessageHandler handler) { // create our handler map if necessary if (_msghandlers == null) { _msghandlers = Maps.newHashMap(); } _msghandlers.put(name, handler); }
java
@Deprecated public void registerMessageHandler (String name, MessageHandler handler) { // create our handler map if necessary if (_msghandlers == null) { _msghandlers = Maps.newHashMap(); } _msghandlers.put(name, handler); }
[ "@", "Deprecated", "public", "void", "registerMessageHandler", "(", "String", "name", ",", "MessageHandler", "handler", ")", "{", "// create our handler map if necessary", "if", "(", "_msghandlers", "==", "null", ")", "{", "_msghandlers", "=", "Maps", ".", "newHashM...
Registers a particular message handler instance to be used when processing message events with the specified name. @param name the message name of the message events that should be handled by this handler. @param handler the handler to be registered. @deprecated Use dynamically bound methods instead. See {@link Dynam...
[ "Registers", "a", "particular", "message", "handler", "instance", "to", "be", "used", "when", "processing", "message", "events", "with", "the", "specified", "name", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L361-L369
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.messageReceived
public void messageReceived (MessageEvent event) { if (_msghandlers != null) { MessageHandler handler = _msghandlers.get(event.getName()); if (handler != null) { handler.handleEvent(event, this); } } // If the message is directed at us, se...
java
public void messageReceived (MessageEvent event) { if (_msghandlers != null) { MessageHandler handler = _msghandlers.get(event.getName()); if (handler != null) { handler.handleEvent(event, this); } } // If the message is directed at us, se...
[ "public", "void", "messageReceived", "(", "MessageEvent", "event", ")", "{", "if", "(", "_msghandlers", "!=", "null", ")", "{", "MessageHandler", "handler", "=", "_msghandlers", ".", "get", "(", "event", ".", "getName", "(", ")", ")", ";", "if", "(", "ha...
from interface MessageListener
[ "from", "interface", "MessageListener" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L372-L417
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.addProvider
protected <T extends InvocationMarshaller<?>> T addProvider ( InvocationProvider prov, Class<T> mclass) { T marsh = _invmgr.registerProvider(prov, mclass); _marshallers.add(marsh); return marsh; }
java
protected <T extends InvocationMarshaller<?>> T addProvider ( InvocationProvider prov, Class<T> mclass) { T marsh = _invmgr.registerProvider(prov, mclass); _marshallers.add(marsh); return marsh; }
[ "protected", "<", "T", "extends", "InvocationMarshaller", "<", "?", ">", ">", "T", "addProvider", "(", "InvocationProvider", "prov", ",", "Class", "<", "T", ">", "mclass", ")", "{", "T", "marsh", "=", "_invmgr", ".", "registerProvider", "(", "prov", ",", ...
Registers an invocation provider and notes the registration such that it will be automatically cleared when this manager shuts down.
[ "Registers", "an", "invocation", "provider", "and", "notes", "the", "registration", "such", "that", "it", "will", "be", "automatically", "cleared", "when", "this", "manager", "shuts", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L588-L594
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.addDispatcher
protected <T extends InvocationMarshaller<?>> T addDispatcher (InvocationDispatcher<T> disp) { T marsh = _invmgr.registerDispatcher(disp); _marshallers.add(marsh); return marsh; }
java
protected <T extends InvocationMarshaller<?>> T addDispatcher (InvocationDispatcher<T> disp) { T marsh = _invmgr.registerDispatcher(disp); _marshallers.add(marsh); return marsh; }
[ "protected", "<", "T", "extends", "InvocationMarshaller", "<", "?", ">", ">", "T", "addDispatcher", "(", "InvocationDispatcher", "<", "T", ">", "disp", ")", "{", "T", "marsh", "=", "_invmgr", ".", "registerDispatcher", "(", "disp", ")", ";", "_marshallers", ...
Registers an invocation dispatcher and notes the registration such that it will be automatically cleared when this manager shuts down.
[ "Registers", "an", "invocation", "dispatcher", "and", "notes", "the", "registration", "such", "that", "it", "will", "be", "automatically", "cleared", "when", "this", "manager", "shuts", "down", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L600-L605
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.bodyEntered
protected void bodyEntered (final int bodyOid) { log.debug("Body entered", "where", where(), "oid", bodyOid); // let our delegates know what's up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate)...
java
protected void bodyEntered (final int bodyOid) { log.debug("Body entered", "where", where(), "oid", bodyOid); // let our delegates know what's up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate)...
[ "protected", "void", "bodyEntered", "(", "final", "int", "bodyOid", ")", "{", "log", ".", "debug", "(", "\"Body entered\"", ",", "\"where\"", ",", "where", "(", ")", ",", "\"oid\"", ",", "bodyOid", ")", ";", "// let our delegates know what's up", "applyToDelegat...
Called when a body object enters this place.
[ "Called", "when", "a", "body", "object", "enters", "this", "place", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L610-L624
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.bodyLeft
protected void bodyLeft (final int bodyOid) { log.debug("Body left", "where", where(), "oid", bodyOid); // if their occupant info hasn't been removed (which may be the case if they logged off // rather than left via a MoveTo request), we need to get it on out of here Integer key = I...
java
protected void bodyLeft (final int bodyOid) { log.debug("Body left", "where", where(), "oid", bodyOid); // if their occupant info hasn't been removed (which may be the case if they logged off // rather than left via a MoveTo request), we need to get it on out of here Integer key = I...
[ "protected", "void", "bodyLeft", "(", "final", "int", "bodyOid", ")", "{", "log", ".", "debug", "(", "\"Body left\"", ",", "\"where\"", ",", "where", "(", ")", ",", "\"oid\"", ",", "bodyOid", ")", ";", "// if their occupant info hasn't been removed (which may be t...
Called when a body object leaves this place.
[ "Called", "when", "a", "body", "object", "leaves", "this", "place", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L629-L654
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.bodyUpdated
protected void bodyUpdated (final OccupantInfo info) { // let our delegates know what's up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate) { delegate.bodyUpdated(info); } ...
java
protected void bodyUpdated (final OccupantInfo info) { // let our delegates know what's up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate) { delegate.bodyUpdated(info); } ...
[ "protected", "void", "bodyUpdated", "(", "final", "OccupantInfo", "info", ")", "{", "// let our delegates know what's up", "applyToDelegates", "(", "new", "DelegateOp", "(", "PlaceManagerDelegate", ".", "class", ")", "{", "@", "Override", "public", "void", "apply", ...
Called when a body's occupant info is updated.
[ "Called", "when", "a", "body", "s", "occupant", "info", "is", "updated", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L682-L691
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.placeBecameEmpty
protected void placeBecameEmpty () { // let our delegates know what's up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate) { delegate.placeBecameEmpty(); } }); // ...
java
protected void placeBecameEmpty () { // let our delegates know what's up applyToDelegates(new DelegateOp(PlaceManagerDelegate.class) { @Override public void apply (PlaceManagerDelegate delegate) { delegate.placeBecameEmpty(); } }); // ...
[ "protected", "void", "placeBecameEmpty", "(", ")", "{", "// let our delegates know what's up", "applyToDelegates", "(", "new", "DelegateOp", "(", "PlaceManagerDelegate", ".", "class", ")", "{", "@", "Override", "public", "void", "apply", "(", "PlaceManagerDelegate", "...
Called when we transition from having bodies in the place to not having any bodies in the place. Some places may take this as a sign to pack it in, others may wish to stick around. In any case, they can override this method to do their thing.
[ "Called", "when", "we", "transition", "from", "having", "bodies", "in", "the", "place", "to", "not", "having", "any", "bodies", "in", "the", "place", ".", "Some", "places", "may", "take", "this", "as", "a", "sign", "to", "pack", "it", "in", "others", "...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L698-L711
train
threerings/narya
core/src/main/java/com/threerings/crowd/server/PlaceManager.java
PlaceManager.checkShutdownInterval
protected void checkShutdownInterval () { // queue up a shutdown interval, unless we've already got one. long idlePeriod = idleUnloadPeriod(); if (idlePeriod > 0L && _shutdownInterval == null) { (_shutdownInterval = _omgr.newInterval(new Runnable() { public void r...
java
protected void checkShutdownInterval () { // queue up a shutdown interval, unless we've already got one. long idlePeriod = idleUnloadPeriod(); if (idlePeriod > 0L && _shutdownInterval == null) { (_shutdownInterval = _omgr.newInterval(new Runnable() { public void r...
[ "protected", "void", "checkShutdownInterval", "(", ")", "{", "// queue up a shutdown interval, unless we've already got one.", "long", "idlePeriod", "=", "idleUnloadPeriod", "(", ")", ";", "if", "(", "idlePeriod", ">", "0L", "&&", "_shutdownInterval", "==", "null", ")",...
Called on startup and when the place is empty.
[ "Called", "on", "startup", "and", "when", "the", "place", "is", "empty", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/server/PlaceManager.java#L716-L728
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java
SpeakUtil.sendInfo
public static void sendInfo (DObject speakObj, String bundle, String message) { sendSystem(speakObj, bundle, message, SystemMessage.INFO); }
java
public static void sendInfo (DObject speakObj, String bundle, String message) { sendSystem(speakObj, bundle, message, SystemMessage.INFO); }
[ "public", "static", "void", "sendInfo", "(", "DObject", "speakObj", ",", "String", "bundle", ",", "String", "message", ")", "{", "sendSystem", "(", "speakObj", ",", "bundle", ",", "message", ",", "SystemMessage", ".", "INFO", ")", ";", "}" ]
Sends a system INFO message notification to the specified object with the supplied message content. A system message is one that will be rendered where the speak messages are rendered, but in a way that makes it clear that it is a message from the server. Info messages are sent when something happens that was neither ...
[ "Sends", "a", "system", "INFO", "message", "notification", "to", "the", "specified", "object", "with", "the", "supplied", "message", "content", ".", "A", "system", "message", "is", "one", "that", "will", "be", "rendered", "where", "the", "speak", "messages", ...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L125-L128
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java
SpeakUtil.sendFeedback
public static void sendFeedback (DObject speakObj, String bundle, String message) { sendSystem(speakObj, bundle, message, SystemMessage.FEEDBACK); }
java
public static void sendFeedback (DObject speakObj, String bundle, String message) { sendSystem(speakObj, bundle, message, SystemMessage.FEEDBACK); }
[ "public", "static", "void", "sendFeedback", "(", "DObject", "speakObj", ",", "String", "bundle", ",", "String", "message", ")", "{", "sendSystem", "(", "speakObj", ",", "bundle", ",", "message", ",", "SystemMessage", ".", "FEEDBACK", ")", ";", "}" ]
Sends a system FEEDBACK message notification to the specified object with the supplied message content. A system message is one that will be rendered where the speak messages are rendered, but in a way that makes it clear that it is a message from the server. Feedback messages are sent in direct response to a user act...
[ "Sends", "a", "system", "FEEDBACK", "message", "notification", "to", "the", "specified", "object", "with", "the", "supplied", "message", "content", ".", "A", "system", "message", "is", "one", "that", "will", "be", "rendered", "where", "the", "speak", "messages...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L143-L146
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java
SpeakUtil.sendAttention
public static void sendAttention (DObject speakObj, String bundle, String message) { sendSystem(speakObj, bundle, message, SystemMessage.ATTENTION); }
java
public static void sendAttention (DObject speakObj, String bundle, String message) { sendSystem(speakObj, bundle, message, SystemMessage.ATTENTION); }
[ "public", "static", "void", "sendAttention", "(", "DObject", "speakObj", ",", "String", "bundle", ",", "String", "message", ")", "{", "sendSystem", "(", "speakObj", ",", "bundle", ",", "message", ",", "SystemMessage", ".", "ATTENTION", ")", ";", "}" ]
Sends a system ATTENTION message notification to the specified object with the supplied message content. A system message is one that will be rendered where the speak messages are rendered, but in a way that makes it clear that it is a message from the server. Attention messages are sent when something requires user a...
[ "Sends", "a", "system", "ATTENTION", "message", "notification", "to", "the", "specified", "object", "with", "the", "supplied", "message", "content", ".", "A", "system", "message", "is", "one", "that", "will", "be", "rendered", "where", "the", "speak", "message...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L161-L164
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java
SpeakUtil.sendMessage
public static void sendMessage (DObject speakObj, ChatMessage msg) { if (speakObj == null) { log.warning("Dropping speak message, no speak obj '" + msg + "'.", new Exception()); return; } // post the message to the relevant object speakObj.postMessage(ChatCod...
java
public static void sendMessage (DObject speakObj, ChatMessage msg) { if (speakObj == null) { log.warning("Dropping speak message, no speak obj '" + msg + "'.", new Exception()); return; } // post the message to the relevant object speakObj.postMessage(ChatCod...
[ "public", "static", "void", "sendMessage", "(", "DObject", "speakObj", ",", "ChatMessage", "msg", ")", "{", "if", "(", "speakObj", "==", "null", ")", "{", "log", ".", "warning", "(", "\"Dropping speak message, no speak obj '\"", "+", "msg", "+", "\"'.\"", ",",...
Send the specified message on the specified object.
[ "Send", "the", "specified", "message", "on", "the", "specified", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L169-L193
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java
SpeakUtil.sendSystem
protected static void sendSystem (DObject speakObj, String bundle, String message, byte level) { sendMessage(speakObj, new SystemMessage(message, bundle, level)); }
java
protected static void sendSystem (DObject speakObj, String bundle, String message, byte level) { sendMessage(speakObj, new SystemMessage(message, bundle, level)); }
[ "protected", "static", "void", "sendSystem", "(", "DObject", "speakObj", ",", "String", "bundle", ",", "String", "message", ",", "byte", "level", ")", "{", "sendMessage", "(", "speakObj", ",", "new", "SystemMessage", "(", "message", ",", "bundle", ",", "leve...
Send the specified system message on the specified dobj.
[ "Send", "the", "specified", "system", "message", "on", "the", "specified", "dobj", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/SpeakUtil.java#L216-L219
train
davidmoten/grumpy
grumpy-ogc-layers/src/main/java/com/github/davidmoten/grumpy/wms/layer/darkness/SunUtil.java
SunUtil.getTwilight
public static Twilight getTwilight(double sunDistanceRadians) { double altDegrees = 90.0 - Math.toDegrees(sunDistanceRadians); if (altDegrees >= 0.0) { return Twilight.DAYLIGHT; } else if (altDegrees >= -6.0) { return Twilight.CIVIL; } else if (altDegrees >= -12.0) { return Twilight.NAUTICAL; } else...
java
public static Twilight getTwilight(double sunDistanceRadians) { double altDegrees = 90.0 - Math.toDegrees(sunDistanceRadians); if (altDegrees >= 0.0) { return Twilight.DAYLIGHT; } else if (altDegrees >= -6.0) { return Twilight.CIVIL; } else if (altDegrees >= -12.0) { return Twilight.NAUTICAL; } else...
[ "public", "static", "Twilight", "getTwilight", "(", "double", "sunDistanceRadians", ")", "{", "double", "altDegrees", "=", "90.0", "-", "Math", ".", "toDegrees", "(", "sunDistanceRadians", ")", ";", "if", "(", "altDegrees", ">=", "0.0", ")", "{", "return", "...
Return the twilight condition for a point which is a given great circle distance from the current sub solar point. @param sunDistanceRadians - from the current positon to the sub solar point @return The twilight condition
[ "Return", "the", "twilight", "condition", "for", "a", "point", "which", "is", "a", "given", "great", "circle", "distance", "from", "the", "current", "sub", "solar", "point", "." ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-ogc-layers/src/main/java/com/github/davidmoten/grumpy/wms/layer/darkness/SunUtil.java#L42-L56
train
davidmoten/grumpy
grumpy-ogc-layers/src/main/java/com/github/davidmoten/grumpy/wms/layer/darkness/SunUtil.java
SunUtil.getSubSolarPoint
public static Position getSubSolarPoint(Calendar time) { // convert time to Julian Day Number double jd = TimeUtil.getJulianDayNumber(time); // Julian centuries since Jan 1, 2000, 12:00 UTC double T = (jd - 2451545.0) / 36525; // mean anomaly, degree double M = 357.52910 + 35999.05030 * T - 0.0001559 * ...
java
public static Position getSubSolarPoint(Calendar time) { // convert time to Julian Day Number double jd = TimeUtil.getJulianDayNumber(time); // Julian centuries since Jan 1, 2000, 12:00 UTC double T = (jd - 2451545.0) / 36525; // mean anomaly, degree double M = 357.52910 + 35999.05030 * T - 0.0001559 * ...
[ "public", "static", "Position", "getSubSolarPoint", "(", "Calendar", "time", ")", "{", "// convert time to Julian Day Number", "double", "jd", "=", "TimeUtil", ".", "getJulianDayNumber", "(", "time", ")", ";", "// Julian centuries since Jan 1, 2000, 12:00 UTC", "double", ...
Returns the position on the Earth's surface for which the sun appears to be straight above. @param time @return
[ "Returns", "the", "position", "on", "the", "Earth", "s", "surface", "for", "which", "the", "sun", "appears", "to", "be", "straight", "above", "." ]
f2d03e6b9771f15425fb3f76314837efc08c1233
https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-ogc-layers/src/main/java/com/github/davidmoten/grumpy/wms/layer/darkness/SunUtil.java#L82-L143
train
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DynamicListener.java
DynamicListener.elementUpdated
public void elementUpdated (ElementUpdatedEvent event) { dispatchMethod(event.getName() + "Updated", new Object[] { event.getIndex(), event.getValue() }); }
java
public void elementUpdated (ElementUpdatedEvent event) { dispatchMethod(event.getName() + "Updated", new Object[] { event.getIndex(), event.getValue() }); }
[ "public", "void", "elementUpdated", "(", "ElementUpdatedEvent", "event", ")", "{", "dispatchMethod", "(", "event", ".", "getName", "(", ")", "+", "\"Updated\"", ",", "new", "Object", "[", "]", "{", "event", ".", "getIndex", "(", ")", ",", "event", ".", "...
from interface ElementUpdateListener
[ "from", "interface", "ElementUpdateListener" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DynamicListener.java#L68-L72
train
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DynamicListener.java
DynamicListener.dispatchMethod
public void dispatchMethod (String name, Object[] arguments) { // first check the cache Method method = _mcache.get(name); if (method == null) { // if we haven't already determined this method doesn't exist, try // to resolve it if (!_mcache.containsKey(na...
java
public void dispatchMethod (String name, Object[] arguments) { // first check the cache Method method = _mcache.get(name); if (method == null) { // if we haven't already determined this method doesn't exist, try // to resolve it if (!_mcache.containsKey(na...
[ "public", "void", "dispatchMethod", "(", "String", "name", ",", "Object", "[", "]", "arguments", ")", "{", "// first check the cache", "Method", "method", "=", "_mcache", ".", "get", "(", "name", ")", ";", "if", "(", "method", "==", "null", ")", "{", "//...
Dynamically looks up the method in question on our target and dispatches an event if it does.
[ "Dynamically", "looks", "up", "the", "method", "in", "question", "on", "our", "target", "and", "dispatches", "an", "event", "if", "it", "does", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DynamicListener.java#L99-L118
train
threerings/narya
core/src/main/java/com/threerings/presents/dobj/DynamicListener.java
DynamicListener.resolveMethod
protected Method resolveMethod (String name, Object[] arguments) { Class<?>[] ptypes = new Class<?>[arguments.length]; for (int ii = 0; ii < arguments.length; ii++) { ptypes[ii] = arguments[ii] == null ? null : arguments[ii].getClass(); } try { ...
java
protected Method resolveMethod (String name, Object[] arguments) { Class<?>[] ptypes = new Class<?>[arguments.length]; for (int ii = 0; ii < arguments.length; ii++) { ptypes[ii] = arguments[ii] == null ? null : arguments[ii].getClass(); } try { ...
[ "protected", "Method", "resolveMethod", "(", "String", "name", ",", "Object", "[", "]", "arguments", ")", "{", "Class", "<", "?", ">", "[", "]", "ptypes", "=", "new", "Class", "<", "?", ">", "[", "arguments", ".", "length", "]", ";", "for", "(", "i...
Looks for a method that matches the supplied signature.
[ "Looks", "for", "a", "method", "that", "matches", "the", "supplied", "signature", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/dobj/DynamicListener.java#L123-L135
train
threerings/narya
core/src/main/java/com/threerings/presents/net/Transport.java
Transport.getInstance
public static Transport getInstance (Type type, int channel) { // were there more parameters in transport objects, it would be better to have a single map // of instances and use Transport objects as keys (as in examples of the flyweight // pattern). however, doing it this way avoids the ne...
java
public static Transport getInstance (Type type, int channel) { // were there more parameters in transport objects, it would be better to have a single map // of instances and use Transport objects as keys (as in examples of the flyweight // pattern). however, doing it this way avoids the ne...
[ "public", "static", "Transport", "getInstance", "(", "Type", "type", ",", "int", "channel", ")", "{", "// were there more parameters in transport objects, it would be better to have a single map", "// of instances and use Transport objects as keys (as in examples of the flyweight", "// p...
Returns the shared instance with the specified parameters.
[ "Returns", "the", "shared", "instance", "with", "the", "specified", "parameters", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/Transport.java#L140-L173
train
threerings/narya
core/src/main/java/com/threerings/presents/net/Transport.java
Transport.combine
public Transport combine (Transport other) { // if the channels are different, we fall back to the default channel return getInstance( _type.combine(other._type), (_channel == other._channel) ? _channel : 0); }
java
public Transport combine (Transport other) { // if the channels are different, we fall back to the default channel return getInstance( _type.combine(other._type), (_channel == other._channel) ? _channel : 0); }
[ "public", "Transport", "combine", "(", "Transport", "other", ")", "{", "// if the channels are different, we fall back to the default channel", "return", "getInstance", "(", "_type", ".", "combine", "(", "other", ".", "_type", ")", ",", "(", "_channel", "==", "other",...
Returns a transport that satisfies the requirements of this and the specified other transport.
[ "Returns", "a", "transport", "that", "satisfies", "the", "requirements", "of", "this", "and", "the", "specified", "other", "transport", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/net/Transport.java#L212-L218
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java
ChatProvider.broadcast
public void broadcast (Name from, String bundle, String msg, boolean attention, boolean forward) { byte levelOrMode = (from != null) ? ChatCodes.BROADCAST_MODE : (attention ? SystemMessage.ATTENTION : SystemMessage.INFO); broadcast(from, levelOrMode, bundle, msg, forward); }
java
public void broadcast (Name from, String bundle, String msg, boolean attention, boolean forward) { byte levelOrMode = (from != null) ? ChatCodes.BROADCAST_MODE : (attention ? SystemMessage.ATTENTION : SystemMessage.INFO); broadcast(from, levelOrMode, bundle, msg, forward); }
[ "public", "void", "broadcast", "(", "Name", "from", ",", "String", "bundle", ",", "String", "msg", ",", "boolean", "attention", ",", "boolean", "forward", ")", "{", "byte", "levelOrMode", "=", "(", "from", "!=", "null", ")", "?", "ChatCodes", ".", "BROAD...
Broadcasts the specified message to all place objects in the system. @param from the user the broadcast is from, or null to send the message as a system message. @param bundle the bundle, or null if the message needs no translation. @param msg the content of the message to broadcast. @param attention if true, the mess...
[ "Broadcasts", "the", "specified", "message", "to", "all", "place", "objects", "in", "the", "system", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java#L186-L191
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java
ChatProvider.broadcast
public void broadcast (Name from, byte levelOrMode, String bundle, String msg, boolean forward) { if (_broadcastObject != null) { broadcastTo(_broadcastObject, from, levelOrMode, bundle, msg); } else { for (Iterator<PlaceObject> iter = _plreg.enumeratePlaces(); iter.hasNext(...
java
public void broadcast (Name from, byte levelOrMode, String bundle, String msg, boolean forward) { if (_broadcastObject != null) { broadcastTo(_broadcastObject, from, levelOrMode, bundle, msg); } else { for (Iterator<PlaceObject> iter = _plreg.enumeratePlaces(); iter.hasNext(...
[ "public", "void", "broadcast", "(", "Name", "from", ",", "byte", "levelOrMode", ",", "String", "bundle", ",", "String", "msg", ",", "boolean", "forward", ")", "{", "if", "(", "_broadcastObject", "!=", "null", ")", "{", "broadcastTo", "(", "_broadcastObject",...
Broadcast with support for a customizable level or mode. @param levelOrMode if from is null, it's an attentionLevel, else it's a mode code.
[ "Broadcast", "with", "support", "for", "a", "customizable", "level", "or", "mode", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java#L197-L214
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java
ChatProvider.deliverTell
public void deliverTell (UserMessage message, Name target, TellListener listener) throws InvocationException { // make sure the target user is online BodyObject tobj = _locator.lookupBody(target); if (tobj == null) { // if we have a forwarder configured, try forwarding th...
java
public void deliverTell (UserMessage message, Name target, TellListener listener) throws InvocationException { // make sure the target user is online BodyObject tobj = _locator.lookupBody(target); if (tobj == null) { // if we have a forwarder configured, try forwarding th...
[ "public", "void", "deliverTell", "(", "UserMessage", "message", ",", "Name", "target", ",", "TellListener", "listener", ")", "throws", "InvocationException", "{", "// make sure the target user is online", "BodyObject", "tobj", "=", "_locator", ".", "lookupBody", "(", ...
Delivers a tell message to the specified target and notifies the supplied listener of the result. It is assumed that the teller has already been permissions checked.
[ "Delivers", "a", "tell", "message", "to", "the", "specified", "target", "and", "notifies", "the", "supplied", "listener", "of", "the", "result", ".", "It", "is", "assumed", "that", "the", "teller", "has", "already", "been", "permissions", "checked", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java#L220-L254
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java
ChatProvider.deliverTell
public void deliverTell (BodyObject target, UserMessage message) { SpeakUtil.sendMessage(target, message); // note that the teller "heard" what they said SpeakUtil.noteMessage(target, message.speaker, message); }
java
public void deliverTell (BodyObject target, UserMessage message) { SpeakUtil.sendMessage(target, message); // note that the teller "heard" what they said SpeakUtil.noteMessage(target, message.speaker, message); }
[ "public", "void", "deliverTell", "(", "BodyObject", "target", ",", "UserMessage", "message", ")", "{", "SpeakUtil", ".", "sendMessage", "(", "target", ",", "message", ")", ";", "// note that the teller \"heard\" what they said", "SpeakUtil", ".", "noteMessage", "(", ...
Delivers a tell notification to the specified target player. It is assumed that the message is coming from some server entity and need not be permissions checked or notified of the result.
[ "Delivers", "a", "tell", "notification", "to", "the", "specified", "target", "player", ".", "It", "is", "assumed", "that", "the", "message", "is", "coming", "from", "some", "server", "entity", "and", "need", "not", "be", "permissions", "checked", "or", "noti...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java#L261-L267
train
threerings/narya
core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java
ChatProvider.broadcastTo
protected void broadcastTo ( DObject object, Name from, byte levelOrMode, String bundle, String msg) { if (from == null) { SpeakUtil.sendSystem(object, bundle, msg, levelOrMode /* level */); } else { SpeakUtil.sendSpeak(object, from, bundle, msg, levelOrMode /* mode ...
java
protected void broadcastTo ( DObject object, Name from, byte levelOrMode, String bundle, String msg) { if (from == null) { SpeakUtil.sendSystem(object, bundle, msg, levelOrMode /* level */); } else { SpeakUtil.sendSpeak(object, from, bundle, msg, levelOrMode /* mode ...
[ "protected", "void", "broadcastTo", "(", "DObject", "object", ",", "Name", "from", ",", "byte", "levelOrMode", ",", "String", "bundle", ",", "String", "msg", ")", "{", "if", "(", "from", "==", "null", ")", "{", "SpeakUtil", ".", "sendSystem", "(", "objec...
Direct a broadcast to the specified object.
[ "Direct", "a", "broadcast", "to", "the", "specified", "object", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/server/ChatProvider.java#L280-L289
train
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java
PresentsConnectionManager.appendReport
public void appendReport (StringBuilder report, long now, long sinceLast, boolean reset) { PresentsConMgrStats stats = getStats(); long eventCount = stats.eventCount - _lastStats.eventCount; int connects = stats.connects - _lastStats.connects; int disconnects = stats.disconnects - _l...
java
public void appendReport (StringBuilder report, long now, long sinceLast, boolean reset) { PresentsConMgrStats stats = getStats(); long eventCount = stats.eventCount - _lastStats.eventCount; int connects = stats.connects - _lastStats.connects; int disconnects = stats.disconnects - _l...
[ "public", "void", "appendReport", "(", "StringBuilder", "report", ",", "long", "now", ",", "long", "sinceLast", ",", "boolean", "reset", ")", "{", "PresentsConMgrStats", "stats", "=", "getStats", "(", ")", ";", "long", "eventCount", "=", "stats", ".", "event...
from interface ReportManager.Reporter
[ "from", "interface", "ReportManager", ".", "Reporter" ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L127-L169
train
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java
PresentsConnectionManager.setPrivateKey
public boolean setPrivateKey (PrivateKey key) { if (SecureUtil.ciphersSupported(key)) { _privateKey = key; return true; } return false; }
java
public boolean setPrivateKey (PrivateKey key) { if (SecureUtil.ciphersSupported(key)) { _privateKey = key; return true; } return false; }
[ "public", "boolean", "setPrivateKey", "(", "PrivateKey", "key", ")", "{", "if", "(", "SecureUtil", ".", "ciphersSupported", "(", "key", ")", ")", "{", "_privateKey", "=", "key", ";", "return", "true", ";", "}", "return", "false", ";", "}" ]
Sets the private key if the ciphers are supported. @return true if the key is set
[ "Sets", "the", "private", "key", "if", "the", "ciphers", "are", "supported", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L185-L192
train
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java
PresentsConnectionManager.handleDatagram
protected int handleDatagram (DatagramChannel listener, long when) { InetSocketAddress source; _databuf.clear(); try { source = (InetSocketAddress)listener.receive(_databuf); } catch (IOException ioe) { log.warning("Failure receiving datagram.", ioe); ...
java
protected int handleDatagram (DatagramChannel listener, long when) { InetSocketAddress source; _databuf.clear(); try { source = (InetSocketAddress)listener.receive(_databuf); } catch (IOException ioe) { log.warning("Failure receiving datagram.", ioe); ...
[ "protected", "int", "handleDatagram", "(", "DatagramChannel", "listener", ",", "long", "when", ")", "{", "InetSocketAddress", "source", ";", "_databuf", ".", "clear", "(", ")", ";", "try", "{", "source", "=", "(", "InetSocketAddress", ")", "listener", ".", "...
Called when a datagram message is ready to be read off its channel.
[ "Called", "when", "a", "datagram", "message", "is", "ready", "to", "be", "read", "off", "its", "channel", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L215-L251
train
threerings/narya
core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java
PresentsConnectionManager.openOutgoingConnection
public void openOutgoingConnection (Connection conn, String hostname, int port) throws IOException { // create a socket channel to use for this connection, initialize it and queue it up to // have the non-blocking connect process started SocketChannel sockchan = SocketChannel.open();...
java
public void openOutgoingConnection (Connection conn, String hostname, int port) throws IOException { // create a socket channel to use for this connection, initialize it and queue it up to // have the non-blocking connect process started SocketChannel sockchan = SocketChannel.open();...
[ "public", "void", "openOutgoingConnection", "(", "Connection", "conn", ",", "String", "hostname", ",", "int", "port", ")", "throws", "IOException", "{", "// create a socket channel to use for this connection, initialize it and queue it up to", "// have the non-blocking connect proc...
Opens an outgoing connection to the supplied address. The connection will be opened in a non-blocking manner and added to the connection manager's select set. Messages posted to the connection prior to it being actually connected to its destination will remain in the queue. If the connection fails those messages will b...
[ "Opens", "an", "outgoing", "connection", "to", "the", "supplied", "address", ".", "The", "connection", "will", "be", "opened", "in", "a", "non", "-", "blocking", "manner", "and", "added", "to", "the", "connection", "manager", "s", "select", "set", ".", "Me...
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/net/PresentsConnectionManager.java#L369-L378
train