예제 #1
0
 private void populateModelWithRecoveryEnvConfig(ModelNode operation, ModelNode model)
     throws OperationFailedException {
   // recovery environment
   TransactionSubsystemRootResourceDefinition.BINDING.validateAndSet(operation, model);
   TransactionSubsystemRootResourceDefinition.STATUS_BINDING.validateAndSet(operation, model);
   TransactionSubsystemRootResourceDefinition.RECOVERY_LISTENER.validateAndSet(operation, model);
 }
예제 #2
0
  private void performRecoveryEnvBoottime(
      OperationContext context, ModelNode model, final boolean jts, List<ServiceName> deps)
      throws OperationFailedException {
    // recovery environment
    final String recoveryBindingName =
        TransactionSubsystemRootResourceDefinition.BINDING
            .resolveModelAttribute(context, model)
            .asString();
    final String recoveryStatusBindingName =
        TransactionSubsystemRootResourceDefinition.STATUS_BINDING
            .resolveModelAttribute(context, model)
            .asString();
    final boolean recoveryListener =
        TransactionSubsystemRootResourceDefinition.RECOVERY_LISTENER
            .resolveModelAttribute(context, model)
            .asBoolean();

    // XATerminator has no deps, so just add it in there
    final XATerminatorService xaTerminatorService = new XATerminatorService(jts);
    context
        .getServiceTarget()
        .addService(TxnServices.JBOSS_TXN_XA_TERMINATOR, xaTerminatorService)
        .setInitialMode(Mode.ACTIVE)
        .install();

    final ArjunaRecoveryManagerService recoveryManagerService =
        new ArjunaRecoveryManagerService(recoveryListener, jts);
    final ServiceBuilder<RecoveryManagerService> recoveryManagerServiceServiceBuilder =
        context
            .getServiceTarget()
            .addService(TxnServices.JBOSS_TXN_ARJUNA_RECOVERY_MANAGER, recoveryManagerService);
    // add dependency on JTA environment bean
    recoveryManagerServiceServiceBuilder.addDependencies(deps);

    if (jts) {
      recoveryManagerServiceServiceBuilder.addDependency(
          ServiceName.JBOSS.append("iiop-openjdk", "orb-service"),
          ORB.class,
          recoveryManagerService.getOrbInjector());
    }

    recoveryManagerServiceServiceBuilder
        .addDependency(
            SocketBinding.JBOSS_BINDING_NAME.append(recoveryBindingName),
            SocketBinding.class,
            recoveryManagerService.getRecoveryBindingInjector())
        .addDependency(
            SocketBinding.JBOSS_BINDING_NAME.append(recoveryStatusBindingName),
            SocketBinding.class,
            recoveryManagerService.getStatusBindingInjector())
        .addDependency(
            SocketBindingManager.SOCKET_BINDING_MANAGER,
            SocketBindingManager.class,
            recoveryManagerService.getBindingManager())
        .addDependency(TxnServices.JBOSS_TXN_CORE_ENVIRONMENT)
        .addDependency(TxnServices.JBOSS_TXN_ARJUNA_OBJECTSTORE_ENVIRONMENT)
        .setInitialMode(ServiceController.Mode.ACTIVE)
        .install();
  }