From: Roland Häder Date: Sat, 24 Apr 2010 02:04:04 +0000 (+0000) Subject: More widen interface ProtocolHandler (which should be extended by listener and writer... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c89cdd982baa6d3941f829f3916785e7069c4214;p=core.git More widen interface ProtocolHandler (which should be extended by listener and writer interfaces) applied --- diff --git a/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php b/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php index fbd5daa8..6eeeb153 100644 --- a/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php +++ b/inc/classes/exceptions/socket/class_NoSocketRegisteredException.php @@ -25,14 +25,14 @@ class NoSocketRegisteredException extends FrameworkException { /** * A Constructor for this exception * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @param $code Error code * @return void */ - public function __construct (Listenable $listenerInstance, $code) { + public function __construct (ProtocolHandler $protocolInstance, $code) { // Construct the message $message = sprintf("[%s:] Requested socket is not yet registered.", - $listenerInstance->__toString() + $protocolInstance->__toString() ); // Call parent exception constructor diff --git a/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php b/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php index a9757483..14efd131 100644 --- a/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php +++ b/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php @@ -26,30 +26,30 @@ interface RegisterableSocket extends Registerable { * Checks wether given socket resource is registered. If $socketResource is * false only the instance will be checked. * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @param $socketResource A valid socket resource * @return $isRegistered Wether the given socket resource is registered */ - function isSocketRegistered (Listenable $listenerInstance, $socketResource); + function isSocketRegistered (ProtocolHandler $protocolInstance, $socketResource); /** * Registeres given socket for listener or throws an exception if it is already registered * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @param $socketResource A valid socket resource * @return void * @throws SocketAlreadyRegisteredException If the given socket is already registered */ - function registerSocket (Listenable $listenerInstance, $socketResource); + function registerSocket (ProtocolHandler $protocolInstance, $socketResource); /** * Getter for given listener's socket resource * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @return $socketResource A valid socket resource * @throws NoSocketRegisteredException If the requested socket is not registered */ - function getSocketResource (Listenable $listenerInstance); + function getSocketResource (ProtocolHandler $protocolInstance); } // [EOF] diff --git a/inc/classes/main/registry/socket/class_SocketRegistry.php b/inc/classes/main/registry/socket/class_SocketRegistry.php index b23086f8..9686826b 100644 --- a/inc/classes/main/registry/socket/class_SocketRegistry.php +++ b/inc/classes/main/registry/socket/class_SocketRegistry.php @@ -61,27 +61,27 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke * Checks wether given socket resource is registered. If $socketResource is * false only the instance will be checked. * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @param $socketResource A valid socket resource * @return $isRegistered Wether the given socket resource is registered */ - public function isSocketRegistered (Listenable $listenerInstance, $socketResource) { + public function isSocketRegistered (ProtocolHandler $protocolInstance, $socketResource) { $this->partialStub('Not yet implemented.'); } /** * Registeres given socket for listener or throws an exception if it is already registered * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @param $socketResource A valid socket resource * @throws SocketAlreadyRegisteredException If the given socket is already registered * @return void */ - public function registerSocket (Listenable $listenerInstance, $socketResource) { + public function registerSocket (ProtocolHandler $protocolInstance, $socketResource) { // Is the socket already registered? - if ($this->isSocketRegistered($listenerInstance, $socketResource)) { + if ($this->isSocketRegistered($protocolInstance, $socketResource)) { // Throw the exception - throw new SocketAlreadyRegisteredException($listenerInstance, BaseListener::EXCEPTION_SOCKET_ALREADY_REGISTERED); + throw new SocketAlreadyRegisteredException($protocolInstance, BaseListener::EXCEPTION_SOCKET_ALREADY_REGISTERED); } // END - if $this->partialStub('Not yet implemented.'); @@ -90,15 +90,15 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke /** * Getter for given listener's socket resource * - * @param $listenerInstance An instance of a Listenable class + * @param $protocolInstance An instance of a ProtocolHandler class * @return $socketResource A valid socket resource * @throws NoSocketRegisteredException If the requested socket is not registered */ - public function getSocketResource (Listenable $listenerInstance) { + public function getSocketResource (ProtocolHandler $protocolInstance) { // The socket must be registered before we can return it - if (!$this->isSocketRegistered($listenerInstance, false)) { + if (!$this->isSocketRegistered($protocolInstance, false)) { // Throw the exception - throw new NoSocketRegisteredException ($listenerInstance, self::SOCKET_NOT_REGISTERED); + throw new NoSocketRegisteredException ($protocolInstance, self::SOCKET_NOT_REGISTERED); } // END - if $this->partialStub('Not yet implemented.');