public long startWork(Work work) throws WorkException { return startWork(work, 0, null, null); }
public static NativeXAFileSystem bootXAFileSystemStandAlone(StandaloneFileSystemConfiguration configuration) { doBasicValidationForConfiguration(configuration); String instanceId = configuration.getInstanceId(); if(allXAFileSystems.get(instanceId) != null) { throw new XASystemBootFailureException("An instance of XADisk with instance-id [" + instanceId + "] is already" + " running in this JVM."); } WorkManager workManager = new StandaloneWorkManager( configuration.getWorkManagerCorePoolSize(), configuration.getWorkManagerMaxPoolSize(), configuration.getWorkManagerKeepAliveTime()); NativeXAFileSystem newXAFileSystem = new NativeXAFileSystem(configuration, workManager); allXAFileSystems.put(configuration.getInstanceId(), newXAFileSystem); newXAFileSystem.logger.logInfo("Successfully booted the XADisk instance."); return newXAFileSystem; }
public long startWork(Work work, long timeout, ExecutionContext execCtxt, WorkListener workListener) throws WorkException { try { threadPool.execute(new WorkRunnable(work, workListener)); } catch(Exception e) { throw new WorkException(e); } return 1; }
private XAFileSystem getFileSystem() { if (fileSystem == null) { File xaDiskHome = OperatingSystemUtils.createTempDir(); StandaloneFileSystemConfiguration config = new StandaloneFileSystemConfiguration( xaDiskHome.getAbsolutePath(), "furnace-instance"); config.setTransactionTimeout(3600); // XADISK-95 if (OperatingSystemUtils.isWindows()) { config.setSynchronizeDirectoryChanges(Boolean.FALSE); } this.fileSystem = XAFileSystemProxy.bootNativeXAFileSystem(config); try { this.fileSystem.waitForBootup(10000); } catch (InterruptedException e) { } } return fileSystem; }
public XALdifDstService(TaskType task) throws LscServiceException { xaSessions = new HashMap<String, XASession>(); this.id = LscConfiguration.getDestinationService(task).getName(); this.outputDirectory = task.getXaFileDestinationService().getOutputDirectory(); if(LOGGER.isDebugEnabled()) LOGGER.debug("Botting an XADisk instance..."); StandaloneFileSystemConfiguration configuration = new StandaloneFileSystemConfiguration(outputDirectory, id); xafs = XAFileSystemProxy.bootNativeXAFileSystem(configuration); try { xafs.waitForBootup(-1); } catch (InterruptedException e) { throw new LscServiceException(e); } if(LOGGER.isDebugEnabled()) LOGGER.debug("Successfully booted the XADisk instance.\n"); tm = new bitronix.tm.BitronixTransactionManager(); }
public void shutdown() throws IOException { logger.logInfo("Shutting down the XADisk instance..."); systemShuttingDown = true; NativeSession allSessions[]; Collection<NativeSession> sessionsCollection = transactionAndSession.values(); allSessions = sessionsCollection.toArray(new NativeSession[0]); for (int i = 0; i < allSessions.length; i++) { allSessions[i].notifySystemShutdown(); } bufferPoolReliever.release(); selectorPoolReliever.release(); concurrencyControl.shutdown(); recoveryWorker.release(); gatheringDiskWriter.release(); gatheringDiskWriter.deInitialize(); fileSystemEventDelegator.release(); transactionTimeoutDetector.release(); if(configuration.getEnableRemoteInvocations()) { pointOfContact.release(); } deadLetter.release(); if (workManager instanceof StandaloneWorkManager) { ((StandaloneWorkManager) workManager).shutdown(); } allXAFileSystems.remove(this.configuration.getInstanceId()); logger.logInfo("Successfully shutdown the XADisk instance."); logger.release(); }