More style-related cleanup.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5247 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-22 12:51:17 +00:00
parent 0aa0e48c28
commit 09f8a25876
29 changed files with 48 additions and 64 deletions
@@ -56,8 +56,7 @@ public class AdminDispatcher extends InvocationDispatcher<AdminMarshaller>
switch (methodId) {
case AdminMarshaller.GET_CONFIG_INFO:
((AdminProvider)provider).getConfigInfo(
source,
(AdminService.ConfigInfoListener)args[0]
source, (AdminService.ConfigInfoListener)args[0]
);
return;
@@ -115,6 +115,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
return new DatabaseObjectRecord(path, object);
}
/** Stores settings in a database. */
protected class DatabaseObjectRecord extends ObjectRecord
{
public DatabaseObjectRecord (String path, DObject object)
@@ -134,7 +135,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
_data = _repo.loadConfig(_node, _path);
} catch (PersistenceException pe) {
log.warning("Failed to load object configuration [path=" + _path + "].", pe);
_data = new HashMap<String,String>();
_data = new HashMap<String, String>();
}
super.init();
@@ -321,7 +322,7 @@ public class DatabaseConfigRegistry extends ConfigRegistry
}
protected String _path;
protected HashMap<String,String> _data;
protected HashMap<String, String> _data;
}
protected ConfigRepository _repo;
@@ -59,6 +59,7 @@ public class PeeredDatabaseConfigRegistry extends DatabaseConfigRegistry
return new PeerDatabaseObjectRecord(path, object);
}
/** Stores settings in a database and broadcasts changes to peers. */
protected class PeerDatabaseObjectRecord extends DatabaseObjectRecord
implements PeerManager.StaleCacheObserver
{
@@ -71,8 +72,8 @@ public class PeeredDatabaseConfigRegistry extends DatabaseConfigRegistry
// from interface PeerManager.StaleCacheObserver
public void changedCacheData (Streamable data)
{
@SuppressWarnings("unchecked") StreamableTuple<String,Object> change =
(StreamableTuple<String,Object>)data;
@SuppressWarnings("unchecked") StreamableTuple<String, Object> change =
(StreamableTuple<String, Object>)data;
// note that we should ignore the attribute change event we're about to generate
// because it is not a real configuration change but rather a sync
@@ -112,7 +113,7 @@ public class PeeredDatabaseConfigRegistry extends DatabaseConfigRegistry
{
// broadcast to the other nodes that this value has changed
_peermgr.broadcastStaleCacheData(
PEER_CACHE_PREFIX + _path, new StreamableTuple<String,Object>(field, value));
PEER_CACHE_PREFIX + _path, new StreamableTuple<String, Object>(field, value));
}
protected ArrayList<String> _pendingSyncs = new ArrayList<String>();
@@ -48,7 +48,7 @@ public class ConfigRepository extends DepotRepository
*
* @return a map containing field/value pairs for all stored configuration data.
*/
public HashMap<String,String> loadConfig (String node, String object)
public HashMap<String, String> loadConfig (String node, String object)
throws PersistenceException
{
HashMap<String, String> data = new HashMap<String, String>();
@@ -21,7 +21,6 @@
package com.threerings.bureau.client;
import com.threerings.bureau.client.BureauReceiver;
import com.threerings.presents.client.InvocationDecoder;
/**
@@ -55,29 +55,25 @@ public class BureauDispatcher extends InvocationDispatcher<BureauMarshaller>
switch (methodId) {
case BureauMarshaller.AGENT_CREATED:
((BureauProvider)provider).agentCreated(
source,
((Integer)args[0]).intValue()
source, ((Integer)args[0]).intValue()
);
return;
case BureauMarshaller.AGENT_CREATION_FAILED:
((BureauProvider)provider).agentCreationFailed(
source,
((Integer)args[0]).intValue()
source, ((Integer)args[0]).intValue()
);
return;
case BureauMarshaller.AGENT_DESTROYED:
((BureauProvider)provider).agentDestroyed(
source,
((Integer)args[0]).intValue()
source, ((Integer)args[0]).intValue()
);
return;
case BureauMarshaller.BUREAU_INITIALIZED:
((BureauProvider)provider).bureauInitialized(
source,
(String)args[0]
source, (String)args[0]
);
return;
@@ -21,6 +21,7 @@
package com.threerings.bureau.server;
import com.threerings.bureau.client.BureauService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationProvider;
@@ -22,7 +22,6 @@
package com.threerings.bureau.server;
import com.threerings.bureau.client.BureauDecoder;
import com.threerings.bureau.client.BureauReceiver;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationSender;
@@ -1260,8 +1260,8 @@ public class ChatDirector extends BasicDirector
}
// clear out from the history any tells that are mistypes
for (Iterator iter = _history.iterator(); iter.hasNext(); ) {
String hist = (String)iter.next();
for (Iterator<String> iter = _history.iterator(); iter.hasNext(); ) {
String hist = iter.next();
if (hist.startsWith("/" + command)) {
String harg = hist.substring(command.length() + 1).trim();
// we blow away any historic tells that have msg content
@@ -58,22 +58,19 @@ public class ChatDispatcher extends InvocationDispatcher<ChatMarshaller>
switch (methodId) {
case ChatMarshaller.AWAY:
((ChatProvider)provider).away(
source,
(String)args[0]
source, (String)args[0]
);
return;
case ChatMarshaller.BROADCAST:
((ChatProvider)provider).broadcast(
source,
(String)args[0], (InvocationService.InvocationListener)args[1]
source, (String)args[0], (InvocationService.InvocationListener)args[1]
);
return;
case ChatMarshaller.TELL:
((ChatProvider)provider).tell(
source,
(Name)args[0], (String)args[1], (ChatService.TellListener)args[2]
source, (Name)args[0], (String)args[1], (ChatService.TellListener)args[2]
);
return;
@@ -55,8 +55,7 @@ public class SpeakDispatcher extends InvocationDispatcher<SpeakMarshaller>
switch (methodId) {
case SpeakMarshaller.SPEAK:
((SpeakProvider)provider).speak(
source,
(String)args[0], ((Byte)args[1]).byteValue()
source, (String)args[0], ((Byte)args[1]).byteValue()
);
return;
@@ -21,6 +21,7 @@
package com.threerings.crowd.chat.server;
import com.threerings.crowd.chat.client.SpeakService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationProvider;
@@ -21,7 +21,6 @@
package com.threerings.crowd.client;
import com.threerings.crowd.client.LocationReceiver;
import com.threerings.presents.client.InvocationDecoder;
/**
@@ -154,14 +154,14 @@ public abstract class PlaceController extends Controller
// keep a handle on our place object
_plobj = plobj;
if (_view != null ) {
if (_view != null) {
// let the UI hierarchy know that we've got our place
PlaceViewUtil.dispatchWillEnterPlace(_view, plobj);
// and display the user interface
_ctx.setPlaceView(_view);
}
// let our delegates know what's up
// let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) {
@@ -183,7 +183,7 @@ public abstract class PlaceController extends Controller
*/
public void mayLeavePlace (final PlaceObject plobj)
{
// let our delegates know what's up
// let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) {
@@ -201,7 +201,7 @@ public abstract class PlaceController extends Controller
*/
public void didLeavePlace (final PlaceObject plobj)
{
// let our delegates know what's up
// let our delegates know what's up
applyToDelegates(new DelegateOp(PlaceControllerDelegate.class) {
@Override
public void apply (PlaceControllerDelegate delegate) {
@@ -210,7 +210,7 @@ public abstract class PlaceController extends Controller
});
// let the UI hierarchy know that we're outta here
if (_view != null ) {
if (_view != null) {
PlaceViewUtil.dispatchDidLeavePlace(_view, plobj);
_ctx.clearPlaceView(_view);
_view = null;
@@ -64,7 +64,7 @@ public interface PlaceView
*
* @param plobj the place object that was just entered.
*/
public void willEnterPlace (PlaceObject plobj);
void willEnterPlace (PlaceObject plobj);
/**
* Called after the client has left a place and needs to clean up
@@ -72,5 +72,5 @@ public interface PlaceView
*
* @param plobj the place object that was just left.
*/
public void didLeavePlace (PlaceObject plobj);
void didLeavePlace (PlaceObject plobj);
}
@@ -26,8 +26,6 @@ import com.threerings.util.Name;
import com.threerings.presents.dobj.DSet;
import com.threerings.crowd.data.BodyObject;
/**
* The occupant info object contains all of the information about an occupant of a place that
* should be shared with other occupants of the place. These objects are stored in the place object
@@ -38,12 +38,11 @@ public interface CrowdPeerService extends InvocationService
* Used to forward a tell request to the server on which the destination user actually
* occupies.
*/
public void deliverTell (Client client, UserMessage message, Name target,
ChatService.TellListener listener);
void deliverTell (Client client, UserMessage message, Name target,
ChatService.TellListener listener);
/**
* Dispatches a broadcast message on this peer.
*/
public void deliverBroadcast (
Client client, Name from, String bundle, String msg, boolean attention);
void deliverBroadcast (Client client, Name from, String bundle, String msg, boolean attention);
}
@@ -58,15 +58,13 @@ public class CrowdPeerDispatcher extends InvocationDispatcher<CrowdPeerMarshalle
switch (methodId) {
case CrowdPeerMarshaller.DELIVER_BROADCAST:
((CrowdPeerProvider)provider).deliverBroadcast(
source,
(Name)args[0], (String)args[1], (String)args[2], ((Boolean)args[3]).booleanValue()
source, (Name)args[0], (String)args[1], (String)args[2], ((Boolean)args[3]).booleanValue()
);
return;
case CrowdPeerMarshaller.DELIVER_TELL:
((CrowdPeerProvider)provider).deliverTell(
source,
(UserMessage)args[0], (Name)args[1], (ChatService.TellListener)args[2]
source, (UserMessage)args[0], (Name)args[1], (ChatService.TellListener)args[2]
);
return;
@@ -23,6 +23,7 @@ package com.threerings.crowd.peer.server;
import com.threerings.crowd.chat.client.ChatService;
import com.threerings.crowd.chat.data.UserMessage;
import com.threerings.crowd.peer.client.CrowdPeerService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationException;
import com.threerings.presents.server.InvocationProvider;
@@ -55,8 +55,7 @@ public class BodyDispatcher extends InvocationDispatcher<BodyMarshaller>
switch (methodId) {
case BodyMarshaller.SET_IDLE:
((BodyProvider)provider).setIdle(
source,
((Boolean)args[0]).booleanValue()
source, ((Boolean)args[0]).booleanValue()
);
return;
@@ -48,7 +48,7 @@ public class BodyManager
* @return true if changes were made and thus the object should be published anew to the
* place object, false if no publish should be done.
*/
public boolean update (OccupantInfo oinfo);
boolean update (OccupantInfo oinfo);
}
/**
@@ -21,6 +21,7 @@
package com.threerings.crowd.server;
import com.threerings.crowd.client.BodyService;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationProvider;
@@ -56,14 +56,13 @@ public class LocationDispatcher extends InvocationDispatcher<LocationMarshaller>
switch (methodId) {
case LocationMarshaller.LEAVE_PLACE:
((LocationProvider)provider).leavePlace(
source
source
);
return;
case LocationMarshaller.MOVE_TO:
((LocationProvider)provider).moveTo(
source,
((Integer)args[0]).intValue(), (LocationService.MoveListener)args[1]
source, ((Integer)args[0]).intValue(), (LocationService.MoveListener)args[1]
);
return;
@@ -22,7 +22,6 @@
package com.threerings.crowd.server;
import com.threerings.crowd.client.LocationDecoder;
import com.threerings.crowd.client.LocationReceiver;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.server.InvocationSender;
@@ -92,7 +92,7 @@ public class PlaceManager
* @param event the message event received.
* @param pmgr the place manager for which the message is being handled.
*/
public void handleEvent (MessageEvent event, PlaceManager pmgr);
void handleEvent (MessageEvent event, PlaceManager pmgr);
}
/**
@@ -667,7 +667,7 @@ public class PlaceManager
_shutdownInterval = new Interval(_omgr) {
@Override
public void expired () {
log.debug("Unloading idle place '" + where () + "'.");
log.debug("Unloading idle place '" + where() + "'.");
shutdown();
}
};
@@ -735,7 +735,7 @@ public class PlaceManager
protected PlaceConfig _config;
/** Message handlers are used to process message events. */
protected Map<String,MessageHandler> _msghandlers;
protected Map<String, MessageHandler> _msghandlers;
/** A list of the delegates in use by this manager. */
protected List<PlaceManagerDelegate> _delegates;
@@ -53,7 +53,7 @@ public class PlaceRegistry
/** Used in conjunction with {@link #createPlace}. */
public static interface PreStartupHook
{
public void invoke (PlaceManager plmgr);
void invoke (PlaceManager plmgr);
}
/**
@@ -87,7 +87,7 @@ public class PlaceRegistry
/**
* Creates and registers a new place manager with no delegates.
*
* @see #createPlace(PlaceConfig,List<PlaceManagerDelegate>)
* @see #createPlace(PlaceConfig,List)
*/
public PlaceManager createPlace (PlaceConfig config)
throws InstantiationException, InvocationException
@@ -56,15 +56,13 @@ public class PeerDispatcher extends InvocationDispatcher<PeerMarshaller>
switch (methodId) {
case PeerMarshaller.INVOKE_ACTION:
((PeerProvider)provider).invokeAction(
source,
(byte[])args[0]
source, (byte[])args[0]
);
return;
case PeerMarshaller.RATIFY_LOCK_ACTION:
((PeerProvider)provider).ratifyLockAction(
source,
(NodeObject.Lock)args[0], ((Boolean)args[1]).booleanValue()
source, (NodeObject.Lock)args[0], ((Boolean)args[1]).booleanValue()
);
return;
@@ -22,6 +22,7 @@
package com.threerings.presents.peer.server;
import com.threerings.presents.data.ClientObject;
import com.threerings.presents.peer.client.PeerService;
import com.threerings.presents.peer.data.NodeObject;
import com.threerings.presents.server.InvocationProvider;
@@ -54,8 +54,7 @@ public class TimeBaseDispatcher extends InvocationDispatcher<TimeBaseMarshaller>
switch (methodId) {
case TimeBaseMarshaller.GET_TIME_OID:
((TimeBaseProvider)provider).getTimeOid(
source,
(String)args[0], (TimeBaseService.GotTimeBaseListener)args[1]
source, (String)args[0], (TimeBaseService.GotTimeBaseListener)args[1]
);
return;