Restructured things to work with the new mechanism for creating distributed
objects. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@53 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -24,6 +24,7 @@ package com.threerings.micasa.lobby;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
|
|
||||||
|
import com.threerings.crowd.data.PlaceObject;
|
||||||
import com.threerings.crowd.server.PlaceManager;
|
import com.threerings.crowd.server.PlaceManager;
|
||||||
import com.threerings.micasa.Log;
|
import com.threerings.micasa.Log;
|
||||||
|
|
||||||
@@ -44,8 +45,8 @@ public class LobbyManager extends PlaceManager
|
|||||||
_gameIdent = getConfigValue(config, "ugi");
|
_gameIdent = getConfigValue(config, "ugi");
|
||||||
_name = getConfigValue(config, "name");
|
_name = getConfigValue(config, "name");
|
||||||
|
|
||||||
// keep this for later
|
// let the lobby registry know that we're up and running
|
||||||
_lobreg = lobreg;
|
lobreg.lobbyReady(_plobj.getOid(), _gameIdent, _name);
|
||||||
|
|
||||||
Log.info("Lobby manager initialized [ident=" + _gameIdent +
|
Log.info("Lobby manager initialized [ident=" + _gameIdent +
|
||||||
", name=" + _name + "].");
|
", name=" + _name + "].");
|
||||||
@@ -64,19 +65,10 @@ public class LobbyManager extends PlaceManager
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override // from PlaceManager
|
||||||
protected Class getPlaceObjectClass ()
|
protected PlaceObject createPlaceObject ()
|
||||||
{
|
{
|
||||||
return LobbyObject.class;
|
return new LobbyObject();
|
||||||
}
|
|
||||||
|
|
||||||
// documentation inherited
|
|
||||||
protected void didStartup ()
|
|
||||||
{
|
|
||||||
super.didStartup();
|
|
||||||
|
|
||||||
// let the lobby registry know that we're up and running
|
|
||||||
_lobreg.lobbyReady(_plobj.getOid(), _gameIdent, _name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The universal game identifier for the game matchmade by this
|
/** The universal game identifier for the game matchmade by this
|
||||||
@@ -85,7 +77,4 @@ public class LobbyManager extends PlaceManager
|
|||||||
|
|
||||||
/** The human readable name of this lobby. */
|
/** The human readable name of this lobby. */
|
||||||
protected String _name;
|
protected String _name;
|
||||||
|
|
||||||
/** A reference to the lobby registry. */
|
|
||||||
protected LobbyRegistry _lobreg;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public class LobbyRegistry
|
|||||||
// lobbyReady() when it has obtained a reference to its lobby
|
// lobbyReady() when it has obtained a reference to its lobby
|
||||||
// object and is ready to roll
|
// object and is ready to roll
|
||||||
LobbyManager lobmgr = (LobbyManager)
|
LobbyManager lobmgr = (LobbyManager)
|
||||||
MiCasaServer.plreg.createPlace(config, null);
|
MiCasaServer.plreg.createPlace(config);
|
||||||
lobmgr.init(this, props);
|
lobmgr.init(this, props);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ import com.threerings.presents.server.InvocationManager;
|
|||||||
import com.threerings.crowd.data.BodyObject;
|
import com.threerings.crowd.data.BodyObject;
|
||||||
import com.threerings.crowd.data.PlaceObject;
|
import com.threerings.crowd.data.PlaceObject;
|
||||||
import com.threerings.crowd.server.PlaceManager;
|
import com.threerings.crowd.server.PlaceManager;
|
||||||
import com.threerings.crowd.server.PlaceRegistry.CreationObserver;
|
|
||||||
import com.threerings.crowd.server.PlaceRegistry;
|
import com.threerings.crowd.server.PlaceRegistry;
|
||||||
|
|
||||||
import com.threerings.parlor.game.data.GameAI;
|
import com.threerings.parlor.game.data.GameAI;
|
||||||
@@ -83,7 +82,7 @@ public class SimulatorManager
|
|||||||
new CreateGameTask(source, config, simClass, playerCount);
|
new CreateGameTask(source, config, simClass, playerCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreateGameTask implements CreationObserver
|
public class CreateGameTask
|
||||||
{
|
{
|
||||||
public CreateGameTask (
|
public CreateGameTask (
|
||||||
BodyObject source, GameConfig config, String simClass,
|
BodyObject source, GameConfig config, String simClass,
|
||||||
@@ -97,10 +96,8 @@ public class SimulatorManager
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// create the game manager and begin its initialization
|
// create the game manager and begin its initialization
|
||||||
// process. the game manager will take care of notifying
|
// process. the game manager will take care of notifying the
|
||||||
// the players that the game has been created once it has
|
// players that the game has been created
|
||||||
// been started up (which is done by the place registry
|
|
||||||
// once the game object creation has completed)
|
|
||||||
|
|
||||||
// configure the game config with the player names
|
// configure the game config with the player names
|
||||||
config.players = new Name[_playerCount];
|
config.players = new Name[_playerCount];
|
||||||
@@ -108,23 +105,16 @@ public class SimulatorManager
|
|||||||
for (int ii = 1; ii < _playerCount; ii++) {
|
for (int ii = 1; ii < _playerCount; ii++) {
|
||||||
config.players[ii] = new Name("simulant" + ii);
|
config.players[ii] = new Name("simulant" + ii);
|
||||||
}
|
}
|
||||||
|
_gmgr = (GameManager)_plreg.createPlace(config);
|
||||||
// we needn't hang around and wait for game object
|
|
||||||
// creation if it's just us
|
|
||||||
CreationObserver obs = (_playerCount == 1) ? null : this;
|
|
||||||
_gmgr = (GameManager)_plreg.createPlace(config, obs);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Unable to create game manager [e=" + e + "].");
|
Log.warning("Unable to create game manager [e=" + e + "].");
|
||||||
Log.logStackTrace(e);
|
Log.logStackTrace(e);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// documentation inherited
|
|
||||||
public void placeCreated (PlaceObject place, PlaceManager pmgr)
|
|
||||||
{
|
|
||||||
// cast the place to the game object for the game we're creating
|
// cast the place to the game object for the game we're creating
|
||||||
_gobj = (GameObject)place;
|
_gobj = (GameObject)_gmgr.getPlaceObject();
|
||||||
|
|
||||||
// determine the AI player skill level
|
// determine the AI player skill level
|
||||||
byte skill;
|
byte skill;
|
||||||
@@ -142,19 +132,15 @@ public class SimulatorManager
|
|||||||
// resolve the simulant body objects
|
// resolve the simulant body objects
|
||||||
ClientResolutionListener listener = new ClientResolutionListener()
|
ClientResolutionListener listener = new ClientResolutionListener()
|
||||||
{
|
{
|
||||||
public void clientResolved (Name username, ClientObject clobj)
|
public void clientResolved (Name username, ClientObject clobj) {
|
||||||
{
|
|
||||||
// hold onto the body object for later game creation
|
// hold onto the body object for later game creation
|
||||||
_sims.add(clobj);
|
_sims.add(clobj);
|
||||||
|
|
||||||
// create the game if we've received all body objects
|
// create the game if we've received all body objects
|
||||||
if (_sims.size() == (_playerCount - 1)) {
|
if (_sims.size() == (_playerCount - 1)) {
|
||||||
createSimulants();
|
createSimulants();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public void resolutionFailed (Name username, Exception cause) {
|
||||||
public void resolutionFailed (Name username, Exception cause)
|
|
||||||
{
|
|
||||||
Log.warning("Unable to create simulant body object " +
|
Log.warning("Unable to create simulant body object " +
|
||||||
"[error=" + cause + "].");
|
"[error=" + cause + "].");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,29 +26,30 @@ import com.threerings.presents.dobj.AttributeChangedEvent;
|
|||||||
|
|
||||||
import com.threerings.crowd.data.PlaceObject;
|
import com.threerings.crowd.data.PlaceObject;
|
||||||
import com.threerings.crowd.server.PlaceManager;
|
import com.threerings.crowd.server.PlaceManager;
|
||||||
import com.threerings.crowd.server.PlaceRegistry;
|
|
||||||
|
|
||||||
import com.threerings.parlor.game.data.GameObject;
|
import com.threerings.parlor.game.data.GameObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract convenience class used server-side to keep an eye on a game
|
* An abstract convenience class used server-side to keep an eye on a game and
|
||||||
* and perform a one-time game-over activity when the game ends. Classes
|
* perform a one-time game-over activity when the game ends. Classes that care
|
||||||
* that care to make use of the game watcher should create an instance,
|
* to make use of the game watcher should create an instance with their newly
|
||||||
* implement {@link #gameDidEnd}, and pass the instance to the place
|
* created {@link GameObject} and implement {@link #gameDidEnd}.
|
||||||
* registry in the call to {@link PlaceRegistry#createPlace} when the
|
|
||||||
* puzzle is created.
|
|
||||||
*/
|
*/
|
||||||
public abstract class GameWatcher
|
public abstract class GameWatcher
|
||||||
implements PlaceRegistry.CreationObserver, AttributeChangeListener
|
implements AttributeChangeListener
|
||||||
{
|
{
|
||||||
// documentation inherited
|
public void init (PlaceManager plmgr)
|
||||||
public void placeCreated (PlaceObject place, PlaceManager pmgr)
|
|
||||||
{
|
{
|
||||||
_gameobj = (GameObject)place;
|
init((GameObject)plmgr.getPlaceObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init (GameObject gameobj)
|
||||||
|
{
|
||||||
|
_gameobj = gameobj;
|
||||||
_gameobj.addListener(this);
|
_gameobj.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
// from interface AttributeChangeListener
|
||||||
public void attributeChanged (AttributeChangedEvent event)
|
public void attributeChanged (AttributeChangedEvent event)
|
||||||
{
|
{
|
||||||
if (event.getName().equals(GameObject.STATE)) {
|
if (event.getName().equals(GameObject.STATE)) {
|
||||||
@@ -66,8 +67,8 @@ public abstract class GameWatcher
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the game ends to give derived classes a chance to
|
* Called when the game ends to give derived classes a chance to engage in
|
||||||
* engage in their game-over antics.
|
* their game-over antics.
|
||||||
*/
|
*/
|
||||||
protected abstract void gameDidEnd (GameObject gameobj);
|
protected abstract void gameDidEnd (GameObject gameobj);
|
||||||
|
|
||||||
|
|||||||
@@ -206,13 +206,10 @@ public class ParlorManager
|
|||||||
invite.invitee.getVisibleName(),
|
invite.invitee.getVisibleName(),
|
||||||
invite.inviter.getVisibleName() };
|
invite.inviter.getVisibleName() };
|
||||||
|
|
||||||
// create the game manager and begin it's initialization
|
// create the game manager and begin it's initialization process;
|
||||||
// process. the game manager will take care of notifying the
|
// the game manager will take care of notifying the players that
|
||||||
// players that the game has been created once it has been
|
// the game has been created
|
||||||
// started up (which is done by the place registry once the
|
_plreg.createPlace(invite.config);
|
||||||
// game object creation has completed)
|
|
||||||
GameManager gmgr = (GameManager)
|
|
||||||
_plreg.createPlace(invite.config, null);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.warning("Unable to create game manager [invite=" + invite +
|
Log.warning("Unable to create game manager [invite=" + invite +
|
||||||
|
|||||||
@@ -181,14 +181,11 @@ public class ParlorProvider
|
|||||||
config.players = new Name[] { user.getVisibleName() };
|
config.players = new Name[] { user.getVisibleName() };
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the game manager and begin its initialization
|
// create the game manager and begin its initialization process
|
||||||
// process
|
CrowdServer.plreg.createPlace(config);
|
||||||
GameManager gmgr = (GameManager)
|
|
||||||
CrowdServer.plreg.createPlace(config, null);
|
|
||||||
|
|
||||||
// the game manager will take care of notifying the player
|
// the game manager will notify the player that their game is
|
||||||
// that the game has been created once it has been started up;
|
// "ready", but tell the caller that we processed their request
|
||||||
// but we let the caller know that we processed their request
|
|
||||||
listener.requestProcessed();
|
listener.requestProcessed();
|
||||||
|
|
||||||
} catch (InstantiationException ie) {
|
} catch (InstantiationException ie) {
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ import com.threerings.crowd.data.BodyObject;
|
|||||||
import com.threerings.crowd.data.PlaceObject;
|
import com.threerings.crowd.data.PlaceObject;
|
||||||
import com.threerings.crowd.server.CrowdServer;
|
import com.threerings.crowd.server.CrowdServer;
|
||||||
import com.threerings.crowd.server.PlaceManager;
|
import com.threerings.crowd.server.PlaceManager;
|
||||||
import com.threerings.crowd.server.PlaceRegistry;
|
|
||||||
|
|
||||||
import com.threerings.parlor.Log;
|
import com.threerings.parlor.Log;
|
||||||
import com.threerings.parlor.data.ParlorCodes;
|
import com.threerings.parlor.data.ParlorCodes;
|
||||||
@@ -261,14 +260,9 @@ public class TableManager
|
|||||||
// fill the players array into the game config
|
// fill the players array into the game config
|
||||||
table.config.players = table.getPlayers();
|
table.config.players = table.getPlayers();
|
||||||
|
|
||||||
PlaceRegistry.CreationObserver obs =
|
|
||||||
new PlaceRegistry.CreationObserver() {
|
|
||||||
public void placeCreated (PlaceObject plobj, PlaceManager pmgr) {
|
|
||||||
gameCreated(table, plobj);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
try {
|
try {
|
||||||
CrowdServer.plreg.createPlace(table.config, obs);
|
PlaceManager pmgr = CrowdServer.plreg.createPlace(table.config);
|
||||||
|
gameCreated(table, (GameObject)pmgr.getPlaceObject());
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
Log.warning("Failed to create manager for game " +
|
Log.warning("Failed to create manager for game " +
|
||||||
"[config=" + table.config + "]: " + t);
|
"[config=" + table.config + "]: " + t);
|
||||||
@@ -277,16 +271,16 @@ public class TableManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when our game has been created, we take this opportunity to
|
* Called when our game has been created, we take this opportunity to clean
|
||||||
* clean up the table and transition it to "in play" mode.
|
* up the table and transition it to "in play" mode.
|
||||||
*/
|
*/
|
||||||
protected void gameCreated (Table table, PlaceObject plobj)
|
protected void gameCreated (Table table, GameObject gameobj)
|
||||||
{
|
{
|
||||||
// update the table with the newly created game object
|
// update the table with the newly created game object
|
||||||
table.gameOid = plobj.getOid();
|
table.gameOid = gameobj.getOid();
|
||||||
|
|
||||||
// configure the privacy of the game
|
// configure the privacy of the game
|
||||||
((GameObject) plobj).setIsPrivate(table.tconfig.privateTable);
|
gameobj.setIsPrivate(table.tconfig.privateTable);
|
||||||
|
|
||||||
// clear the occupant to table mappings as this game is underway
|
// clear the occupant to table mappings as this game is underway
|
||||||
for (int i = 0; i < table.bodyOids.length; i++) {
|
for (int i = 0; i < table.bodyOids.length; i++) {
|
||||||
@@ -295,7 +289,7 @@ public class TableManager
|
|||||||
|
|
||||||
// add an object death listener to unmap the table when the game
|
// add an object death listener to unmap the table when the game
|
||||||
// finally goes away
|
// finally goes away
|
||||||
plobj.addListener(_gameDeathListener);
|
gameobj.addListener(_gameDeathListener);
|
||||||
|
|
||||||
// and then update the lobby object that contains the table
|
// and then update the lobby object that contains the table
|
||||||
_tlobj.updateTables(table);
|
_tlobj.updateTables(table);
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ import com.threerings.presents.server.InvocationManager;
|
|||||||
|
|
||||||
import com.threerings.crowd.data.PlaceConfig;
|
import com.threerings.crowd.data.PlaceConfig;
|
||||||
import com.threerings.crowd.server.CrowdServer;
|
import com.threerings.crowd.server.CrowdServer;
|
||||||
|
import com.threerings.crowd.server.PlaceManager;
|
||||||
|
import com.threerings.crowd.server.PlaceRegistry;
|
||||||
|
|
||||||
import com.threerings.whirled.Log;
|
import com.threerings.whirled.Log;
|
||||||
import com.threerings.whirled.data.Scene;
|
import com.threerings.whirled.data.Scene;
|
||||||
@@ -142,17 +144,16 @@ public class SceneRegistry
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Requests that the specified scene be resolved, which means loaded
|
* Requests that the specified scene be resolved, which means loaded into
|
||||||
* into the server and initialized if the scene is not currently
|
* the server and initialized if the scene is not currently active. The
|
||||||
* active. The supplied callback instance will be notified, on the
|
* supplied callback instance will be notified, on the dobjmgr thread, when
|
||||||
* dobjmgr thread, when the scene has been resolved. If the scene is
|
* the scene has been resolved. If the scene is already active, it will be
|
||||||
* already active, it will be notified immediately (before the call to
|
* notified immediately (before the call to {@link #resolveScene} returns).
|
||||||
* {@link #resolveScene} returns).
|
|
||||||
*
|
*
|
||||||
* @param sceneId the id of the scene to resolve.
|
* @param sceneId the id of the scene to resolve.
|
||||||
* @param target a reference to a callback instance that will be
|
* @param target a reference to a callback instance that will be notified
|
||||||
* notified when the scene has been resolved (which may be immediately
|
* when the scene has been resolved (which may be immediately if the scene
|
||||||
* if the scene is already active).
|
* is already active).
|
||||||
*/
|
*/
|
||||||
public void resolveScene (int sceneId, ResolutionListener target)
|
public void resolveScene (int sceneId, ResolutionListener target)
|
||||||
{
|
{
|
||||||
@@ -239,7 +240,7 @@ public class SceneRegistry
|
|||||||
* Called when the scene resolution has completed successfully.
|
* Called when the scene resolution has completed successfully.
|
||||||
*/
|
*/
|
||||||
protected void processSuccessfulResolution (
|
protected void processSuccessfulResolution (
|
||||||
SceneModel model, UpdateList updates)
|
SceneModel model, final UpdateList updates)
|
||||||
{
|
{
|
||||||
// now that the scene is loaded, we can create a scene manager for
|
// now that the scene is loaded, we can create a scene manager for
|
||||||
// it. that will be initialized by the place registry and when
|
// it. that will be initialized by the place registry and when
|
||||||
@@ -248,17 +249,21 @@ public class SceneRegistry
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// first create our scene instance
|
// first create our scene instance
|
||||||
Scene scene = _scfact.createScene(
|
final Scene scene = _scfact.createScene(
|
||||||
model, _confact.createPlaceConfig(model));
|
model, _confact.createPlaceConfig(model));
|
||||||
|
|
||||||
// now create our scene manager
|
// now create our scene manager
|
||||||
SceneManager scmgr = (SceneManager)
|
CrowdServer.plreg.createPlace(scene.getPlaceConfig(),
|
||||||
CrowdServer.plreg.createPlace(scene.getPlaceConfig(), null);
|
new PlaceRegistry.PreStartupHook() {
|
||||||
scmgr.setSceneData(scene, updates, this);
|
public void invoke (PlaceManager pmgr) {
|
||||||
|
((SceneManager)pmgr).setSceneData(
|
||||||
|
scene, updates, SceneRegistry.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// when the scene manager completes its startup procedings, it
|
// when the scene manager completes its startup procedings, it will
|
||||||
// will call back to the scene registry and let us know that
|
// call back to the scene registry and let us know that we can turn
|
||||||
// we can turn the penders loose
|
// the penders loose
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// so close, but no cigar
|
// so close, but no cigar
|
||||||
|
|||||||
@@ -462,11 +462,29 @@ public class SpotSceneManager extends SceneManager
|
|||||||
* one another.
|
* one another.
|
||||||
*/
|
*/
|
||||||
protected class ClusterRecord extends HashIntMap
|
protected class ClusterRecord extends HashIntMap
|
||||||
implements Subscriber
|
|
||||||
{
|
{
|
||||||
public ClusterRecord ()
|
public ClusterRecord ()
|
||||||
{
|
{
|
||||||
CrowdServer.omgr.createObject(ClusterObject.class, this);
|
_clobj = CrowdServer.omgr.registerObject(new ClusterObject());
|
||||||
|
_clusters.put(_clobj.getOid(), this);
|
||||||
|
|
||||||
|
// let any mapped users know about our cluster
|
||||||
|
Iterator iter = values().iterator();
|
||||||
|
while (iter.hasNext()) {
|
||||||
|
ClusteredBodyObject body = (ClusteredBodyObject)iter.next();
|
||||||
|
body.setClusterOid(_clobj.getOid());
|
||||||
|
_clobj.addToOccupants(((BodyObject)body).getOid());
|
||||||
|
}
|
||||||
|
|
||||||
|
// configure our cluster record and publish it
|
||||||
|
_cluster.clusterOid = _clobj.getOid();
|
||||||
|
_ssobj.addToClusters(_cluster);
|
||||||
|
|
||||||
|
// if we didn't manage to add our creating user when we first
|
||||||
|
// started up, there's no point in our sticking around
|
||||||
|
if (size() == 0) {
|
||||||
|
destroy(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean addBody (BodyObject body)
|
public boolean addBody (BodyObject body)
|
||||||
@@ -565,44 +583,6 @@ public class SpotSceneManager extends SceneManager
|
|||||||
return _cluster;
|
return _cluster;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void objectAvailable (DObject object)
|
|
||||||
{
|
|
||||||
// keep this feller around
|
|
||||||
_clobj = (ClusterObject)object;
|
|
||||||
_clusters.put(_clobj.getOid(), this);
|
|
||||||
|
|
||||||
// let any mapped users know about our cluster
|
|
||||||
Iterator iter = values().iterator();
|
|
||||||
while (iter.hasNext()) {
|
|
||||||
ClusteredBodyObject body = (ClusteredBodyObject)iter.next();
|
|
||||||
body.setClusterOid(_clobj.getOid());
|
|
||||||
_clobj.addToOccupants(((BodyObject)body).getOid());
|
|
||||||
}
|
|
||||||
|
|
||||||
// configure our cluster record and publish it
|
|
||||||
_cluster.clusterOid = _clobj.getOid();
|
|
||||||
_ssobj.addToClusters(_cluster);
|
|
||||||
|
|
||||||
// if we didn't manage to add our creating user when we first
|
|
||||||
// started up, there's no point in our sticking around
|
|
||||||
if (size() == 0) {
|
|
||||||
destroy(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void requestFailed (int oid, ObjectAccessException cause)
|
|
||||||
{
|
|
||||||
Log.warning("Aiya! Failed to create cluster object " +
|
|
||||||
"[cause=" + cause + ", penders=" + size() + "].");
|
|
||||||
|
|
||||||
// let any mapped users know that we're hosed
|
|
||||||
Iterator iter = values().iterator();
|
|
||||||
while (iter.hasNext()) {
|
|
||||||
ClusteredBodyObject body = (ClusteredBodyObject)iter.next();
|
|
||||||
body.setClusterOid(-1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[cluster=" + _cluster + ", size=" + size() + "]";
|
return "[cluster=" + _cluster + ", size=" + size() + "]";
|
||||||
|
|||||||
Reference in New Issue
Block a user