public class BroadcastCreator extends NetworkNodeDispatcher
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<NetworkNode> |
pool
Internal data
|
protected ThreadInvokingReceiver |
receiver |
log, messageDisp, startables
Constructor and Description |
---|
BroadcastCreator(MessageDispatcher messageDisp,
Startable[] startables)
Creates a new "passive" or "active" instance of NetworkNodePool
|
Modifier and Type | Method and Description |
---|---|
protected void |
activate(java.util.Set<NetworkNode> newPool,
boolean sendUsed)
Internal handler used to change from passive (not used) to active (used) state
|
NetworkNode |
create()
Initialize one of registered free servers, so they can be used
|
protected void |
finalize()
Send "I'm used" message on cleanup to remove from other pools
|
boolean |
isActive()
Returns operation mode of the pool (active or passive)
|
void |
receive(MessageActivate msg)
"Use" message recieving
|
void |
receive(MessageImHere msg)
"I'm here" message recieving
|
void |
receive(MessageImUsed msg)
"I'm used" message recieving
|
void |
setMessageDispatcher(MessageDispatcher messageDisp)
Setter of message dispatcher for deserialization method
|
start
protected java.util.Set<NetworkNode> pool
protected transient ThreadInvokingReceiver receiver
public BroadcastCreator(MessageDispatcher messageDisp, Startable[] startables) throws java.lang.InstantiationException
java.lang.InstantiationException
public boolean isActive()
protected void finalize() throws java.lang.Throwable, java.io.IOException
finalize
in class java.lang.Object
java.lang.Throwable
java.io.IOException
public void setMessageDispatcher(MessageDispatcher messageDisp)
NetworkNodeDispatcher
setMessageDispatcher
in class NetworkNodeDispatcher
protected void activate(java.util.Set<NetworkNode> newPool, boolean sendUsed) throws java.io.IOException, CantStartException
java.io.IOException
CantStartException
public NetworkNode create() throws java.lang.InstantiationException
create
in class NetworkNodeDispatcher
java.lang.InstantiationException
public void receive(MessageActivate msg) throws java.io.IOException
java.io.IOException
public void receive(MessageImHere msg) throws java.io.IOException
java.io.IOException
public void receive(MessageImUsed msg) throws java.io.IOException
java.io.IOException