@Override protected boolean requiresRuntime(OperationContext context) { return context.getProcessType().isServer(); } }
@Override protected boolean requiresRuntime(OperationContext context) { return context.getProcessType().isServer(); } }
public ExtensionRegistrationContext(ExtensionContext context) { this.runtimeOnlyRegistrationValid = context.isRuntimeOnlyRegistrationValid(); this.pathManager = context.getProcessType().isServer() ? Optional.of(context.getPathManager()) : Optional.empty(); }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { for (AttributeDefinition attribute : Constants.JDBC_DRIVER_ATTRIBUTES) { resourceRegistration.registerReadOnlyAttribute(attribute, null); } if (resourceRegistration.getProcessType().isServer()) { resourceRegistration.registerReadOnlyAttribute(DATASOURCE_CLASS_INFO, GetDataSourceClassInfoOperationHandler.INSTANCE); } }
@Override protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException { if (context.getProcessType().isServer()) { DataSourceStatisticsService.registerStatisticsResources(resource); } super.populateModel(context, operation, resource); }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { knownApplicationSecurityDomains.clear(); // If we are registering, time for a clean start. super.registerAttributes(resourceRegistration); if (resourceRegistration.getProcessType().isServer()) { resourceRegistration.registerReadOnlyAttribute(REFERENCING_DEPLOYMENTS, new ReferencingDeploymentsHandler()); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { knownApplicationSecurityDomains.clear(); ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES); for (AttributeDefinition attribute: ATTRIBUTES) { resourceRegistration.registerReadWriteAttribute(attribute, null, handler); } if (resourceRegistration.getProcessType().isServer()) { resourceRegistration.registerReadOnlyAttribute(REFERENCING_DEPLOYMENTS, new ReferencingDeploymentsHandler()); } }
@Override public void registerAttributes(ManagementResourceRegistration resourceRegistration) { ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler(getAttributes()); for (AttributeDefinition attributeDefinition : getAttributes()) { OperationStepHandler writeHandler = handler; if (attributeDefinition == STATISTICS_ENABLED_ATTRIBUTE) { writeHandler = AbstractDataSourceOperations.STATISTICS_ENABLED_WRITE_OPERATION; } if (attributeDefinition == CONNECTION_FACTORY_ATTRIBUTE) { writeHandler = AbstractDataSourceOperations.CONNECTION_FACTORY_WRITE_OPERATION; } if (attributeDefinition == CONNECTION_POOL_ATTRIBUTE) { writeHandler = AbstractDataSourceOperations.CONNECTION_POOL_WRITE_OPERATION; } resourceRegistration.registerReadWriteAttribute(attributeDefinition, null, writeHandler); } // Runtime attributes if (resourceRegistration.getProcessType().isServer()) { resourceRegistration.registerReadOnlyAttribute(STATISTICS, AbstractDataSourceOperations.STATISTICS_GET_OPERATION); } }
@Override public void registerOperations(ManagementResourceRegistration resourceRegistration) { super.registerOperations(resourceRegistration); if (resourceRegistration.getProcessType().isServer()) { resourceRegistration.registerOperationHandler(FLUSH_ALL, AbstractDataSourceOperations.FLUSH_ALL_OPERATION); resourceRegistration.registerOperationHandler(FLUSH_GRACEFUL, AbstractDataSourceOperations.FLUSH_GRACEFUL_OPERATION); resourceRegistration.registerOperationHandler(FLUSH_INVALID, AbstractDataSourceOperations.FLUSH_INVALID_OPERATION); resourceRegistration.registerOperationHandler(FLUSH_IDLE, AbstractDataSourceOperations.FLUSH_IDLE_OPERATION); resourceRegistration.registerOperationHandler(RESET_STATISTICS, AbstractDataSourceOperations.RESET_STATISTICS_OPERATION); resourceRegistration.registerOperationHandler(TEST_CONNECTION, AbstractDataSourceOperations.TEST_CONNECTION_OPERATION); } } }
if (context.getProcessType().isServer() && !context.isBooting() && name.equals("ejb")) { PathElement ejbPath = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, "ejb3"); Resource ejbResource = safeGetResource(context, ejbPath);
if (context.getProcessType().isServer() && !context.isBooting()) { if (context.readResourceFromRoot(address.getParent(),false).hasChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, "infinispan"))) {
/** * {@inheritDoc} */ @Override public void initialize(ExtensionContext context) { final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); subsystem.registerXMLElementWriter(EJB3SubsystemXMLPersister.INSTANCE); PathManager pathManager = context.getProcessType().isServer() ? context.getPathManager() : null; subsystem.registerSubsystemModel(new EJB3SubsystemRootResourceDefinition(registerRuntimeOnly, pathManager)); if (registerRuntimeOnly) { ResourceDefinition deploymentsDef = new SimpleResourceDefinition(new Parameters(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, SUBSYSTEM_NAME), getResourceDescriptionResolver("deployed")).setFeature(false)); final ManagementResourceRegistration deploymentsRegistration = subsystem.registerDeploymentModel(deploymentsDef); deploymentsRegistration.registerSubModel(MessageDrivenBeanResourceDefinition.INSTANCE); deploymentsRegistration.registerSubModel(SingletonBeanDeploymentResourceDefinition.INSTANCE); deploymentsRegistration.registerSubModel(StatelessSessionBeanDeploymentResourceDefinition.INSTANCE); deploymentsRegistration.registerSubModel(StatefulSessionBeanDeploymentResourceDefinition.INSTANCE); } }
/** * {@inheritDoc} */ public void initialize(ExtensionContext context) { TransactionLogger.ROOT_LOGGER.debug("Initializing Transactions Extension"); final LogStoreResource resource = new LogStoreResource(); final boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid(); final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION); final TransactionSubsystemRootResourceDefinition rootResourceDefinition = new TransactionSubsystemRootResourceDefinition(registerRuntimeOnly); final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(rootResourceDefinition); registration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); // Create the path resolver handlers if (context.getProcessType().isServer()) { // It's less than ideal to create a separate operation here, but this extension contains two relative-to attributes final ResolvePathHandler objectStorePathHandler = ResolvePathHandler.Builder.of(RESOLVE_OBJECT_STORE_PATH, context.getPathManager()) .setPathAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_PATH) .setRelativeToAttribute(TransactionSubsystemRootResourceDefinition.OBJECT_STORE_RELATIVE_TO) .build(); registration.registerOperationHandler(objectStorePathHandler.getOperationDefinition(), objectStorePathHandler); } ManagementResourceRegistration logStoreChild = registration.registerSubModel(new LogStoreDefinition(resource, registerRuntimeOnly)); if (registerRuntimeOnly) { ManagementResourceRegistration transactionChild = logStoreChild.registerSubModel(new LogStoreTransactionDefinition(resource)); transactionChild.registerSubModel(LogStoreTransactionParticipantDefinition.INSTANCE); } subsystem.registerXMLElementWriter(TransactionSubsystemXMLPersister.INSTANCE); }
/** * Returns true if the process is a host controller, * * @return Returns <tt>true</tt> if the process is a hostcontroller. Returns <tt>false</tt> otherwise. */ public boolean isHostController() { return !isServer(); }
@Override public PathManager getPathManager() { if (!processType.isServer()) { throw ControllerLogger.ROOT_LOGGER.pathManagerNotAvailable(processType); } return pathManager; }
private boolean isRuntimeChangeAllowed() { assertNotComplete(currentStage); boolean validStage = currentStage == Stage.RUNTIME || currentStage == Stage.VERIFY || isRollingBack(); return validStage && (getProcessType().isServer() || activeStep == null || activeStep.address.size() < 2 || !PROFILE.equals(activeStep.address.getElement(0).getKey())); }
@Override protected boolean requiresRuntime(OperationContext context) { if (context.getProcessType().isServer()) { return super.requiresRuntime(context); } //Check if we are a host's socket binding and install the service if we are PathAddress pathAddress = context.getCurrentAddress(); return pathAddress.size() > 0 && pathAddress.getElement(0).getKey().equals(HOST); }
@Override protected boolean requiresRuntime(OperationContext context) { if (context.getProcessType().isServer()) { return super.requiresRuntime(context); } //Check if we are a host's socket binding and install the service if we are PathAddress pathAddress = context.getCurrentAddress(); return pathAddress.size() > 0 && pathAddress.getElement(0).getKey().equals(HOST); }
@Override protected boolean requiresRuntime(OperationContext context) { if (context.getProcessType().isServer()) { return super.requiresRuntime(context); } //Check if we are a host's socket binding and install the service if we are PathAddress pathAddress = context.getCurrentAddress(); return pathAddress.size() > 0 && pathAddress.getElement(0).getKey().equals(HOST); }
void requireOptionalCapability(String required, String dependent, Step step, String attribute) throws OperationFailedException { if (!requestOptionalCapability(required, dependent, false, step, attribute)) { String msg = ControllerLogger.ROOT_LOGGER.requiredCapabilityMissing(); if (getProcessType().isServer()) { msg += "\n" + ControllerLogger.ROOT_LOGGER.formattedCapabilityName(required); } else { msg = "\n" + ControllerLogger.ROOT_LOGGER.formattedCapabilityId(required, createCapabilityContext(step.address).getName()); } throw new OperationFailedException(msg); } }