1 | <?php |
||
32 | class NamingDirectoryWrapper |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * The naming directory instance. |
||
37 | * |
||
38 | * @var \AppserverIo\Psr\Naming\NamingDirectoryInterface |
||
39 | */ |
||
40 | protected $namingDirectory; |
||
41 | |||
42 | /** |
||
43 | * Injects the passed naming directory instance into this naming directory wrapper. |
||
44 | * |
||
45 | * @param \AppserverIo\Psr\Naming\NamingDirectoryInterface $namingDirectory The naming directory instance used for initialization |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 1 | public function injectNamingDirectory(NamingDirectoryInterface $namingDirectory) |
|
53 | |||
54 | /** |
||
55 | * Returns the naming directory instance. |
||
56 | * |
||
57 | * @return \AppserverIo\Psr\Naming\NamingDirectoryInterface The naming directory instance |
||
58 | */ |
||
59 | 1 | public function getNamingDirectory() |
|
63 | |||
64 | /** |
||
65 | * Returns the directory name. |
||
66 | * |
||
67 | * @return string The directory name |
||
68 | */ |
||
69 | 1 | public function getName() |
|
73 | |||
74 | /** |
||
75 | * Returns the parent directory. |
||
76 | * |
||
77 | * @return \AppserverIo\Psr\Naming\NamingDirectoryInterface |
||
78 | */ |
||
79 | public function getParent() |
||
83 | |||
84 | /** |
||
85 | * Returns the scheme. |
||
86 | * |
||
87 | * @return string The scheme we want to use |
||
88 | */ |
||
89 | public function getScheme() |
||
93 | |||
94 | /** |
||
95 | * Binds the passed instance with the name to the naming directory. |
||
96 | * |
||
97 | * @param string $name The name to bind the object with |
||
98 | * @param object $value The object instance to bind |
||
99 | * @param array $args The array with the arguments |
||
100 | * |
||
101 | * @return void |
||
102 | */ |
||
103 | public function bind($name, $value, array $args = array()) |
||
107 | |||
108 | /** |
||
109 | * Binds the passed callback with the name to the naming directory. |
||
110 | * |
||
111 | * @param string $name The name to bind the callback with |
||
112 | * @param callable $callback The callback to be invoked when searching for |
||
113 | * @param array $args The array with the arguments passed to the callback when executed |
||
114 | * |
||
115 | * @return void |
||
116 | * @see \AppserverIo\Psr\Naming\NamingDirectoryInterface::bind() |
||
117 | */ |
||
118 | public function bindCallback($name, callable $callback, array $args = array()) |
||
122 | |||
123 | |||
124 | /** |
||
125 | * Queries the naming directory for the requested name and returns the value |
||
126 | * or invokes the bound callback. |
||
127 | * |
||
128 | * @param string $name The name of the requested value |
||
129 | * @param array $args The arguments to pass to the callback |
||
130 | * |
||
131 | * @return mixed The requested value |
||
132 | * @throws \AppserverIo\Psr\Naming\NamingException Is thrown if the requested name can't be resolved in the directory |
||
133 | */ |
||
134 | public function search($name, array $args = array()) |
||
138 | |||
139 | /** |
||
140 | * Create and return a new naming subdirectory with the attributes |
||
141 | * of this one. |
||
142 | * |
||
143 | * @param string $name The name of the new subdirectory |
||
144 | * @param array $filter Array with filters that will be applied when copy the attributes |
||
145 | * |
||
146 | * @return \AppserverIo\Psr\Naming\NamingDirectoryInterface The new naming subdirectory |
||
147 | */ |
||
148 | public function createSubdirectory($name, array $filter = array()) |
||
152 | } |
||
153 |