use of org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence in project wildfly by wildfly.
the class FileDataStoreAdd method performRuntime.
protected void performRuntime(final OperationContext context, ModelNode operation, final ModelNode model, final ServiceVerificationHandler verificationHandler, final List<ServiceController<?>> newControllers) throws OperationFailedException {
final ModelNode pathNode = FileDataStoreResourceDefinition.PATH.resolveModelAttribute(context, model);
final String path = pathNode.isDefined() ? pathNode.asString() : null;
final ModelNode relativeToNode = FileDataStoreResourceDefinition.RELATIVE_TO.resolveModelAttribute(context, model);
final String relativeTo = relativeToNode.isDefined() ? relativeToNode.asString() : null;
final FileTimerPersistence fileTimerPersistence = new FileTimerPersistence(true, path, relativeTo);
final PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR));
final ServiceName serviceName = TimerPersistence.SERVICE_NAME.append(address.getLastElement().getValue());
newControllers.add(context.getServiceTarget().addService(serviceName, fileTimerPersistence).addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, fileTimerPersistence.getModuleLoader()).addDependency(PathManagerService.SERVICE_NAME, PathManager.class, fileTimerPersistence.getPathManager()).addDependency(TransactionManagerService.SERVICE_NAME, TransactionManager.class, fileTimerPersistence.getTransactionManager()).addDependency(TransactionSynchronizationRegistryService.SERVICE_NAME, TransactionSynchronizationRegistry.class, fileTimerPersistence.getTransactionSynchronizationRegistry()).install());
}
use of org.jboss.as.ejb3.timerservice.persistence.filestore.FileTimerPersistence in project wildfly by wildfly.
the class FileDataStoreAdd method performRuntime.
protected void performRuntime(final OperationContext context, ModelNode operation, final ModelNode model) throws OperationFailedException {
final ModelNode pathNode = FileDataStoreResourceDefinition.PATH.resolveModelAttribute(context, model);
final String path = pathNode.isDefined() ? pathNode.asString() : null;
final ModelNode relativeToNode = FileDataStoreResourceDefinition.RELATIVE_TO.resolveModelAttribute(context, model);
final String relativeTo = relativeToNode.isDefined() ? relativeToNode.asString() : null;
final FileTimerPersistence fileTimerPersistence = new FileTimerPersistence(true, path, relativeTo);
// add the TimerPersistence instance
final CapabilityServiceTarget serviceTarget = context.getCapabilityServiceTarget();
final CapabilityServiceBuilder<FileTimerPersistence> builder = serviceTarget.addCapability(TimerServiceResourceDefinition.TIMER_PERSISTENCE_CAPABILITY, fileTimerPersistence);
builder.addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, fileTimerPersistence.getModuleLoader());
builder.addCapabilityRequirement(PATH_MANAGER_CAPABILITY_NAME, PathManager.class, fileTimerPersistence.getPathManager());
builder.addCapabilityRequirement(TRANSACTION_GLOBAL_DEFAULT_LOCAL_PROVIDER_CAPABILITY_NAME, Void.class);
builder.addCapabilityRequirement(TRANSACTION_SYNCHRONIZATION_REGISTRY_CAPABILITY_NAME, TransactionSynchronizationRegistry.class, fileTimerPersistence.getTransactionSynchronizationRegistry());
builder.install();
}
Aggregations