1 package com
.google
.appengine
.tools
.development
;
6 * Holder for both configuration and runtime information for a single
7 * {@link DevAppServer} server and all its instances.
12 * Configure this {@link Server}.
14 * Note {@link #configure} fits into the {@link DevAppServer} startup
15 * sequence. The user may adjust {@link DevAppServer#setServiceProperties}
16 * values after construction and before calling {@link DevAppServer#start()}
17 * which calls {@link #configure}. To retain compatibility operations that
18 * make use of these user specified settings such as port selection must not
19 * not be performed during construction.
20 * @param containerConfigProperties container configuration properties.
23 void configure(Map
<String
, Object
>containerConfigProperties
) throws Exception
;
26 * Creates the network connections for this {@link Server}.
29 void createConnection() throws Exception
;
32 * Starts all the instances for this {@link Server}. Once this returns the
33 * {@link Server} can handle HTTP requests.
36 void startup() throws Exception
;
39 * Stops all the instances for this {@link Server}. Once this returns the
40 * {@link Server} cannot handle HTTP requests.
43 void shutdown() throws Exception
;
46 * Simulates stopping the server in production.
48 * @throws UnsupportedOperationException if this is not a manual server.
51 void stopServing() throws Exception
;
54 * Simulates starting the server in production.
56 * @throws UnsupportedOperationException if this is not a manual server.
59 void startServing() throws Exception
;
62 * Returns the name for this {@link Server}.
64 String
getServerName();
67 * Returns the {@link ContainerService} for the primary instance for this
70 ContainerService
getMainContainer();
73 * Returns the {@link LocalServerEnvironment} for the primary instance for
74 * this {@link Server}.
76 LocalServerEnvironment
getLocalServerEnvironment();
79 * Returns the host and port for the requested instance or null if the
80 * instance does not exist.
81 * @param instance The instance number or {@link LocalEnvironment#MAIN_INSTANCE}.
83 String
getHostAndPort(int instance
);
86 * Returns the requested {@link InstanceHolder} or null if the instance does
88 * @param instance the instance number or {@link LocalEnvironment#MAIN_INSTANCE}.
90 InstanceHolder
getInstanceHolder(int instance
);
93 * Returns the number of instances for this server. This will return 0 for
94 * an {@link AutomaticServer}.
96 int getInstanceCount();
99 * Acquires a serving permit and returns an {@link InstanceHolder} for an
100 * instance which is available to handle a request or returns null if there
101 * is no such instance.
103 * throws {@link UnsupportedOperationException} unless this is a
104 * {@link ManualServer}.
106 InstanceHolder
getAndReserveAvailableInstanceHolder();