private static void copyCapabilities(final Map<CapabilityId, RuntimeCapabilityRegistration> source, final Map<CapabilityId, RuntimeCapabilityRegistration> dest) { for (Map.Entry<CapabilityId, RuntimeCapabilityRegistration> entry : source.entrySet()) { dest.put(entry.getKey(), new RuntimeCapabilityRegistration(entry.getValue())); } }
private static void copyCapabilities(final Map<CapabilityId, RuntimeCapabilityRegistration> source, final Map<CapabilityId, RuntimeCapabilityRegistration> dest) { for (Map.Entry<CapabilityId, RuntimeCapabilityRegistration> entry : source.entrySet()) { dest.put(entry.getKey(), new RuntimeCapabilityRegistration(entry.getValue())); } }
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 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); }
/** * 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))); } }
/** * 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))); } }
/** * Simple utility method to register a {@link org.jboss.as.controller.capability.RuntimeCapability} with the * specified service type 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 the type exposed by the MSC service the capability installs */ public static void registerServiceCapabilities(RuntimeCapabilityRegistry capabilityRegistry, final Map<String, Class> capabilities) { for (Map.Entry<String, Class> entry : capabilities.entrySet()) { final String capabilityName = entry.getKey(); RuntimeCapability<?> capability = RuntimeCapability.Builder.of(capabilityName, entry.getValue()).build(); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
/** * Simple utility method to register a {@link org.jboss.as.controller.capability.RuntimeCapability} with the * specified service type 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 the type exposed by the MSC service the capability installs */ public static void registerServiceCapabilities(RuntimeCapabilityRegistry capabilityRegistry, final Map<String, Class> capabilities) { for (Map.Entry<String, Class> entry : capabilities.entrySet()) { final String capabilityName = entry.getKey(); RuntimeCapability<?> capability = RuntimeCapability.Builder.of(capabilityName, entry.getValue()).build(); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
/** * 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))); } }
/** * 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))); } }
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;
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;
/** * Simple utility method to register a single {@link org.jboss.as.controller.capability.RuntimeCapability} with the * specified service type for the given capability name. It will be registered against * {@link CapabilityScope#GLOBAL} * and with the root resource and no specific attribute as its {@link org.jboss.as.controller.capability.registry.RegistrationPoint}. * * @param capabilityRegistry registry to use * @param name the names of they capability * @param serviceType the type exposed by the MSC service the capability installs */ public static void registerServiceCapability(RuntimeCapabilityRegistry capabilityRegistry, String name, Class serviceType) { RuntimeCapability<?> capability = RuntimeCapability.Builder.of(name, serviceType).build(); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); }
/** * Simple utility method to register a single {@link org.jboss.as.controller.capability.RuntimeCapability} with the * specified service type for the given capability name. It will be registered against * {@link CapabilityScope#GLOBAL} * and with the root resource and no specific attribute as its {@link org.jboss.as.controller.capability.registry.RegistrationPoint}. * * @param capabilityRegistry registry to use * @param name the names of they capability * @param serviceType the type exposed by the MSC service the capability installs */ public static void registerServiceCapability(RuntimeCapabilityRegistry capabilityRegistry, String name, Class serviceType) { RuntimeCapability<?> capability = RuntimeCapability.Builder.of(name, serviceType).build(); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); }
/** * Simple utility method to register a * {@link org.jboss.as.controller.capability.RuntimeCapability RuntimeCapability<Void>} 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 names of the capabilities. */ public static void registerCapabilities(RuntimeCapabilityRegistry capabilityRegistry, String... capabilities) { for (final String capabilityName : capabilities) { RuntimeCapability<Void> capability = RuntimeCapability.Builder.of(capabilityName).build(); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
/** * Simple utility method to register a * {@link org.jboss.as.controller.capability.RuntimeCapability RuntimeCapability<Void>} 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 names of the capabilities. */ public static void registerCapabilities(RuntimeCapabilityRegistry capabilityRegistry, String... capabilities) { for (final String capabilityName : capabilities) { RuntimeCapability<Void> capability = RuntimeCapability.Builder.of(capabilityName).build(); capabilityRegistry.registerCapability(new RuntimeCapabilityRegistration(capability, CapabilityScope.GLOBAL, new RegistrationPoint(PathAddress.EMPTY_ADDRESS, null))); } }
/** * 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; }
@Override public void populateModel(ManagementModel managementModel) { populateModel(managementModel.getRootResource()); for (LegacyModelInitializerEntry entry : entries) { if (entry.getCapabilities() != null) { PathAddress parent = entry.getParentAddress(); if (parent == null) { parent = PathAddress.EMPTY_ADDRESS; } PathAddress pa = parent.append(entry.getRelativeResourceAddress()); CapabilityScope scope = CapabilityScope.Factory.create(ProcessType.HOST_CONTROLLER, pa); RuntimeCapabilityRegistry cr = managementModel.getCapabilityRegistry(); for (String capabilityName : entry.getCapabilities()) { RuntimeCapability<Void> capability = RuntimeCapability.Builder.of(capabilityName).build(); RuntimeCapabilityRegistration reg = new RuntimeCapabilityRegistration(capability, scope, new RegistrationPoint(pa, null)); cr.registerCapability(reg); } } } }
@Override public void populateModel(ManagementModel managementModel) { populateModel(managementModel.getRootResource()); for (LegacyModelInitializerEntry entry : entries) { if (entry.getCapabilities() != null) { PathAddress parent = entry.getParentAddress(); if (parent == null) { parent = PathAddress.EMPTY_ADDRESS; } PathAddress pa = parent.append(entry.getRelativeResourceAddress()); CapabilityScope scope = CapabilityScope.Factory.create(ProcessType.HOST_CONTROLLER, pa); RuntimeCapabilityRegistry cr = managementModel.getCapabilityRegistry(); for (String capabilityName : entry.getCapabilities()) { RuntimeCapability<Void> capability = RuntimeCapability.Builder.of(capabilityName).build(); RuntimeCapabilityRegistration reg = new RuntimeCapabilityRegistration(capability, scope, new RegistrationPoint(pa, null)); cr.registerCapability(reg); } } } }