use of com.jme3.network.Server in project jmonkeyengine by jMonkeyEngine.
the class SerializerRegistrationsMessage method registerAll.
public void registerAll() {
// See if we will have problems because our registry is locked
if (Serializer.isReadOnly()) {
// to disable the ServerSerializerRegistrationsServer anyway.
if (compiled != null) {
log.log(Level.INFO, "Skipping registration as registry is locked, presumably by a local server process.");
return;
}
}
log.log(Level.FINE, "Registering {0} classes...", registrations.length);
for (Registration reg : registrations) {
log.log(Level.INFO, "Registering:{0}", reg);
reg.register();
}
log.log(Level.FINE, "Done registering serializable classes.");
}
use of com.jme3.network.Server in project jmonkeyengine by jMonkeyEngine.
the class RmiHostedService method shareGlobal.
/**
* Shares a server-wide object associated with the specified name over the specified
* channel. All connections with RMI hosting started will have access to this shared
* object as soon as they connect and they will all share the same instance. It is up
* to the shared object to handle any multithreading that might be required.
* All network communcation associated with the shared object will be done over
* the specified channel.
*/
public <T> void shareGlobal(byte channel, String name, T object, Class<? super T> type) {
GlobalShare share = new GlobalShare(channel, object, type);
GlobalShare existing = globalShares.put(name, share);
if (existing != null) {
// Shouldn't need to do anything actually.
}
// Go through all of the children
for (HostedConnection conn : getServer().getConnections()) {
RmiRegistry child = getRmiRegistry(conn);
if (child == null) {
continue;
}
child.share(channel, name, object, type);
}
}
Aggregations