protected final ServiceController<?> addHardcodedAbsolutePath(final ServiceTarget serviceTarget, final String pathName, final String path) { ServiceController<?> controller = addAbsolutePathService(serviceTarget, pathName, path, null); addPathEntry(pathName, path, null, true); return controller; }
protected final ServiceController<?> addHardcodedAbsolutePath(final ServiceTarget serviceTarget, final String pathName, final String path) { ServiceController<?> controller = addAbsolutePathService(serviceTarget, pathName, path, null); addPathEntry(pathName, path, null, true); return controller; }
/** * Install an {@code Service<String>} for the given path. * @param serviceTarget the service target associated with the management operation making this request. Cannot be {@code null} * @param pathName the name of the relevant path. Cannot be {@code null} * @param path the value of the path within the model. This is either an absolute path or * the relative portion of the path. Cannot be {@code null} * @param possiblyAbsolute {@code true} if the path may be absolute and a check should be performed before installing * a service variant that depends on the service associated with {@code relativeTo} * @param relativeTo the name of the path this path is relative to. If {@code null} this is an absolute path * @return the service controller for the {@code Service<String>} */ final ServiceController<?> addRelativePathService(final ServiceTarget serviceTarget, final String pathName, final String path, final boolean possiblyAbsolute, final String relativeTo) { if (possiblyAbsolute && AbstractPathService.isAbsoluteUnixOrWindowsPath(path)) { return addAbsolutePathService(serviceTarget, pathName, path); } else { return RelativePathService.addService(AbstractPathService.pathNameOf(pathName), path, possiblyAbsolute, relativeTo, serviceTarget); } }
/** * Install an {@code Service<String>} for the given path. * @param serviceTarget the service target associated with the management operation making this request. Cannot be {@code null} * @param pathName the name of the relevant path. Cannot be {@code null} * @param path the value of the path within the model. This is either an absolute path or * the relative portion of the path. Cannot be {@code null} * @param possiblyAbsolute {@code true} if the path may be absolute and a check should be performed before installing * a service variant that depends on the service associated with {@code relativeTo} * @param relativeTo the name of the path this path is relative to. If {@code null} this is an absolute path * @return the service controller for the {@code Service<String>} */ final ServiceController<?> addRelativePathService(final ServiceTarget serviceTarget, final String pathName, final String path, final boolean possiblyAbsolute, final String relativeTo) { if (possiblyAbsolute && AbstractPathService.isAbsoluteUnixOrWindowsPath(path)) { return addAbsolutePathService(serviceTarget, pathName, path); } else { return RelativePathService.addService(AbstractPathService.pathNameOf(pathName), path, possiblyAbsolute, relativeTo, serviceTarget); } }
final ServiceController<?> addRelativePathService(final ServiceTarget serviceTarget, final String pathName, final String path, final boolean possiblyAbsolute, final String relativeTo, final ServiceVerificationHandler verificationHandler) { if (possiblyAbsolute && AbstractPathService.isAbsoluteUnixOrWindowsPath(path)) { return addAbsolutePathService(serviceTarget, pathName, path, verificationHandler); } else { if (verificationHandler == null) { return RelativePathService.addService(AbstractPathService.pathNameOf(pathName), path, possiblyAbsolute, relativeTo, serviceTarget, null, NO_LISTENERS); } else { return RelativePathService.addService(AbstractPathService.pathNameOf(pathName), path, possiblyAbsolute, relativeTo, serviceTarget, null, verificationHandler); } } }
final ServiceController<?> addRelativePathService(final ServiceTarget serviceTarget, final String pathName, final String path, final boolean possiblyAbsolute, final String relativeTo, final ServiceVerificationHandler verificationHandler) { if (possiblyAbsolute && AbstractPathService.isAbsoluteUnixOrWindowsPath(path)) { return addAbsolutePathService(serviceTarget, pathName, path, verificationHandler); } else { if (verificationHandler == null) { return RelativePathService.addService(AbstractPathService.pathNameOf(pathName), path, possiblyAbsolute, relativeTo, serviceTarget, null, NO_LISTENERS); } else { return RelativePathService.addService(AbstractPathService.pathNameOf(pathName), path, possiblyAbsolute, relativeTo, serviceTarget, null, verificationHandler); } } }
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final ServiceController<?> legacyService; if (pathEventContext.isInstallServices()) { //Add the legacy services final ServiceTarget target = context.getServiceTarget(); if (relativeTo == null) { legacyService = pathManager.addAbsolutePathService(target, name, path); } else { legacyService = pathManager.addRelativePathService(target, name, path, false, relativeTo); } } else { legacyService = null; } context.completeStep(new OperationContext.RollbackHandler() { public void handleRollback(OperationContext context, ModelNode operation) { pathManager.removePathService(context, name); if (pathEventContext.isInstallServices()) { if (legacyService != null) { context.removeService(legacyService.getName()); } } else { pathEventContext.revert(); } } }); } }, OperationContext.Stage.RUNTIME);
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final ServiceController<?> legacyService; if (pathEventContext.isInstallServices()) { //Add the legacy services final ServiceTarget target = context.getServiceTarget(); if (relativeTo == null) { legacyService = pathManager.addAbsolutePathService(target, name, path); } else { legacyService = pathManager.addRelativePathService(target, name, path, false, relativeTo); } } else { legacyService = null; } context.completeStep(new OperationContext.RollbackHandler() { public void handleRollback(OperationContext context, ModelNode operation) { pathManager.removePathService(context, name); if (pathEventContext.isInstallServices()) { if (legacyService != null) { context.removeService(legacyService.getName()); } } else { pathEventContext.revert(); } } }); } }, OperationContext.Stage.RUNTIME);
/** * Add a {@code PathEntry} and install a {@code Service<String>} for one of the standard read-only paths * that are determined from this process' environment. Not to be used for paths stored in the persistent * configuration. * @param serviceTarget service target to use for the service installation * @param pathName the logical name of the path within the model. Cannot be {@code null} * @param path the value of the path within the model. This is an absolute path. Cannot be {@code null} * @return the controller for the installed {@code Service<String>} */ protected final ServiceController<?> addHardcodedAbsolutePath(final ServiceTarget serviceTarget, final String pathName, final String path) { ServiceController<?> controller = addAbsolutePathService(serviceTarget, pathName, path); addPathEntry(pathName, path, null, true); if (capabilityRegistry != null) { RuntimeCapability<Void> pathCapability = PATH_CAPABILITY.fromBaseCapability(pathName); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(pathCapability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } return controller; }
/** * Add a {@code PathEntry} and install a {@code Service<String>} for one of the standard read-only paths * that are determined from this process' environment. Not to be used for paths stored in the persistent * configuration. * @param serviceTarget service target to use for the service installation * @param pathName the logical name of the path within the model. Cannot be {@code null} * @param path the value of the path within the model. This is an absolute path. Cannot be {@code null} * @return the controller for the installed {@code Service<String>} */ protected final ServiceController<?> addHardcodedAbsolutePath(final ServiceTarget serviceTarget, final String pathName, final String path) { ServiceController<?> controller = addAbsolutePathService(serviceTarget, pathName, path); addPathEntry(pathName, path, null, true); if (capabilityRegistry != null) { RuntimeCapability<Void> pathCapability = PATH_CAPABILITY.fromBaseCapability(pathName); capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(pathCapability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } return controller; }
final void changePathServices(final OperationContext operationContext, String pathName, String path) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathName); if (pathEntry.getRelativeTo() == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), path); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), path, false, pathEntry.getRelativeTo()); } }
final void changePathServices(final OperationContext operationContext, String pathName, String path) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathName); if (pathEntry.getRelativeTo() == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), path); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), path, false, pathEntry.getRelativeTo()); } }
final void changePathServices(final OperationContext operationContext, String pathName, String path, ServiceVerificationHandler verificationHandler) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathName); if (pathEntry.getRelativeTo() == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), path, verificationHandler); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), path, false, pathEntry.getRelativeTo(), verificationHandler); } }
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final ServiceController<?> legacyService; if (pathEventContext.isInstallServices()) { //Add the legacy services final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler(); final ServiceTarget target = context.getServiceTarget(); if (relativeTo == null) { legacyService = pathManager.addAbsolutePathService(target, name, path, verificationHandler); } else { legacyService = pathManager.addRelativePathService(target, name, path, false, relativeTo, verificationHandler); } //This is a change from the original version context.addStep(verificationHandler, OperationContext.Stage.VERIFY); } else { legacyService = null; } context.completeStep(new OperationContext.RollbackHandler() { public void handleRollback(OperationContext context, ModelNode operation) { pathManager.removePathService(context, name); if (pathEventContext.isInstallServices()) { if (legacyService != null) { context.removeService(legacyService.getName()); } } else { pathEventContext.revert(); } } }); } }, OperationContext.Stage.RUNTIME);
final void changePathServices(final OperationContext operationContext, String pathName, String path, ServiceVerificationHandler verificationHandler) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathName); if (pathEntry.getRelativeTo() == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), path, verificationHandler); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), path, false, pathEntry.getRelativeTo(), verificationHandler); } }
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final ServiceController<?> legacyService; if (pathEventContext.isInstallServices()) { //Add the legacy services final ServiceVerificationHandler verificationHandler = new ServiceVerificationHandler(); final ServiceTarget target = context.getServiceTarget(); if (relativeTo == null) { legacyService = pathManager.addAbsolutePathService(target, name, path, verificationHandler); } else { legacyService = pathManager.addRelativePathService(target, name, path, false, relativeTo, verificationHandler); } //This is a change from the original version context.addStep(verificationHandler, OperationContext.Stage.VERIFY); } else { legacyService = null; } context.completeStep(new OperationContext.RollbackHandler() { public void handleRollback(OperationContext context, ModelNode operation) { pathManager.removePathService(context, name); if (pathEventContext.isInstallServices()) { if (legacyService != null) { context.removeService(legacyService.getName()); } } else { pathEventContext.revert(); } } }); } }, OperationContext.Stage.RUNTIME);
final void changeRelativePathServices(final OperationContext operationContext, String pathName, String relativeTo) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathEntry.getName()); if (relativeTo == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath()); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath(), false, relativeTo); } }
final void changeRelativePathServices(final OperationContext operationContext, String pathName, String relativeTo, ServiceVerificationHandler verificationHandler) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathEntry.getName()); if (relativeTo == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath(), verificationHandler); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath(), false, relativeTo, verificationHandler); } }
final void changeRelativePathServices(final OperationContext operationContext, String pathName, String relativeTo) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathEntry.getName()); if (relativeTo == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath()); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath(), false, relativeTo); } }
final void changeRelativePathServices(final OperationContext operationContext, String pathName, String relativeTo, ServiceVerificationHandler verificationHandler) { PathEntry pathEntry = findPathEntry(pathName); removePathService(operationContext, pathEntry.getName()); if (relativeTo == null) { addAbsolutePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath(), verificationHandler); } else { addRelativePathService(operationContext.getServiceTarget(), pathEntry.getName(), pathEntry.getPath(), false, relativeTo, verificationHandler); } }