/** * Simple utility method to register a * {@link org.jboss.as.controller.capability.RuntimeCapability RuntimeCapability<?>} for each of the given * capability. They will be registered against {@link CapabilityScope#GLOBAL} and with the root resource and no * specific attribute as their {@link org.jboss.as.controller.capability.registry.RegistrationPoint}. * * @param capabilityRegistry registry to use * @param capabilities the capabilities. */ public static void registerCapabilities(RuntimeCapabilityRegistry capabilityRegistry, RuntimeCapability<?>... capabilities) { for (final RuntimeCapability<?> capability : capabilities) { capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
public CapabilityRegistration(C capability, CapabilityScope scope, RegistrationPoint registrationPoint) { this(capability, scope); this.registrationPoints.put(registrationPoint.getAddress(), registrationPoint); }
public synchronized boolean removeRegistrationPoint(RegistrationPoint toRemove) { PathAddress removedAddress = toRemove.getAddress(); if (!registrationPoints.containsKey(removedAddress)) { return false; } List<RegistrationPoint> registrationPoints = this.registrationPoints.get(removedAddress); if (toRemove.getAttribute() == null){ registrationPoints.clear(); } else { registrationPoints.remove(toRemove); } if (registrationPoints.isEmpty()) { this.registrationPoints.remove(removedAddress); } return true; }
/** * Simple utility method to register a * {@link org.jboss.as.controller.capability.RuntimeCapability RuntimeCapability<?>} for each of the given * capability. They will be registered against {@link CapabilityScope#GLOBAL} and with the root resource and no * specific attribute as their {@link org.jboss.as.controller.capability.registry.RegistrationPoint}. * * @param capabilityRegistry registry to use * @param capabilities the capabilities. */ public static void registerCapabilities(RuntimeCapabilityRegistry capabilityRegistry, RuntimeCapability<?>... capabilities) { for (final RuntimeCapability<?> capability : capabilities) { capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
public CapabilityRegistration(C capability, CapabilityScope scope, RegistrationPoint registrationPoint) { this(capability, scope); this.registrationPoints.put(registrationPoint.getAddress(), registrationPoint); }
public synchronized boolean removeRegistrationPoint(RegistrationPoint toRemove) { PathAddress removedAddress = toRemove.getAddress(); if (!registrationPoints.containsKey(removedAddress)) { return false; } List<RegistrationPoint> registrationPoints = this.registrationPoints.get(removedAddress); if (toRemove.getAttribute() == null){ registrationPoints.clear(); } else { registrationPoints.remove(toRemove); } if (registrationPoints.isEmpty()) { this.registrationPoints.remove(removedAddress); } return true; }
private static void registerServerPathCapability(CapabilityRegistry capabilityRegistry, String path) { capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(PATH_CAPABILITY.fromBaseCapability(path), CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } private final CapabilityRegistry localCapRegRef;
public synchronized boolean removeRegistrationPoint(RegistrationPoint toAdd) { PathAddress addedAddress = toAdd.getAddress(); if (!registrationPoints.containsKey(addedAddress)) { return false; } registrationPoints.remove(addedAddress); return true; }
if (rp.getAttribute() == null) { msg = msg.append('\n').append(ControllerLogger.ROOT_LOGGER.requirementPointSimple(reg.getDependentName(), rp.getAddress().toCLIStyleString())); } else { msg = msg.append('\n').append(ControllerLogger.ROOT_LOGGER.requirementPointFull(reg.getDependentName(), rp.getAttribute(), rp.getAddress().toCLIStyleString()));
private static void registerServerPathCapability(CapabilityRegistry capabilityRegistry, String path) { capabilityRegistry.registerCapability( new RuntimeCapabilityRegistration(PATH_CAPABILITY.fromBaseCapability(path), CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } private final CapabilityRegistry localCapRegRef;
public synchronized boolean addRegistrationPoint(RegistrationPoint toAdd) { PathAddress addedAddress = toAdd.getAddress(); if (registrationPoints.containsKey(addedAddress)) { return false; } registrationPoints.put(addedAddress, toAdd); return true; }
if (rp.getAttribute() == null) { msg = msg.append('\n').append(ControllerLogger.ROOT_LOGGER.requirementPointSimple(reg.getDependentName(), rp.getAddress().toCLIStyleString())); } else { msg = msg.append('\n').append(ControllerLogger.ROOT_LOGGER.requirementPointFull(reg.getDependentName(), rp.getAttribute(), rp.getAddress().toCLIStyleString()));
/** * Simple utility method to register a {@link org.jboss.as.controller.capability.RuntimeCapability} with the * specified {@link org.jboss.as.controller.capability.RuntimeCapability#getRuntimeAPI() runtime API} * for each of the given capability names. They will be registered against {@link CapabilityScope#GLOBAL} * and with the root resource and no specific attribute as their {@link org.jboss.as.controller.capability.registry.RegistrationPoint}. * * @param capabilityRegistry registry to use * @param capabilities map of names of capabilities to their runtime API implementation. */ public static void registerCapabilities(RuntimeCapabilityRegistry capabilityRegistry, final Map<String, Object> capabilities) { for (Map.Entry<String, Object> entry : capabilities.entrySet()) { final String capabilityName = entry.getKey(); RuntimeCapability<?> capability = createCapability(capabilityName, entry.getValue()); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
public synchronized boolean removeRegistrationPoint(RegistrationPoint toAdd) { PathAddress addedAddress = toAdd.getAddress(); if (!registrationPoints.containsKey(addedAddress)) { return false; } registrationPoints.remove(addedAddress); return true; }
/** * Simple utility method to register a {@link org.jboss.as.controller.capability.RuntimeCapability} with the * specified {@link org.jboss.as.controller.capability.RuntimeCapability#getRuntimeAPI() runtime API} * for each of the given capability names. They will be registered against {@link CapabilityScope#GLOBAL} * and with the root resource and no specific attribute as their {@link org.jboss.as.controller.capability.registry.RegistrationPoint}. * * @param capabilityRegistry registry to use * @param capabilities map of names of capabilities to their runtime API implementation. */ public static void registerCapabilities(RuntimeCapabilityRegistry capabilityRegistry, final Map<String, Object> capabilities) { for (Map.Entry<String, Object> entry : capabilities.entrySet()) { final String capabilityName = entry.getKey(); RuntimeCapability<?> capability = createCapability(capabilityName, entry.getValue()); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
public synchronized boolean addRegistrationPoint(RegistrationPoint toAdd) { PathAddress addedAddress = toAdd.getAddress(); if (registrationPoints.containsKey(addedAddress)) { return false; } registrationPoints.put(addedAddress, toAdd); return true; }
private RuntimeRequirementRegistration createRequirementRegistration(String required, String dependent, boolean runtimeOnly, Step step, String attribute) { CapabilityScope context = createCapabilityContext(step.address); RegistrationPoint rp = new RegistrationPoint(step.address, attribute); return new RuntimeRequirementRegistration(required, dependent, context, rp, runtimeOnly); }
private void putRegistrationPoint(RegistrationPoint registrationPoint) { PathAddress address = registrationPoint.getAddress(); if (this.registrationPoints.containsKey(address)) { this.registrationPoints.get(address).add(registrationPoint); } else { List<RegistrationPoint> registrationPoints = new ArrayList<>(); registrationPoints.add(registrationPoint); this.registrationPoints.put(address, registrationPoints); } } }
private RuntimeCapabilityRegistration createCapabilityRegistration(RuntimeCapability capability, Step step, String attribute) { CapabilityScope context = createCapabilityContext(step.address); RegistrationPoint rp = new RegistrationPoint(step.address, attribute); return new RuntimeCapabilityRegistration(capability, context, rp); }
private void putRegistrationPoint(RegistrationPoint registrationPoint) { PathAddress address = registrationPoint.getAddress(); if (this.registrationPoints.containsKey(address)) { this.registrationPoints.get(address).add(registrationPoint); } else { List<RegistrationPoint> registrationPoints = new ArrayList<>(); registrationPoints.add(registrationPoint); this.registrationPoints.put(address, registrationPoints); } } }