Changeset 770
- Timestamp:
- 07/17/07 22:06:16 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/examples/service/RememberNameService.php
r751 r770 8 8 */ 9 9 10 stubClassLoader::load('net.stubbles.service.stubStatefulService');11 12 10 /** 13 11 * Simple service to demonstrate stateful services. 14 12 * 13 * @Inject(Session) 15 14 * @author Stephan Schmidt <schst@stubbles.net> 16 15 * @package stubbles_examples 17 16 * @subpackage service 18 17 */ 19 class RememberNameService implements stubStatefulService{18 class RememberNameService { 20 19 21 20 const SESSION_KEY_NAME = '__name__'; … … 28 27 private $session; 29 28 29 /** 30 * Inject the session 31 * 32 * @param stubSession $session 33 */ 30 34 public function setSession(stubSession $session) { 31 35 $this->session = $session; trunk/src/main/php/net/stubbles/websites/processors/stubJsonRpcProcessor.php
r765 r770 14 14 'net.stubbles.service.annotations.stubWebMethodAnnotation', 15 15 'net.stubbles.service.stubStatefulService', 16 'net.stubbles.util.encoding.stubEncodingHelper'); 16 'net.stubbles.util.encoding.stubEncodingHelper', 17 'net.stubbles.ioc.injection.injection'); 17 18 18 19 /** … … 216 217 217 218 $instance = $clazz->newInstance(); 218 if ($clazz->implementsInterface('stubStatefulService')) { 219 $instance->setSession($this->session); 220 } 219 $injectionMap = new stubInjectionMap(); 220 $injectionMap->addInjection('Session', $this->session); 221 222 stubInjectAnnotation::factory($injectionMap, $instance); 221 223 return $method->invokeArgs($instance, $params); 222 224 }
