File: classPassenger_1_1AbstractSpawnManager.html

package info (click to toggle)
passenger 2.2.11debian-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,576 kB
  • ctags: 28,138
  • sloc: cpp: 66,323; ruby: 9,646; ansic: 2,425; python: 141; sh: 56; makefile: 29
file content (191 lines) | stat: -rw-r--r-- 12,503 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Passenger: Passenger::AbstractSpawnManager Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespacePassenger.html">Passenger</a>::<a class="el" href="classPassenger_1_1AbstractSpawnManager.html">AbstractSpawnManager</a>
  </div>
</div>
<div class="contents">
<h1>Passenger::AbstractSpawnManager Class Reference<br>
<small>
[<a class="el" href="group__Support.html">Apache-independent support classes and function</a>]</small>
</h1><!-- doxytag: class="Passenger::AbstractSpawnManager" -->Spawning of application processes.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="AbstractSpawnManager_8h-source.html">AbstractSpawnManager.h</a>&gt;</code>
<p>
<div class="dynheader">
Inheritance diagram for Passenger::AbstractSpawnManager:</div>
<div class="dynsection">
<p><center><img src="classPassenger_1_1AbstractSpawnManager__inherit__graph.png" border="0" usemap="#Passenger_1_1AbstractSpawnManager__inherit__map" alt="Inheritance graph"></center>
<map name="Passenger_1_1AbstractSpawnManager__inherit__map">
<area shape="rect" href="classPassenger_1_1SpawnManager.html" title="An AbstractSpawnManager implementation." alt="" coords="31,80,220,107"></map>
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center></div>

<p>
<a href="classPassenger_1_1AbstractSpawnManager-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="namespacePassenger.html#ced1f248465136b313c6dec5fe6ca492">ProcessPtr</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1AbstractSpawnManager.html#6ca7efc68595bf962f5cce5e6407f176">spawn</a> (const <a class="el" href="structPassenger_1_1PoolOptions.html">PoolOptions</a> &amp;options)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Spawn a new application process.  <a href="#6ca7efc68595bf962f5cce5e6407f176"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1AbstractSpawnManager.html#5043681dbfb9b77fa0679c510ede853c">reload</a> (const string &amp;appRoot)=0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Shutdown the ApplicationSpawner server that's running at the given application root.  <a href="#5043681dbfb9b77fa0679c510ede853c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1AbstractSpawnManager.html#225574ef363847058554fde9d5704950">killSpawnServer</a> () const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Forcefully kill the spawn server.  <a href="#225574ef363847058554fde9d5704950"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual pid_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1AbstractSpawnManager.html#a630e8c364f391b54c0bfb723326836a">getServerPid</a> () const =0</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the spawn server's PID.  <a href="#a630e8c364f391b54c0bfb723326836a"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Spawning of application processes. 
<p>
An <a class="el" href="classPassenger_1_1AbstractSpawnManager.html" title="Spawning of application processes.">AbstractSpawnManager</a> is responsible for spawning new application processes. Use the <a class="el" href="classPassenger_1_1AbstractSpawnManager.html#6ca7efc68595bf962f5cce5e6407f176" title="Spawn a new application process.">spawn()</a> method to do so. <a class="el" href="classPassenger_1_1AbstractSpawnManager.html" title="Spawning of application processes.">AbstractSpawnManager</a> is guaranteed to be thread-safe.<p>
<a class="el" href="classPassenger_1_1AbstractSpawnManager.html" title="Spawning of application processes.">AbstractSpawnManager</a> is just an interface. There are two concrete implementations, namely <a class="el" href="classPassenger_1_1SpawnManager.html" title="An AbstractSpawnManager implementation.">SpawnManager</a> and StubSpawnManager. The former is the one that's usually used, while the latter exists for unit testing purposes. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a630e8c364f391b54c0bfb723326836a"></a><!-- doxytag: member="Passenger::AbstractSpawnManager::getServerPid" ref="a630e8c364f391b54c0bfb723326836a" args="() const =0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual pid_t Passenger::AbstractSpawnManager::getServerPid           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the spawn server's PID. 
<p>
Used within unit tests. 
<p>Implemented in <a class="el" href="classPassenger_1_1SpawnManager.html#f34df8cfccfc64507999f1b48bc5a126">Passenger::SpawnManager</a>.</p>

