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); } } }
@Override public void start(StartContext context) throws StartException { path = resolvePath(); }
@Deprecated public static boolean isAbsoluteUnixOrWindowsPath(final String path) { return org.jboss.as.controller.services.path.AbstractPathService.isAbsoluteUnixOrWindowsPath(path); } }
@Deprecated public static ServiceName pathNameOf(String pathName) { return org.jboss.as.controller.services.path.AbstractPathService.pathNameOf(pathName); }
if (c0 == '\\' && c1 == '\\') { return true; // Absolute UNC pathname "\\\\foo" } else if (length > 2 && c1 == ':' && path.charAt(2) == '\\' && isDriveLetter(c0) ) { return true; // Absolute local pathname "z:\\foo"
@Deprecated public static boolean isAbsoluteUnixOrWindowsPath(final String path) { return org.jboss.as.controller.services.path.AbstractPathService.isAbsoluteUnixOrWindowsPath(path); } }
@Deprecated public static ServiceName pathNameOf(String pathName) { return org.jboss.as.controller.services.path.AbstractPathService.pathNameOf(pathName); }
if (c0 == '\\' && c1 == '\\') { return true; // Absolute UNC pathname "\\\\foo" } else if (length > 2 && c1 == ':' && path.charAt(2) == '\\' && isDriveLetter(c0) ) { return true; // Absolute local pathname "z:\\foo"
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); } } }
@Override public ModelNode correct(final ModelNode newValue, final ModelNode currentValue) { if (newValue.getType() == ModelType.UNDEFINED) { return newValue; } if (newValue.getType() != ModelType.OBJECT || currentValue.getType() != ModelType.OBJECT) { return newValue; } final ModelNode newPath = newValue.get(PATH.getName()); if (newPath.isDefined() && !AbstractPathService.isAbsoluteUnixOrWindowsPath(newPath.asString())) { if (currentValue.hasDefined(RELATIVE_TO.getName()) && !newValue.hasDefined(RELATIVE_TO.getName())) { newValue.get(RELATIVE_TO.getName()).set(currentValue.get(RELATIVE_TO.getName())); } } return newValue; } }
/** * Removes any {@code Service<String>} for the given path. * @param operationContext the operation context associated with the management operation making this request. Cannot be {@code null} * @param pathName the name of the relevant path. Cannot be {@code null} */ final void removePathService(final OperationContext operationContext, final String pathName) { final ServiceController<?> serviceController = operationContext.getServiceRegistry(true).getService(AbstractPathService.pathNameOf(pathName)); if (serviceController != null) { operationContext.removeService(serviceController); } }
@Override public void start(StartContext context) throws StartException { path = resolvePath(); }
if (c0 == '\\' && c1 == '\\') { return true; // Absolute UNC pathname "\\\\foo" } else if (length > 2 && c1 == ':' && path.charAt(2) == '\\' && isDriveLetter(c0) ) { return true; // Absolute local pathname "z:\\foo"
/** * 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); } }
@Override public ModelNode correct(final ModelNode newValue, final ModelNode currentValue) { if (newValue.getType() == ModelType.UNDEFINED) { return newValue; } if (newValue.getType() != ModelType.OBJECT || currentValue.getType() != ModelType.OBJECT) { return newValue; } final ModelNode newPath = newValue.get(PATH.getName()); if (newPath.isDefined() && !AbstractPathService.isAbsoluteUnixOrWindowsPath(newPath.asString())) { if (currentValue.hasDefined(RELATIVE_TO.getName()) && !newValue.hasDefined(RELATIVE_TO.getName())) { newValue.get(RELATIVE_TO.getName()).set(currentValue.get(RELATIVE_TO.getName())); } } return newValue; } }
final void removePathService(final OperationContext operationContext, final String pathName) { final ServiceController<?> serviceController = operationContext.getServiceRegistry(true).getService(AbstractPathService.pathNameOf(pathName)); if (serviceController != null) { operationContext.removeService(serviceController); } }
@Override public void start(StartContext context) throws StartException { path = resolvePath(); }
if (c0 == '\\' && c1 == '\\') { return true; // Absolute UNC pathname "\\\\foo" } else if (length > 2 && c1 == ':' && path.charAt(2) == '\\' && isDriveLetter(c0) ) { return true; // Absolute local pathname "z:\\foo"
/** * 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); } }
@Override public ModelNode correct(final ModelNode newValue, final ModelNode currentValue) { if (newValue.getType() == ModelType.UNDEFINED) { return newValue; } if (newValue.getType() != ModelType.OBJECT || currentValue.getType() != ModelType.OBJECT) { return newValue; } final ModelNode newPath = newValue.get(PATH.getName()); if (newPath.isDefined() && !AbstractPathService.isAbsoluteUnixOrWindowsPath(newPath.asString())) { if (currentValue.hasDefined(RELATIVE_TO.getName()) && !newValue.hasDefined(RELATIVE_TO.getName())) { newValue.get(RELATIVE_TO.getName()).set(currentValue.get(RELATIVE_TO.getName())); } } return newValue; } }