final void changePath(String pathName, String path) { PathEntry pathEntry = findPathEntry(pathName); pathEntry.setPath(path); triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
final void changePath(String pathName, String path) { PathEntry pathEntry = findPathEntry(pathName); pathEntry.setPath(path); triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
/** * Updates the {@link PathEntry#getPath() path} value for an entry and sends an * {@link org.jboss.as.controller.services.path.PathManager.Event#UPDATED} * notification to any registered * {@linkplain org.jboss.as.controller.services.path.PathManager.Callback#pathEvent(Event, PathEntry) callbacks}. * @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 either an absolute path or * the relative portion of the path. Cannot be {@code null} */ final void changePath(String pathName, String path) { PathEntry pathEntry = findPathEntry(pathName); pathEntry.setPath(path); triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
/** * Updates the {@link PathEntry#getPath() path} value for an entry and sends an * {@link org.jboss.as.controller.services.path.PathManager.Event#UPDATED} * notification to any registered * {@linkplain org.jboss.as.controller.services.path.PathManager.Callback#pathEvent(Event, PathEntry) callbacks}. * @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 either an absolute path or * the relative portion of the path. Cannot be {@code null} */ final void changePath(String pathName, String path) { PathEntry pathEntry = findPathEntry(pathName); pathEntry.setPath(path); triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
final void changeRelativePath(String pathName, String relativePath, boolean check) throws OperationFailedException { PathEntry pathEntry = findPathEntry(pathName); synchronized (pathEntries) { if (pathEntry.getRelativeTo() != null) { Set<String> dependents = dependenctRelativePaths.get(pathEntry.getRelativeTo()); dependents.remove(pathEntry.getName()); } if (check && relativePath != null && pathEntries.get(relativePath) == null) { throw MESSAGES.pathEntryNotFound(pathName); } pathEntry.setRelativeTo(relativePath); pathEntry.setPathResolver(relativePath == null ? absoluteResolver : relativeResolver); addDependent(pathEntry.getName(), pathEntry.getRelativeTo()); } triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
final void changeRelativePath(String pathName, String relativePath, boolean check) throws OperationFailedException { PathEntry pathEntry = findPathEntry(pathName); synchronized (pathEntries) { if (pathEntry.getRelativeTo() != null) { Set<String> dependents = dependenctRelativePaths.get(pathEntry.getRelativeTo()); dependents.remove(pathEntry.getName()); } if (check && relativePath != null && pathEntries.get(relativePath) == null) { throw MESSAGES.pathEntryNotFound(pathName); } pathEntry.setRelativeTo(relativePath); pathEntry.setPathResolver(relativePath == null ? absoluteResolver : relativeResolver); addDependent(pathEntry.getName(), pathEntry.getRelativeTo()); } triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
/** * Updates the {@link PathEntry#getRelativeTo() relative to} value for an entry and sends an * {@link org.jboss.as.controller.services.path.PathManager.Event#UPDATED} * notification to any registered * {@linkplain org.jboss.as.controller.services.path.PathManager.Callback#pathEvent(Event, PathEntry) callbacks}. * @param pathName the logical name of the path within the model. Cannot be {@code null} * @param relativePath the new name of the path this path is relative to. If {@code null} this is an absolute path * @param check {@code true} if a check for the existence of an entry for the new {@code relativePath} value * should be performed * @throws OperationFailedException if {@code check} is {@code true} and no path exists whose name matches {@code relativePath} */ final void changeRelativePath(String pathName, String relativePath, boolean check) throws OperationFailedException { PathEntry pathEntry = findPathEntry(pathName); synchronized (pathEntries) { if (check && relativePath != null && pathEntries.get(relativePath) == null) { // TODO per method signature and usage in PathWriteAttributeHandler this should throw OFE. // But leave it for now as a better way to deal with this is to have capabilities for paths // and use capability resolution to detect invalid references throw ControllerLogger.ROOT_LOGGER.pathEntryNotFound(pathName); } if (pathEntry.getRelativeTo() != null) { Set<String> dependents = dependenctRelativePaths.get(pathEntry.getRelativeTo()); dependents.remove(pathEntry.getName()); } pathEntry.setRelativeTo(relativePath); pathEntry.setPathResolver(relativePath == null ? absoluteResolver : relativeResolver); addDependent(pathEntry.getName(), pathEntry.getRelativeTo()); } triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
/** * Updates the {@link PathEntry#getRelativeTo() relative to} value for an entry and sends an * {@link org.jboss.as.controller.services.path.PathManager.Event#UPDATED} * notification to any registered * {@linkplain org.jboss.as.controller.services.path.PathManager.Callback#pathEvent(Event, PathEntry) callbacks}. * @param pathName the logical name of the path within the model. Cannot be {@code null} * @param relativePath the new name of the path this path is relative to. If {@code null} this is an absolute path * @param check {@code true} if a check for the existence of an entry for the new {@code relativePath} value * should be performed * @throws OperationFailedException if {@code check} is {@code true} and no path exists whose name matches {@code relativePath} */ final void changeRelativePath(String pathName, String relativePath, boolean check) throws OperationFailedException { PathEntry pathEntry = findPathEntry(pathName); synchronized (pathEntries) { if (check && relativePath != null && pathEntries.get(relativePath) == null) { // TODO per method signature and usage in PathWriteAttributeHandler this should throw OFE. // But leave it for now as a better way to deal with this is to have capabilities for paths // and use capability resolution to detect invalid references throw ControllerLogger.ROOT_LOGGER.pathEntryNotFound(pathName); } if (pathEntry.getRelativeTo() != null) { Set<String> dependents = dependenctRelativePaths.get(pathEntry.getRelativeTo()); dependents.remove(pathEntry.getName()); } pathEntry.setRelativeTo(relativePath); pathEntry.setPathResolver(relativePath == null ? absoluteResolver : relativeResolver); addDependent(pathEntry.getName(), pathEntry.getRelativeTo()); } triggerCallbacksForEvent(pathEntry, Event.UPDATED); }
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 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 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); } }
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); } }
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, 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); } }