Spawner.OutOfResources
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,SpawnerListener> |
listeners
Registered server listeners
|
private static java.util.logging.Logger |
LOG
Logger
|
private static Spawner |
spawner
Instance of Spawner
|
Modifier | Constructor and Description |
---|---|
private |
SpawnerImpl()
Register a Remote Object Server.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.String uuid,
SpawnerListener listener)
Add listener.
|
java.lang.Object |
allocateClient(java.lang.String uuid)
Allocates the system resources for the spawned client if it is necessarily.
|
void |
clientIsReady(java.lang.String uuid,
java.lang.Object data)
Notify when the client has started.
|
java.lang.Object |
exportData(java.lang.String uuid)
Depending on the implementation, export custom data from the server back to the client.
|
static Spawner |
getInstance()
Get the Spawner instance.
|
TemporaryClient |
getTemporaryClient(java.lang.String uuid)
Get a
TemporaryClient worker which will do the work after authenticating on the P2J
server using the temporary credentials. |
void |
releaseClient(java.lang.String uuid)
Releases the system resources for this spawned client.
|
void |
removeListener(java.lang.String uuid)
Remove listener.
|
private static final java.util.logging.Logger LOG
private static final Spawner spawner
private java.util.Map<java.lang.String,SpawnerListener> listeners
public static Spawner getInstance()
public void clientIsReady(java.lang.String uuid, java.lang.Object data)
clientIsReady
in interface Spawner
uuid
- Remote client assigned identifier.data
- Custom data sent by the P2J client back to the server.public java.lang.Object exportData(java.lang.String uuid)
exportData
in interface Spawner
uuid
- Remote client assigned identifier.public TemporaryClient getTemporaryClient(java.lang.String uuid)
TemporaryClient
worker which will do the work after authenticating on the P2J
server using the temporary credentials.getTemporaryClient
in interface Spawner
uuid
- Remote client assigned identifier.public void addListener(java.lang.String uuid, SpawnerListener listener)
uuid
- Remote client assigned identifier.listener
- Listener instance to add.public void removeListener(java.lang.String uuid)
uuid
- Remote client assigned identifier.public java.lang.Object allocateClient(java.lang.String uuid) throws Spawner.OutOfResources
allocateClient
in interface Spawner
uuid
- Remote client assigned identifier.OutOfResources
- If the required resources can't be allocated.Spawner.OutOfResources
public void releaseClient(java.lang.String uuid)
Spawner
releaseClient
in interface Spawner
uuid
- Remote client assigned identifier.