</div>
</div><p>
<a class="anchor" name="225574ef363847058554fde9d5704950"></a><!-- doxytag: member="Passenger::AbstractSpawnManager::killSpawnServer" ref="225574ef363847058554fde9d5704950" args="() const =0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Passenger::AbstractSpawnManager::killSpawnServer           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Forcefully kill the spawn server. 
<p>
This AbstractSpawnManager's state will not be modified, so that it won't know that the spawn server is killed until next time it sends a command to it.<p>
Used within unit tests. 
<p>Implemented in <a class="el" href="classPassenger_1_1SpawnManager.html#9210212c23c5a8ee5ee4dd5c9dcdf57d">Passenger::SpawnManager</a>.</p>

</div>
</div><p>
<a class="anchor" name="5043681dbfb9b77fa0679c510ede853c"></a><!-- doxytag: member="Passenger::AbstractSpawnManager::reload" ref="5043681dbfb9b77fa0679c510ede853c" args="(const string &amp;appRoot)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual void Passenger::AbstractSpawnManager::reload           </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>appRoot</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Shutdown the ApplicationSpawner server that's running at the given application root. 
<p>
This method should be called when it's time to reload an application.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a></em>&nbsp;</td><td>Unable to communicate with the spawn server, even after a restart. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a></em>&nbsp;</td><td>The spawn server died unexpectedly, and a restart was attempted, but it failed. </td></tr>
  </table>
</dl>

<p>Implemented in <a class="el" href="classPassenger_1_1SpawnManager.html#ad71b2ea9431f3286f23a6e6f80e0981">Passenger::SpawnManager</a>.</p>

</div>
</div><p>
<a class="anchor" name="6ca7efc68595bf962f5cce5e6407f176"></a><!-- doxytag: member="Passenger::AbstractSpawnManager::spawn" ref="6ca7efc68595bf962f5cce5e6407f176" args="(const PoolOptions &amp;options)=0" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="namespacePassenger.html#ced1f248465136b313c6dec5fe6ca492">ProcessPtr</a> Passenger::AbstractSpawnManager::spawn           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structPassenger_1_1PoolOptions.html">PoolOptions</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>options</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [pure virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Spawn a new application process. 
<p>
Spawning details are to be passed via the <code>options</code> argument.<p>
If the spawn server died during the spawning process, then the server will be automatically restarted, and another spawn attempt will be made. If restarting the server fails, or if the second spawn attempt fails, then an exception will be thrown.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>options</em>&nbsp;</td><td>An object containing the details for this spawn operation, such as which application to spawn. See <a class="el" href="structPassenger_1_1PoolOptions.html" title="This struct encapsulates information for ApplicationPool::get() and for SpawnManager::spawn()...">PoolOptions</a> for details. </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>A smart pointer to a <a class="el" href="classPassenger_1_1Process.html" title="Represents a single application process, as spawned by SpawnManager or by ApplicationPool::Interface...">Process</a> object, which represents the application process that has been spawned. Use this object to communicate with the spawned process. </dd></dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1SpawnException.html" title="Thrown when SpawnManager or ApplicationPool fails to spawn an application instance...">SpawnException</a></em>&nbsp;</td><td>Something went wrong. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>boost::thread_interrupted</em>&nbsp;</td><td></td></tr>
    <tr><td valign="top"></td><td valign="top"><em>Anything</em>&nbsp;</td><td>thrown by options.environmentVariables-&gt;getItems(). </td></tr>
  </table>
</dl>

<p>Implemented in <a class="el" href="classPassenger_1_1SpawnManager.html#88a94ba4d41dab492cb1dc8a0f998973">Passenger::SpawnManager</a>.</p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="AbstractSpawnManager_8h-source.html">AbstractSpawnManager.h</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Feb 21 12:22:48 2010 for Passenger by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>