@Service(name = "rollback-transaction") @TargetType({CommandTarget.DAS,CommandTarget.STANDALONE_INSTANCE, CommandTarget.CLUSTERED_INSTANCE}) @ExecuteOn(RuntimeType.INSTANCE) @PerLookup @I18n("rollback.transaction") public class RollbackTransaction implements AdminCommand { private static StringManager localStrings = StringManager.getManager(RollbackTransaction.class); @Param(optional = true) String target = SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME; @Param(name = "transaction_id") String txnId; @Inject JavaEETransactionManager transactionMgr;
public SupplementalCommand(AdminCommand cmd, Supplemental.Timing time, FailurePolicy onFail) { command = cmd; timing = time; failurePolicy = onFail; org.glassfish.api.admin.ExecuteOn ann = cmd.getClass().getAnnotation(org.glassfish.api.admin.ExecuteOn.class); if( ann == null) { whereToRun.add(RuntimeType.DAS); whereToRun.add(RuntimeType.INSTANCE); } else { if(ann.value().length == 0) { whereToRun.add(RuntimeType.DAS); whereToRun.add(RuntimeType.INSTANCE); } else { for(RuntimeType t : ann.value()) { whereToRun.add(t); } } } }
fp = FailurePolicy.Error; } else { if (clAnnotation.value().length == 0) { runtimeTypes.add(RuntimeType.DAS); runtimeTypes.add(RuntimeType.INSTANCE); } else { runtimeTypes.addAll(Arrays.asList(clAnnotation.value())); if (clAnnotation.ifFailure() == null) { fp = FailurePolicy.Error; } else { fp = clAnnotation.ifFailure(); if (targetName == null || model.getModelFor("target").getParam().obsolete()) { if (command instanceof DeploymentTargetResolver) { targetName = ((DeploymentTargetResolver) command).getTarget(parameters); targetTypesAllowed.addAll(Arrays.asList(tgtTypeAnnotation.value())); if (model.getClusteringAttributes() != null && model.getClusteringAttributes().executor() != null) { executor = habitat.getService(model.getClusteringAttributes().executor()); } else { executor = habitat.getService(ClusterExecutor.class, "GlassFishClusterExecutor");
clAnnotation = DefaultExecuteOn.class.getAnnotation(ExecuteOn.class); if (clAnnotation.value().length == 0) { runtimeTypes.add(RuntimeType.DAS); runtimeTypes.add(RuntimeType.INSTANCE); } else { runtimeTypes.addAll(Arrays.asList(clAnnotation.value())); return(ClusterOperationUtil.replicateCommand(commandName, clAnnotation.ifFailure(), clAnnotation.ifOffline(), clAnnotation.ifNeverStarted(), instancesForReplication, context, parameters, habitat));
runtimeTypes.add(RuntimeType.INSTANCE); } else { if(clAnnotation.value().length == 0) { runtimeTypes.add(RuntimeType.DAS); runtimeTypes.add(RuntimeType.INSTANCE); } else { for(RuntimeType t : clAnnotation.value()) { runtimeTypes.add(t); return(ClusterOperationUtil.replicateCommand(commandName, (clAnnotation == null) ? FailurePolicy.Error : clAnnotation.ifFailure(), (clAnnotation == null) ? FailurePolicy.Warn : clAnnotation.ifOffline(), instancesForReplication, context, parameters, habitat));
fp = FailurePolicy.Error; } else { if (clAnnotation.value().length == 0) { runtimeTypes.add(RuntimeType.DAS); runtimeTypes.add(RuntimeType.INSTANCE); } else { runtimeTypes.addAll(Arrays.asList(clAnnotation.value())); if (clAnnotation.ifFailure() == null) { fp = FailurePolicy.Error; } else { fp = clAnnotation.ifFailure(); if (targetName == null || model.getModelFor("target").getParam().obsolete()) { if (command instanceof DeploymentTargetResolver) { targetName = ((DeploymentTargetResolver) command).getTarget(parameters); targetTypesAllowed.addAll(Arrays.asList(tgtTypeAnnotation.value())); if (model.getClusteringAttributes() != null && model.getClusteringAttributes().executor() != null) { executor = habitat.getService(model.getClusteringAttributes().executor()); } else { executor = habitat.getService(ClusterExecutor.class, "GlassFishClusterExecutor");
@TargetType(value={CommandTarget.DAS,CommandTarget.DOMAIN, CommandTarget.CLUSTER, CommandTarget.STANDALONE_INSTANCE }) @ExecuteOn(RuntimeType.ALL) @Service(name="delete-managed-thread-factory") @PerLookup @I18n("delete.managed.thread.factory") public class DeleteManagedThreadFactory implements AdminCommand { @Param(optional=true) private String target = SystemPropertyConstants.DAS_SERVER_NAME; @Param(name="managed_thread_factory_name", primary=true) private String jndiName; @Inject private Domain domain; @Inject private ManagedThreadFactoryManager managedThreadFactoryMgr;
private SupplementalCommandImpl(AdminCommand cmd) { command = cmd; Supplemental supAnn = cmd.getClass().getAnnotation(Supplemental.class); timing = supAnn.on(); failurePolicy = supAnn.ifFailure(); ExecuteOn onAnn = cmd.getClass().getAnnotation(ExecuteOn.class); progressAnnotation = cmd.getClass().getAnnotation(Progress.class); if (onAnn == null) { whereToRun.add(RuntimeType.DAS); whereToRun.add(RuntimeType.INSTANCE); } else { if(onAnn.value().length == 0) { whereToRun.add(RuntimeType.DAS); whereToRun.add(RuntimeType.INSTANCE); } else { whereToRun.addAll(Arrays.asList(onAnn.value())); } } }
@TargetType(value={CommandTarget.DAS,CommandTarget.DOMAIN, CommandTarget.CLUSTER, CommandTarget.STANDALONE_INSTANCE }) @ExecuteOn(RuntimeType.ALL) @Service(name="delete-managed-scheduled-executor-service") @PerLookup @I18n("delete.managed.scheduled.executor.service") public class DeleteManagedScheduledExecutorService implements AdminCommand { @Param(optional=true) private String target = SystemPropertyConstants.DAS_SERVER_NAME; @Param(name="managed_scheduled_executor_service_name", primary=true) private String jndiName; @Inject private Domain domain; @Inject private ManagedScheduledExecutorServiceManager managedScheduledExecutorServiceMgr;
/** * This method checks if this command has @ExecuteOn annotation with * RuntimeType.SINGle_INSTANCE * @param commandName the command which is executed * @return true only if @ExecuteOn has RuntimeType.SINGLE_INSTANCE false for * other cases */ public boolean isSingleInstanceCommand(String commandName) { CommandModel model = commandRunner.getModel(getScope(commandName),getCommandAfterScope(commandName),aalogger) ; if (model != null ) { ExecuteOn executeOn = model.getClusteringAttributes(); if ((executeOn != null) && (executeOn.value().length ==1) && executeOn.value()[0].equals(RuntimeType.SINGLE_INSTANCE)) { return true; } } return false; }
@TargetType(value={CommandTarget.DAS,CommandTarget.DOMAIN, CommandTarget.CLUSTER, CommandTarget.STANDALONE_INSTANCE }) @ExecuteOn(RuntimeType.ALL) @Service(name="delete-context-service") @PerLookup @I18n("delete.context.service") public class DeleteContextService implements AdminCommand { @Param(optional=true) private String target = SystemPropertyConstants.DAS_SERVER_NAME; @Param(name="context_service_name", primary=true) private String jndiName; @Inject private Domain domain; @Inject private ContextServiceManager contextServiceMgr;
@TargetType(value={CommandTarget.DAS, CommandTarget.DOMAIN, CommandTarget.CLUSTER, CommandTarget.STANDALONE_INSTANCE }) @ExecuteOn(RuntimeType.ALL) @Service(name="create-managed-executor-service") @PerLookup @I18n("create.managed.executor.service") public class CreateManagedExecutorService extends CreateManagedExecutorServiceBase implements AdminCommand { @Param(name="maximumpoolsize", alias="maximumPoolSize", defaultValue=""+Integer.MAX_VALUE, optional=true) private Integer maximumpoolsize; @Param(name="taskqueuecapacity", alias="taskQueueCapacity", defaultValue=""+Integer.MAX_VALUE, optional=true) private Integer taskqueuecapacity; @Inject private Domain domain; @Inject private ManagedExecutorServiceManager managedExecutorServiceMgr;
@TargetType(value={CommandTarget.DAS,CommandTarget.DOMAIN, CommandTarget.CLUSTER, CommandTarget.STANDALONE_INSTANCE }) @ExecuteOn(RuntimeType.ALL) @Service(name="delete-managed-executor-service") @PerLookup @I18n("delete.managed.executor.service") public class DeleteManagedExecutorService implements AdminCommand { @Param(optional=true) private String target = SystemPropertyConstants.DAS_SERVER_NAME; @Param(name="managed_executor_service_name", primary=true) private String jndiName; @Inject private Domain domain; @Inject private ManagedExecutorServiceManager managedExecutorServiceMgr;
@Service(name = "_recover-transactions-internal") @TargetType({CommandTarget.DAS,CommandTarget.STANDALONE_INSTANCE, CommandTarget.CLUSTERED_INSTANCE}) @ExecuteOn(RuntimeType.INSTANCE) @PerLookup public class RecoverTransactionsInternal extends RecoverTransactionsBase implements AdminCommand { @Param(name="target", optional = false) String destinationServer; @Inject ResourceRecoveryManager recoveryManager;
@TargetType(value={CommandTarget.DAS, CommandTarget.DOMAIN, CommandTarget.CLUSTER, CommandTarget.STANDALONE_INSTANCE }) @ExecuteOn(RuntimeType.ALL) @Service(name="create-managed-scheduled-executor-service") @PerLookup @I18n("create.managed.scheduled.executor.service") public class CreateManagedScheduledExecutorService extends CreateManagedExecutorServiceBase implements AdminCommand { @Inject private Domain domain; @Inject private ManagedScheduledExecutorServiceManager managedScheduledExecutorServiceMgr;
@ExecuteOn(RuntimeType.ALL) @Service(name="delete-jdbc-connection-pool") @PerLookup @I18n("delete.jdbc.connection.pool") public class DeleteJdbcConnectionPool implements AdminCommand { @Param(optional=true, defaultValue="false") private Boolean cascade; @Param(name="jdbc_connection_pool_id", primary=true) private String poolName; @Param(optional=true, obsolete = true) private String target = SystemPropertyConstants.DAS_SERVER_NAME; @Inject private Domain domain; @Inject private IterableProvider<Server> servers; @Inject private IterableProvider<Cluster> clusters;