1 package com
.google
.appengine
.tools
.development
;
3 import com
.google
.appengine
.tools
.development
.AbstractServer
.InstanceHolder
;
8 * Holder for both configuration and runtime information for a single
9 * {@link DevAppServer} server and all its instances.
14 * Configure this {@link Server}.
16 * Note {@link #configure} fits into the {@link DevAppServer} startup
17 * sequence. The user may adjust {@link DevAppServer#setServiceProperties}
18 * values after construction and before calling {@link DevAppServer#start()}
19 * which calls {@link #configure}. To retain compatibility operations that
20 * make use of these user specified settings such as port selection must not
21 * not be performed during construction.
22 * @param containerConfigProperties container configuration properties.
25 void configure(Map
<String
, Object
>containerConfigProperties
) throws Exception
;
28 * Creates the network connections for this {@link Server}.
31 void createConnection() throws Exception
;
34 * Starts all the instances for this {@link Server}. Once this returns the
35 * {@link Server} can handle HTTP requests.
38 void startup() throws Exception
;
41 * Stops all the instances for this {@link Server}. Once this returns the
42 * {@link Server} cannot handle HTTP requests.
45 void shutdown() throws Exception
;
48 * Returns the name for this {@link Server}.
50 String
getServerName();
53 * Returns the {@link ContainerService} for the primary instance for this
56 ContainerService
getMainContainer();
59 * Returns the {@link LocalServerEnvironment} for the primary instance for
60 * this {@link Server}.
62 LocalServerEnvironment
getLocalServerEnvironment();
65 * Returns the host and port for the requested instance or null if the
66 * instance does not exist.
67 * @param instance The instance number or {@link LocalEnvironment#MAIN_INSTANCE}.
69 String
getHostAndPort(int instance
);
72 * Returns the requested {@link InstanceHolder} or null if the instance does
74 * @param instance the instance number or {@link LocalEnvironment#MAIN_INSTANCE}.
76 InstanceHolder
getInstanceHolder(int instance
);
79 * Returns true if the supplied instance is a load balancing server.
80 * @param instance the instance number or {@link LocalEnvironment#MAIN_INSTANCE}.
82 boolean isServerLoadBalancingServer(int instance
);
85 * Returns the number of instances for this server. This will return 0 for
86 * an {@link AutomaticServer}.
88 int getInstanceCount();
91 * Returns the id of an instance for the next request or -1 if there are no
94 int getFreeInstance();