@Override protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { installRuntimeServices(context, model); }
Resource infinispanResource = safeGetResource(context, infinispanPath); if (infinispanResource == null || !infinispanResource.hasChild(PathElement.pathElement("cache-container", clientMappingsClusterName))) { final OptionMap channelCreationOptions = this.getChannelCreationOptions(context);
private OptionMap getChannelCreationOptions(final OperationContext context) throws OperationFailedException { // read the full model of the current resource final ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS)); final ModelNode channelCreationOptions = fullModel.get(EJB3SubsystemModel.CHANNEL_CREATION_OPTIONS); if (channelCreationOptions.isDefined() && channelCreationOptions.asInt() > 0) { final ClassLoader loader = this.getClass().getClassLoader(); final OptionMap.Builder builder = OptionMap.builder(); for (final Property optionProperty : channelCreationOptions.asPropertyList()) { final String name = optionProperty.getName(); final ModelNode propValueModel = optionProperty.getValue(); final String type = RemoteConnectorChannelCreationOptionResource.CHANNEL_CREATION_OPTION_TYPE.resolveModelAttribute(context,propValueModel).asString(); final String optionClassName = this.getClassNameForChannelOptionType(type); final String fullyQualifiedOptionName = optionClassName + "." + name; final Option option = Option.fromString(fullyQualifiedOptionName, loader); final String value = RemoteConnectorChannelCreationOptionResource.CHANNEL_CREATION_OPTION_VALUE.resolveModelAttribute(context, propValueModel).asString(); builder.set(option, option.parseValue(value, loader)); } return builder.getMap(); } return OptionMap.EMPTY; }
final OptionMap channelCreationOptions = this.getChannelCreationOptions(context);
private OptionMap getChannelCreationOptions(final OperationContext context) throws OperationFailedException { // read the full model of the current resource final ModelNode fullModel = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS)); final ModelNode channelCreationOptions = fullModel.get(EJB3SubsystemModel.CHANNEL_CREATION_OPTIONS); if (channelCreationOptions.isDefined() && channelCreationOptions.asInt() > 0) { final ClassLoader loader = this.getClass().getClassLoader(); final OptionMap.Builder builder = OptionMap.builder(); for (final Property optionProperty : channelCreationOptions.asPropertyList()) { final String name = optionProperty.getName(); final ModelNode propValueModel = optionProperty.getValue(); final String type = ChannelCreationOptionResource.CHANNEL_CREATION_OPTION_TYPE.resolveModelAttribute(context,propValueModel).asString(); final String optionClassName = this.getClassNameForChannelOptionType(type); final String fullyQualifiedOptionName = optionClassName + "." + name; final Option option = Option.fromString(fullyQualifiedOptionName, loader); final String value = ChannelCreationOptionResource.CHANNEL_CREATION_OPTION_VALUE.resolveModelAttribute(context, propValueModel).asString(); builder.set(option, option.parseValue(value, loader)); } return builder.getMap(); } else { return OptionMap.EMPTY; } }
private static void recreateParentService(OperationContext context, ModelNode ejb3RemoteServiceModelNode) throws OperationFailedException { EJB3RemoteServiceAdd.INSTANCE.installRuntimeServices(context, ejb3RemoteServiceModelNode); }
private static void recreateParentService(OperationContext context, ModelNode ejb3RemoteServiceModelNode, ServiceVerificationHandler verificationHandler) throws OperationFailedException { EJB3RemoteServiceAdd.INSTANCE.installRuntimeServices(context, ejb3RemoteServiceModelNode, verificationHandler); }
@Override protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { EJB3RemoteServiceAdd.INSTANCE.installRuntimeServices(context, model, null); } else { context.revertReloadRequired(); } }
@Override protected void performBoottime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { newControllers.addAll(installRuntimeServices(context, model, verificationHandler)); // add ejb remote transactions repository service final EJBRemoteTransactionsRepository transactionsRepository = new EJBRemoteTransactionsRepository(); final ServiceTarget serviceTarget = context.getServiceTarget(); final ServiceController transactionRepositoryServiceController = serviceTarget.addService(EJBRemoteTransactionsRepository.SERVICE_NAME, transactionsRepository) .addDependency(TransactionManagerService.SERVICE_NAME, TransactionManager.class, transactionsRepository.getTransactionManagerInjector()) .addDependency(UserTransactionService.SERVICE_NAME, UserTransaction.class, transactionsRepository.getUserTransactionInjector()) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); newControllers.add(transactionRepositoryServiceController); // Service responsible for tracking cancel() invocations on remote async method calls final RemoteAsyncInvocationCancelStatusService asyncInvocationCancelStatusService = new RemoteAsyncInvocationCancelStatusService(); final ServiceController asyncCancelTrackerServiceController = serviceTarget.addService(RemoteAsyncInvocationCancelStatusService.SERVICE_NAME, asyncInvocationCancelStatusService) .install(); newControllers.add(asyncCancelTrackerServiceController); }