1 | <?php |
||
38 | class ContextSession extends HashMap implements SessionInterface |
||
39 | { |
||
40 | |||
41 | /** |
||
42 | * The connection instances. |
||
43 | * |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $connections = null; |
||
47 | |||
48 | /** |
||
49 | * The session ID used for the connection. |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | protected $sessionId = null; |
||
54 | |||
55 | /** |
||
56 | * The servlet request to load the session ID used for the connection. |
||
57 | * |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $servletRequest = null; |
||
61 | |||
62 | /** |
||
63 | * Initializes the session with the connection. |
||
64 | * |
||
65 | * @param \AppserverIo\RemoteMethodInvocation\ConnectionInterface $connection The connection for the session |
||
66 | */ |
||
67 | public function __construct(ConnectionInterface $connection) |
||
79 | |||
80 | /** |
||
81 | * Re-Attaches the beans bound to this session to the container. |
||
82 | * |
||
83 | * @return void |
||
84 | */ |
||
85 | public function __destruct() |
||
89 | |||
90 | /** |
||
91 | * Clean-Up the session context by re-attaching the |
||
92 | * session beans to the container. |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | protected function cleanUp() |
||
119 | |||
120 | /** |
||
121 | * Injects the servlet request to load the session ID, for the remote method call, from. |
||
122 | * |
||
123 | * @param \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest The servlet request instance to inject |
||
124 | * |
||
125 | * @return void |
||
126 | */ |
||
127 | public function injectServletRequest(HttpServletRequestInterface $servletRequest) |
||
131 | |||
132 | /** |
||
133 | * Returns the servlet request instance to load the session ID from. |
||
134 | * |
||
135 | * @return \AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The servlet request instance |
||
136 | */ |
||
137 | public function getServletRequest() |
||
141 | |||
142 | /** |
||
143 | * Add's the passed connection to the session's connection collection. |
||
144 | * |
||
145 | * @param \AppserverIo\RemoteMethodInvocation\ConnectionInterface $connection The connection instance to add |
||
146 | * |
||
147 | * @return void |
||
148 | */ |
||
149 | public function addConnection(ConnectionInterface $connection) |
||
153 | |||
154 | /** |
||
155 | * Returns the collection with the session's connections. |
||
156 | * |
||
157 | * @return array The collection with the session's connections |
||
158 | */ |
||
159 | public function getConnections() |
||
163 | |||
164 | /** |
||
165 | * Returns the connection instance. |
||
166 | * |
||
167 | * @param integer $key The key of the connection to return |
||
168 | * |
||
169 | * @return \AppserverIo\RemoteMethodInvocation\ConnectionInterface The connection instance |
||
170 | */ |
||
171 | public function getConnection($key = 0) |
||
175 | |||
176 | /** |
||
177 | * Returns the ID of the session to use for connecting to the SFSBs. |
||
178 | * |
||
179 | * @return string The session ID |
||
180 | * @see \AppserverIo\RemoteMethodInvocation\SessionInterface::getSessionId() |
||
181 | */ |
||
182 | public function getSessionId() |
||
199 | |||
200 | /** |
||
201 | * The session ID to use. |
||
202 | * |
||
203 | * @param string $sessionId The session ID to use |
||
204 | * |
||
205 | * @return void |
||
206 | */ |
||
207 | public function setSessionId($sessionId) |
||
211 | |||
212 | /** |
||
213 | * Invokes the remote method over the connection. |
||
214 | * |
||
215 | * @param \AppserverIo\RemoteMethodInvocation\RemoteMethodInterface $remoteMethod The remote method call to invoke |
||
216 | * |
||
217 | * @return mixed the method return value |
||
218 | * @see AppserverIo\RemoteMethodInvocation\SessionInterface::send() |
||
219 | * @todo Refactor to replace check for 'setSession' method, e. g. check for an interface |
||
220 | */ |
||
221 | public function send(RemoteMethodInterface $remoteMethod) |
||
244 | |||
245 | /** |
||
246 | * Creates a remote initial context instance. |
||
247 | * |
||
248 | * @return \AppserverIo\RemoteMethodInvocation\RemoteObjectInterface The proxy for the initial context |
||
249 | * @see \AppserverIo\RemoteMethodInvocation\SessionInterface::createInitialContext() |
||
250 | */ |
||
251 | public function createInitialContext() |
||
257 | } |
||
258 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: