com.threerings.crowd.peer.server
Class CrowdPeerManager

java.lang.Object
  extended by com.threerings.presents.peer.server.PeerManager
      extended by com.threerings.crowd.peer.server.CrowdPeerManager
All Implemented Interfaces:
Lifecycle.BaseComponent, Lifecycle.ShutdownComponent, ChatProvider.ChatForwarder, CrowdPeerProvider, PeerProvider, ClientManager.ClientObserver, InvocationProvider

public abstract class CrowdPeerManager
extends PeerManager
implements CrowdPeerProvider, ChatProvider.ChatForwarder

Extends the standard peer manager and bridges certain Crowd services.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.presents.peer.server.PeerManager
PeerManager.DroppedLockObserver, PeerManager.LockedOperation, PeerManager.LockHandler, PeerManager.NodeAction, PeerManager.NodeApplicant, PeerManager.NodeRequest, PeerManager.NodeRequestsResultImpl<T>, PeerManager.StaleCacheObserver, PeerManager.Stats
 
Field Summary
protected  ChatProvider _chatprov
           
protected  BodyLocator _locator
           
 
Fields inherited from class com.threerings.presents.peer.server.PeerManager
_cacheobs, _clmgr, _conmgr, _dropobs, _injector, _invmgr, _invoker, _locks, _nodeName, _nodeNamespace, _nodeobj, _noderepo, _omgr, _peers, _proxies, _repmgr, _self, _sharedSecret, _stats, _suboids, DEFAULT_LOCK_TIMEOUT, GET_NODE_OBJECT
 
Constructor Summary
CrowdPeerManager(Lifecycle cycle)
          Creates an uninitialized peer manager.
 
Method Summary
protected abstract  Name authFromViz(Name vizname)
          Converts a visible name to an authentication name.
protected  ClientInfo createClientInfo()
          Creates a ClientInfo record which will subsequently be initialized by a call to PeerManager.initClientInfo(com.threerings.presents.server.PresentsSession, com.threerings.presents.peer.data.ClientInfo).
protected  NodeObject createNodeObject()
          Creates the appropriate derived class of NodeObject which will be registered with the distributed object system.
 void deliverBroadcast(ClientObject caller, Name from, byte levelOrMode, String bundle, String msg)
          Handles a CrowdPeerService.deliverBroadcast(com.threerings.util.Name, byte, java.lang.String, java.lang.String) request.
 void deliverTell(ClientObject caller, UserMessage message, Name target, ChatService.TellListener listener)
          Handles a CrowdPeerService.deliverTell(com.threerings.crowd.chat.data.UserMessage, com.threerings.util.Name, com.threerings.crowd.chat.client.ChatService.TellListener) request.
protected  void didInit()
          Called after we have finished our initialization.
 void forwardBroadcast(Name from, byte levelOrMode, String bundle, String msg)
          Requests that the supplied broadcast message be delivered on other servers.
 boolean forwardTell(UserMessage message, Name target, ChatService.TellListener listener)
          Requests that the supplied tell message be delivered to the appropriate destination.
protected  void initClientInfo(PresentsSession client, ClientInfo info)
          Initializes the supplied client info for the supplied client.
 void shutdown()
           
 
