/** * @param address * @param resource * @see org.jboss.as.controller.registry.Resource#registerChild(org.jboss.as.controller.PathElement, * org.jboss.as.controller.registry.Resource) */ public void registerChild(PathElement address, Resource resource) { delegate.registerChild(address, resource); }
@Override public void registerChild(PathElement address, Resource resource) { assert resource instanceof LogStoreRuntimeResource; delegate.registerChild(address, resource); }
@Override public void registerChild(PathElement address, Resource resource) { assert resource instanceof IronJacamarRuntimeResource; delegate.registerChild(address, resource); }
@Override public void registerChild(final PathElement address, final Resource resource) { final String type = address.getKey(); if (BALANCER.equals(type)) { throw UndertowLogger.ROOT_LOGGER.cannotRegisterResourceOfType(type); } delegate.registerChild(address, resource); }
@Override public void registerChild(PathElement address, int index, Resource resource) { final String type = address.getKey(); if (BALANCER.equals(type)) { throw UndertowLogger.ROOT_LOGGER.cannotRegisterResourceOfType(type); } delegate.registerChild(address, index, resource); }
@Override public void registerChild(final PathElement address, final Resource resource) { final String type = address.getKey(); if (BatchJobExecutionResourceDefinition.EXECUTION.equals(type)) { throw BatchLogger.LOGGER.cannotRemoveResourceOfType(type); } delegate.registerChild(address, resource); }
public static void registerStatisticsResources(Resource datasourceResource) { synchronized (JDBC_STATISTICS) { if (!datasourceResource.hasChild(JDBC_STATISTICS)) { datasourceResource.registerChild(JDBC_STATISTICS, new PlaceholderResource.PlaceholderResourceEntry(JDBC_STATISTICS)); } if (!datasourceResource.hasChild(POOL_STATISTICS)) { datasourceResource.registerChild(POOL_STATISTICS, new PlaceholderResource.PlaceholderResourceEntry(POOL_STATISTICS)); } } }
public void timerCreated(String id) { PathElement address = PathElement.pathElement(EJB3SubsystemModel.TIMER, id); this.delegate.registerChild(address, Resource.Factory.create()); }
private void addParticipants(final Resource parent, Set<ObjectInstance> participants, MBeanServer mbs) throws IntrospectionException, InstanceNotFoundException, IOException, ReflectionException { int i = 1; for (ObjectInstance participant : participants) { final Resource resource = new LogStoreResource.LogStoreRuntimeResource(participant.getObjectName()); final ModelNode model = resource.getModel(); Map<String, String> pAttributes = getMBeanValues(mbs, participant.getObjectName(), LogStoreConstants.PARTICIPANT_JMX_NAMES); String pAddress = pAttributes.get(JNDI_PROPNAME); if (pAddress == null || pAddress.length() == 0) { pAttributes.put(JNDI_PROPNAME, String.valueOf(i++)); pAddress = pAttributes.get(JNDI_PROPNAME); } addAttributes(model, LogStoreConstants.MODEL_TO_JMX_PARTICIPANT_NAMES, pAttributes); // model.get(LogStoreConstants.JMX_ON_ATTRIBUTE).set(participant.getObjectName().getCanonicalName()); final PathElement element = PathElement.pathElement(LogStoreConstants.PARTICIPANTS, pAddress); parent.registerChild(element, resource); } }
private void addConfigProperties(final Resource parent, String name, String value) { final Resource config = new IronJacamarResource.IronJacamarRuntimeResource(); final ModelNode model = config.getModel(); model.get(Constants.CONFIG_PROPERTY_VALUE.getName()).set(value); final PathElement element = PathElement.pathElement(Constants.CONFIG_PROPERTIES.getName(), name); parent.registerChild(element, config); }
private void addTransactions(final Resource parent, Set<ObjectInstance> transactions, MBeanServer mbs) throws IntrospectionException, InstanceNotFoundException, IOException, ReflectionException, MalformedObjectNameException { for (ObjectInstance oi : transactions) { String transactionId = oi.getObjectName().getCanonicalName(); if (!transactionId.contains("puid") && transactionId.contains("itype")) { final Resource transaction = new LogStoreResource.LogStoreRuntimeResource(oi.getObjectName()); final ModelNode model = transaction.getModel(); Map<String, String> tAttributes = getMBeanValues( mbs, oi.getObjectName(), LogStoreConstants.TXN_JMX_NAMES); String txnId = tAttributes.get("Id"); addAttributes(model, LogStoreConstants.MODEL_TO_JMX_TXN_NAMES, tAttributes); // model.get(LogStoreConstants.JMX_ON_ATTRIBUTE).set(transactionId); String participantQuery = transactionId + ",puid=*"; Set<ObjectInstance> participants = mbs.queryMBeans(new ObjectName(participantQuery), null); addParticipants(transaction, participants, mbs); final PathElement element = PathElement.pathElement(LogStoreConstants.TRANSACTIONS, txnId); parent.registerChild(element, transaction); } } }
static Resource getOrCreate(final Resource parent, final PathAddress address) { Resource current = parent; for (final PathElement element : address) { synchronized (current) { if (current.hasChild(element)) { current = current.requireChild(element); } else { final Resource resource = Resource.Factory.create(); current.registerChild(element, resource); current = resource; } } } return current; }
public void execute(Resource parentResource, AS7MetadataRepository mdr, String name) { // Get the iron-jacamar resource final IronJacamarResource ironJacamarResource = new IronJacamarResource(); // Replace the current model with an updated one final Resource storeModel = getIronJacamarResource(mdr, name); ironJacamarResource.update(storeModel); PathElement ijPe = PathElement.pathElement(Constants.IRONJACAMAR_NAME, Constants.IRONJACAMAR_NAME); if (parentResource.getChild(ijPe) == null) { parentResource.registerChild(ijPe, ironJacamarResource); } }
resource.registerChild(peLocaldWm, wmResource);
@Override protected void initializeExtraSubystemsAndModel(ExtensionRegistry registry, Resource root, ManagementResourceRegistration registration, RuntimeCapabilityRegistry capabilityRegistry) { new JGroupsExtension().initialize(registry.getExtensionContext("jgroups", registration, ExtensionRegistryType.MASTER)); Resource subsystem = Resource.Factory.create(); // Need to use explicit names here due to signature change ("NoSuchMethodError: org.jboss.as.clustering.jgroups.subsystem.JGroupsSubsystemResourceDefinition$Attribute.getName()Ljava/lang/String;") subsystem.getModel().get("default-stack").set("tcp"); subsystem.getModel().get("default-channel").set("maximal-channel"); root.registerChild(JGroupsSubsystemResourceDefinition.PATH, subsystem); Resource channel = Resource.Factory.create(); subsystem.registerChild(ChannelResourceDefinition.pathElement("maximal-channel"), channel); Resource stack = Resource.Factory.create(); subsystem.registerChild(StackResourceDefinition.pathElement("tcp"), stack); Resource transport = Resource.Factory.create(); stack.registerChild(TransportResourceDefinition.pathElement("TCP"), transport); super.initializeExtraSubystemsAndModel(registry, root, registration, capabilityRegistry); } }
subModel.get(Constants.WM_SECURITY_MAPPING_TO.getName()).set(entry.getKey()); final PathElement element = PathElement.pathElement(Constants.WM_SECURITY_MAPPING_GROUPS.getName(), WM_SECURITY_MAPPING_GROUP.getName()); ijResourceAdapter.registerChild(element, mapping); subModel.get(Constants.WM_SECURITY_MAPPING_TO.getName()).set(entry.getKey()); final PathElement element = PathElement.pathElement(Constants.WM_SECURITY_MAPPING_USERS.getName(), WM_SECURITY_MAPPING_USER.getName()); ijResourceAdapter.registerChild(element, mapping); ijResourceAdapter.registerChild( PathElement.pathElement(Constants.STATISTICS_NAME, "local"), statsResource); parent.registerChild(element, ijResourceAdapter);
private void addAdminObject(final Resource parent, AdminObject adminObject) { final Resource adminObjectResource = new IronJacamarResource.IronJacamarRuntimeResource(); final ModelNode model = adminObjectResource.getModel(); setAttribute(model, CLASS_NAME, adminObject.getClassName()); setAttribute(model, JNDINAME, adminObject.getJndiName()); setAttribute(model, USE_JAVA_CONTEXT, adminObject.isUseJavaContext()); setAttribute(model, ENABLED, adminObject.isEnabled()); if (adminObject.getConfigProperties() != null) { for (Map.Entry<String, String> config : adminObject.getConfigProperties().entrySet()) { addConfigProperties(adminObjectResource, config.getKey(), config.getValue()); } } final PathElement element = PathElement.pathElement(Constants.ADMIN_OBJECTS_NAME, adminObject.getJndiName()); parent.registerChild(element, adminObjectResource); }
resource.registerChild(peAO, aoResource);
Class<? extends Protocol> transportClass = findProtocolClass(context, name, moduleName); registration.registerSubModel(this.createProtocolResourceDefinition(name, transportClass)); resource.registerChild(ProtocolResourceDefinition.pathElement(name), PlaceholderResource.INSTANCE); Class<? extends Protocol> protocolClass = findProtocolClass(context, name, moduleName); registration.registerSubModel(this.createProtocolResourceDefinition(name, protocolClass)); resource.registerChild(ProtocolResourceDefinition.pathElement(name), PlaceholderResource.INSTANCE); resource.registerChild(ProtocolResourceDefinition.pathElement(RelayConfiguration.PROTOCOL_NAME), PlaceholderResource.INSTANCE);
resource.registerChild(peStats, statsResource);