More widen interface ProtocolHandler (which should be extended by listener and writer...
authorRoland Häder <roland@mxchange.org>
Sat, 24 Apr 2010 02:04:04 +0000 (02:04 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 24 Apr 2010 02:04:04 +0000 (02:04 +0000)
inc/classes/exceptions/socket/class_NoSocketRegisteredException.php
inc/classes/interfaces/registry/socket/class_RegisterableSocket.php
inc/classes/main/registry/socket/class_SocketRegistry.php

index fbd5daa88d03ce05b89ef5f0831c3942c7b8df3e..6eeeb15349e09c563f42ab6521918b682074a472 100644 (file)
@@ -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
index a97574830ab2d58903d8019c28256eb129738e06..14efd131c6c9966e5499c988bd1f357d03c5c8ed 100644 (file)
@@ -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]
index b23086f811faadf165e879ad551269cf64c0717c..9686826bdc255db59cca450fc927c6b6551ef076 100644 (file)
@@ -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.');