Deploy a web application for any user who has a web application present in a directory with a specified name within their home directory.
()
| 298 | * within their home directory. |
| 299 | */ |
| 300 | private void deploy() { |
| 301 | |
| 302 | if (host.getLogger().isTraceEnabled()) { |
| 303 | host.getLogger().trace(sm.getString("userConfig.deploying")); |
| 304 | } |
| 305 | |
| 306 | // Load the user database object for this host |
| 307 | UserDatabase database; |
| 308 | try { |
| 309 | Class<?> clazz = Class.forName(userClass); |
| 310 | database = (UserDatabase) clazz.getConstructor().newInstance(); |
| 311 | database.setUserConfig(this); |
| 312 | } catch (Exception e) { |
| 313 | host.getLogger().error(sm.getString("userConfig.database"), e); |
| 314 | return; |
| 315 | } |
| 316 | |
| 317 | ExecutorService executor = host.getStartStopExecutor(); |
| 318 | List<Future<?>> results = new ArrayList<>(); |
| 319 | |
| 320 | // Deploy the web application (if any) for each defined user |
| 321 | Enumeration<String> users = database.getUsers(); |
| 322 | while (users.hasMoreElements()) { |
| 323 | String user = users.nextElement(); |
| 324 | if (!isDeployAllowed(user)) { |
| 325 | continue; |
| 326 | } |
| 327 | String home = database.getHome(user); |
| 328 | results.add(executor.submit(new DeployUserDirectory(this, user, home))); |
| 329 | } |
| 330 | |
| 331 | for (Future<?> result : results) { |
| 332 | try { |
| 333 | result.get(); |
| 334 | } catch (Exception e) { |
| 335 | host.getLogger().error(sm.getString("userConfig.deploy.threaded.error"), e); |
| 336 | } |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | |
| 341 | /** |
no test coverage detected