factories.add(new LoginShardFactory());
factories.add(new MapShardFactory());
// finall create the container and hope it initializes itself without errors...
final ContainerFacade container;
try
{
container = new ContainerFacade(factories);
}
catch (Exception ex)
{
logger.error("Container failed to start up.", ex);
System.exit(0);
return;
}
// what happens when the server is shut down?
Runtime.getRuntime().addShutdownHook(new Thread()
{
@Override
public void run()
{
container.shutdown();
}
});
}