Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / tools / development / InstanceHolder.java
blobef15619689dbb6c810fdcc7a6c35f77bd870283b
1 package com.google.appengine.tools.development;
3 /**
4 * Holder for per server instance state.
5 */
6 interface InstanceHolder {
8 /**
9 * Returns the {@link ContainerService} for this instance.
11 ContainerService getContainerService();
13 /**
14 * Returns the id for this instance.
16 int getInstance();
18 /**
19 * Returns true if this is the main instance, meaning the load balancing
20 * instance for a {@link ManualServer} and the only instance for an
21 * {@link AutomaticServer}.
23 boolean isMainInstance();
25 /**
26 * Starts the instance.
28 void startUp() throws Exception;
30 /**
31 * Acquire a serving permit for this instance. This may block and have side effects such as
32 * sending a startUp request.
34 boolean acquireServingPermit();
36 /**
37 * Returns true if this instance is a load balancing server.
39 boolean isServerLoadBalancingServer();
41 /**
42 * Returns true if this instance expects an internally generated
43 * "_ah/start" requests to be sent.
45 boolean expectsGeneratedStartRequest();
47 /**
48 * Returns true if this instance is in the STOPPED state.
50 boolean isStopped();
52 /**
53 * Creates a network connection for this instance.
54 * @throws Exception
56 public void createConnection() throws Exception;