Object activeTxCache;
}
private void deployEJBTimerService(String target) {
synchronized (lock) {
Deployment deployment = habitat.getByContract(Deployment.class);
boolean isRegistered = deployment.isRegistered(EjbContainerUtil.TIMER_SERVICE_APP_NAME);
if (isRegistered) {
_logger.log (Level.WARNING, "EJBTimerService had been explicitly deployed.");
} else {
_logger.log (Level.INFO, "Loading EJBTimerService. Please wait.");
File root = serverContext.getInstallRoot();
File app = null;
try {
app = FileUtils.getManagedFile(EjbContainerUtil.TIMER_SERVICE_APP_NAME + ".war",
new File(root, "lib/install/applications/"));
} catch (Exception e) {
_logger.log (Level.WARNING, "Caught unexpected exception", e);
}
if (app == null || !app.exists()) {
_logger.log (Level.WARNING, "Cannot deploy or load EJBTimerService: " +
"required WAR file (" +
EjbContainerUtil.TIMER_SERVICE_APP_NAME + ".war) is not installed");
} else {
ActionReport report = habitat.getComponent(ActionReport.class, "plain");
DeployCommandParameters params = new DeployCommandParameters(app);
String appName = EjbContainerUtil.TIMER_SERVICE_APP_NAME;
params.name = appName;
File rootScratchDir = env.getApplicationStubPath();
File appScratchFile = new File(rootScratchDir, appName);
try {
String resourceName = getTimerResource(target);
if (resourceName != null) {
// appScratchFile is a marker file and needs to be created on Das on the
// first access of the Timer Service application - so use & instead of &&
if (isDas() && (!isUpgrade(resourceName, target, appScratchFile.exists()) & appScratchFile.createNewFile())) {
params.origin = OpsParams.Origin.deploy;
} else {
params.origin = OpsParams.Origin.load;
}
params.target = env.getInstanceName();
ExtendedDeploymentContext dc = deployment.getBuilder(
_logger, params, report).source(app).build();
dc.addTransientAppMetaData(DatabaseConstants.JTA_DATASOURCE_JNDI_NAME_OVERRIDE, resourceName);
Properties appProps = dc.getAppProps();
appProps.setProperty(ServerTags.OBJECT_TYPE, DeploymentProperties.SYSTEM_ALL);
deployment.deploy(dc);
if (report.getActionExitCode() != ActionReport.ExitCode.SUCCESS) {
_logger.log (Level.WARNING, "Cannot deploy or load EJBTimerService: ",
report.getFailureCause());
} else {