(DeployedApplication app, File fileToRemove, String newDocBase)
| 1426 | * Note: If either of fileToRemove and newDocBase are null, both will be ignored. |
| 1427 | */ |
| 1428 | private void reload(DeployedApplication app, File fileToRemove, String newDocBase) { |
| 1429 | if (log.isInfoEnabled()) { |
| 1430 | log.info(sm.getString("hostConfig.reload", app.name)); |
| 1431 | } |
| 1432 | Context context = (Context) host.findChild(app.name); |
| 1433 | if (context.getState().isAvailable()) { |
| 1434 | if (fileToRemove != null && newDocBase != null) { |
| 1435 | context.addLifecycleListener(new ExpandedDirectoryRemovalListener(fileToRemove, newDocBase)); |
| 1436 | } |
| 1437 | // Reload catches and logs exceptions |
| 1438 | context.reload(); |
| 1439 | } else { |
| 1440 | // If the context was not started (for example an error |
| 1441 | // in web.xml) we'll still get to try to start |
| 1442 | if (fileToRemove != null && newDocBase != null) { |
| 1443 | ExpandWar.delete(fileToRemove); |
| 1444 | context.setDocBase(newDocBase); |
| 1445 | } |
| 1446 | try { |
| 1447 | context.start(); |
| 1448 | } catch (Exception e) { |
| 1449 | log.error(sm.getString("hostConfig.context.restart", app.name), e); |
| 1450 | } |
| 1451 | } |
| 1452 | } |
| 1453 | |
| 1454 | |
| 1455 | private void undeploy(DeployedApplication app) { |
no test coverage detected