Methods inherited from class com.threerings.presents.peer.server.PeerManager
acquireLock, addDroppedLockObserver, addStaleCacheObserver, broadcastStaleCacheData, changedCacheData, clearClientInfo, clientLoggedOff, clientLoggedOn, clientSessionDidEnd, clientSessionDidStart, clientSubscribedToNode, clientUnsubscribedFromNode, connectedToPeer, createCreds, createLockHandler, disconnectedFromPeer, droppedLock, findApplicableNodes, flattenAction, flattenRequest, generateReport, getLockHandler, getLockTimeout, getNodeObject, getNodeObjects, getPeerClient, getPeerInternalHostName, getPeerNodeClass, getPeerNodeObject, getPeerPort, getPeerPublicHostName, getRegion, getStats, hasPriority, ignoreClient, init, init, init, invokeAction, invokeNodeAction, invokeNodeAction, invokeNodeAction, invokeNodeRequest, invokeNodeRequest, invokeNodeRequest, invokeOnNodes, invokeRequest, isAuthenticPeer, locateClient, lockAcquired, lockReleased, lookupNodeDatum, peerAcquiringLock, peerAddedLock, peerEndedSession, peerReleasingLock, peerRemovedLock, peerStartedSession, peerUpdatedLock, performWithLock, proxyRemoteObject, proxyRemoteObject, queryLock, queryLock, ratifyLockAction, reacquireLock, refreshPeer, refreshPeers, releaseLock, removeDroppedLockObserver, removeStaleCacheObserver, unproxyRemoteObject, unproxyRemoteObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_chatprov

@Inject
protected ChatProvider _chatprov

_locator

@Inject
protected BodyLocator _locator
Constructor Detail

CrowdPeerManager

@Inject
public CrowdPeerManager(Lifecycle cycle)
Creates an uninitialized peer manager.

Method Detail

deliverTell

public void deliverTell(ClientObject caller,
                        UserMessage message,
                        Name target,
                        ChatService.TellListener listener)
                 throws InvocationException
Description copied from interface: CrowdPeerProvider
Handles a CrowdPeerService.deliverTell(com.threerings.crowd.chat.data.UserMessage, com.threerings.util.Name, com.threerings.crowd.chat.client.ChatService.TellListener) request.

Specified by:
deliverTell in interface CrowdPeerProvider
Throws:
InvocationException

deliverBroadcast

public void deliverBroadcast(ClientObject caller,
                             Name from,
                             byte levelOrMode,
                             String bundle,
                             String msg)
Description copied from interface: CrowdPeerProvider
Handles a CrowdPeerService.deliverBroadcast(com.threerings.util.Name, byte, java.lang.String, java.lang.String) request.

Specified by:
deliverBroadcast in interface CrowdPeerProvider

forwardTell

public boolean forwardTell(UserMessage message,
                           Name target,
                           ChatService.TellListener listener)
Description copied from interface: ChatProvider.ChatForwarder
Requests that the supplied tell message be delivered to the appropriate destination.

Specified by:
forwardTell in interface ChatProvider.ChatForwarder
Returns:
true if the tell was delivered, false otherwise.

forwardBroadcast

public void forwardBroadcast(Name from,
                             byte levelOrMode,
                             String bundle,
                             String msg)
Description copied from interface: ChatProvider.ChatForwarder
Requests that the supplied broadcast message be delivered on other servers.

Specified by:
forwardBroadcast in interface ChatProvider.ChatForwarder

shutdown

public void shutdown()
Specified by:
shutdown in interface Lifecycle.ShutdownComponent
Overrides:
shutdown in class PeerManager

createNodeObject

protected NodeObject createNodeObject()
Description copied from class: PeerManager
Creates the appropriate derived class of NodeObject which will be registered with the distributed object system.

Overrides:
createNodeObject in class PeerManager

createClientInfo

protected ClientInfo createClientInfo()
Description copied from class: PeerManager
Creates a ClientInfo record which will subsequently be initialized by a call to PeerManager.initClientInfo(com.threerings.presents.server.PresentsSession, com.threerings.presents.peer.data.ClientInfo).

Overrides:
createClientInfo in class PeerManager

initClientInfo

protected void initClientInfo(PresentsSession client,
                              ClientInfo info)
Description copied from class: PeerManager
Initializes the supplied client info for the supplied client.

Overrides:
initClientInfo in class PeerManager

didInit

protected void didInit()
Description copied from class: PeerManager
Called after we have finished our initialization.

Overrides:
didInit in class PeerManager

authFromViz

protected abstract Name authFromViz(Name vizname)
Converts a visible name to an authentication name. If this method returns null, the chat system will act as if the vizname in question is not online.