Add a main to PolicyServer that binds on the master port by default
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6541 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -44,6 +44,24 @@ import static com.threerings.NaryaLog.log;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class PolicyServer extends ConnectionManager
|
public class PolicyServer extends ConnectionManager
|
||||||
{
|
{
|
||||||
|
public static void main (String[] args)
|
||||||
|
{
|
||||||
|
int port = MASTER_PORT;
|
||||||
|
if (args.length > 0) {
|
||||||
|
port = Integer.parseInt(args[0]);
|
||||||
|
}
|
||||||
|
PolicyServer server = null;
|
||||||
|
try {
|
||||||
|
server = new PolicyServer(new Lifecycle());
|
||||||
|
} catch (IOException e) {
|
||||||
|
System.err.println("Failed to create policy server!");
|
||||||
|
e.printStackTrace(System.err);
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
server.init(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public PolicyServer (Lifecycle cycle)
|
public PolicyServer (Lifecycle cycle)
|
||||||
throws IOException
|
throws IOException
|
||||||
@@ -84,6 +102,7 @@ public class PolicyServer extends ConnectionManager
|
|||||||
super.willStart();
|
super.willStart();
|
||||||
if (!_acceptor.bind()) {
|
if (!_acceptor.bind()) {
|
||||||
log.warning("Policy server failed to bind!");
|
log.warning("Policy server failed to bind!");
|
||||||
|
shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user