private final AtomicBoolean shutdownSignaled = new AtomicBoolean(false);
private final Map<String, String> users = Maps.newHashMap();
public static void main(String[] args) throws Exception
{
ExhibitorCreator creator;
try
{
creator = new ExhibitorCreator(args);
}
catch ( ExhibitorCreatorExit exit )
{
if ( exit.getError() != null )
{
System.err.println(exit.getError());
}
exit.getCli().printHelp();
return;
}
SecurityArguments securityArguments = new SecurityArguments(creator.getSecurityFile(), creator.getRealmSpec(), creator.getRemoteAuthSpec());
ExhibitorMain exhibitorMain = new ExhibitorMain
(
creator.getBackupProvider(),
creator.getConfigProvider(),
creator.getBuilder(),
creator.getHttpPort(),
creator.getSecurityHandler(),
securityArguments
);
setShutdown(exhibitorMain);
exhibitorMain.start();
try
{
exhibitorMain.join();
}
finally
{
exhibitorMain.close();
for ( Closeable closeable : creator.getCloseables() )
{
Closeables.closeQuietly(closeable);
}
}
}