public function bind($name, $value, array $args = array())
    {

        try {
            // strip off the schema
            $key = $this->stripSchema($name);

            // bind the value, if possible
            if ($this->hasAttribute($key) === false) {
                $this->setAttribute($key, array($value, $args));
                return;
            }

            // throw an exeception if the name has already been bound
            throw new \Exception(sprintf('A value with name %s has already been bound to naming directory %s', $name, $this->getIdentifier()));

        } catch (\Exception $e) {
            throw new NamingException(sprintf('Cant\'t bind %s to naming directory %s', $name, $this->getIdentifier()), null, $e);
        }
    }
public function bind($name, $value, array $args = array())
    {

        try {
            // strip off the schema
            $key = $this->stripSchema($name);

            // bind the value, if possible
            if ($this->hasAttribute($key) === false) {
                $this->setAttribute($key, array($value, $args));
                return;
            }

            // throw an exeception if the name has already been bound
            throw new \Exception(sprintf('A value with name %s has already been bound to naming directory %s', $name, $this->getIdentifier()));

        } catch (\Exception $e) {
            throw new NamingException(sprintf('Cant\'t bind %s to naming directory %s', $name, $this->getIdentifier()), null, $e);
        }
    }
public function bind ( $ name , $ value , array $ args = array ( ) ) { try { // strip off the schema $ key = $ this -> stripSchema ( $ name ) ; // bind the value, if possible if ( $ this -> hasAttribute ( $ key ) === false ) { $ this -> setAttribute ( $ key , array ( $ value , $ args ) ) ; return ; } // throw an exeception if the name has already been bound throw new \ Exception ( sprintf ( 'A value with name %s has already been bound to naming directory %s' , $ name , $ this -> getIdentifier ( ) ) ) ; } catch ( \ Exception $ e ) { throw new NamingException ( sprintf ( 'Cant\'t bind %s to naming directory %s' , $ name , $ this -> getIdentifier ( ) ) , null , $ e ) ; } }
Binds the passed instance with the name to the naming directory.

@param string $name  The name to bind the value with
@param mixed  $value The object instance to bind
@param array  $args  The array with the arguments

@return void
@throws \AppserverIo\Psr\Naming\NamingException Is thrown if the value can't be bound ot the directory
Binds the passed instance with the name to the naming directory .