Search in sources :

Example 56 with Property

use of org.jboss.dmr.Property in project wildfly by wildfly.

the class EJB3SubsystemXMLPersister method writeProfiles.

private void writeProfiles(final XMLExtendedStreamWriter writer, final ModelNode model) throws XMLStreamException {
    final List<Property> profiles = model.get(REMOTING_PROFILE).asPropertyList();
    for (final Property property : profiles) {
        writer.writeStartElement(PROFILE);
        writer.writeAttribute(EJB3SubsystemXMLAttribute.NAME.getLocalName(), property.getName());
        final ModelNode profileNode = property.getValue();
        RemotingProfileResourceDefinition.EXCLUDE_LOCAL_RECEIVER.marshallAsAttribute(profileNode, writer);
        RemotingProfileResourceDefinition.LOCAL_RECEIVER_PASS_BY_VALUE.marshallAsAttribute(profileNode, writer);
        if (profileNode.hasDefined(REMOTING_EJB_RECEIVER)) {
            writeRemotingEjbReceivers(writer, profileNode);
        }
        if (profileNode.hasDefined(REMOTE_HTTP_CONNECTION)) {
            writeRemoteHttpConnection(writer, profileNode);
        }
        StaticEJBDiscoveryDefinition.INSTANCE.marshallAsElement(profileNode, writer);
        writer.writeEndElement();
    }
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property)

Example 57 with Property

use of org.jboss.dmr.Property in project wildfly by wildfly.

the class EJB3SubsystemXMLPersister method writeClusterPassivationStores.

/**
 * Persist as a passivation-store using relevant attributes
 */
private void writeClusterPassivationStores(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException {
    if (model.hasDefined(EJB3SubsystemModel.CLUSTER_PASSIVATION_STORE)) {
        List<Property> caches = model.get(EJB3SubsystemModel.CLUSTER_PASSIVATION_STORE).asPropertyList();
        for (Property property : caches) {
            // <strict-max-pool>
            writer.writeStartElement(EJB3SubsystemXMLElement.CLUSTER_PASSIVATION_STORE.getLocalName());
            ModelNode store = property.getValue();
            writer.writeAttribute(EJB3SubsystemXMLAttribute.NAME.getLocalName(), property.getName());
            LegacyPassivationStoreResourceDefinition.IDLE_TIMEOUT.marshallAsAttribute(store, writer);
            LegacyPassivationStoreResourceDefinition.IDLE_TIMEOUT_UNIT.marshallAsAttribute(store, writer);
            ClusterPassivationStoreResourceDefinition.MAX_SIZE.marshallAsAttribute(store, writer);
            ClusterPassivationStoreResourceDefinition.CACHE_CONTAINER.marshallAsAttribute(store, writer);
            ClusterPassivationStoreResourceDefinition.BEAN_CACHE.marshallAsAttribute(store, writer);
            ClusterPassivationStoreResourceDefinition.CLIENT_MAPPINGS_CACHE.marshallAsAttribute(store, writer);
            ClusterPassivationStoreResourceDefinition.PASSIVATE_EVENTS_ON_REPLICATE.marshallAsAttribute(store, writer);
            writer.writeEndElement();
        }
    }
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property)

Example 58 with Property

use of org.jboss.dmr.Property in project wildfly by wildfly.

the class EJB3SubsystemXMLPersister method writeBeanInstancePools.

private void writeBeanInstancePools(final XMLExtendedStreamWriter writer, final ModelNode beanInstancePoolModelNode) throws XMLStreamException {
    if (beanInstancePoolModelNode.hasDefined(EJB3SubsystemModel.STRICT_MAX_BEAN_INSTANCE_POOL)) {
        final List<Property> strictMaxPools = beanInstancePoolModelNode.get(EJB3SubsystemModel.STRICT_MAX_BEAN_INSTANCE_POOL).asPropertyList();
        for (Property property : strictMaxPools) {
            // <strict-max-pool>
            writer.writeStartElement(EJB3SubsystemXMLElement.STRICT_MAX_POOL.getLocalName());
            // contents of strict-max-pool
            this.writeStrictMaxPoolConfig(writer, property);
            // </strict-max-pool>
            writer.writeEndElement();
        }
    }
}
Also used : Property(org.jboss.dmr.Property)

Example 59 with Property

use of org.jboss.dmr.Property in project wildfly by wildfly.

the class EJB3SubsystemXMLPersister method writeRemotingEjbReceivers.

private void writeRemotingEjbReceivers(final XMLExtendedStreamWriter writer, final ModelNode profileNode) throws XMLStreamException {
    final List<Property> receivers = profileNode.get(REMOTING_EJB_RECEIVER).asPropertyList();
    for (final Property property : receivers) {
        writer.writeStartElement(REMOTING_EJB_RECEIVER);
        writer.writeAttribute(EJB3SubsystemXMLAttribute.NAME.getLocalName(), property.getName());
        final ModelNode receiverNode = property.getValue();
        RemotingEjbReceiverDefinition.OUTBOUND_CONNECTION_REF.marshallAsAttribute(receiverNode, writer);
        RemotingEjbReceiverDefinition.CONNECT_TIMEOUT.marshallAsAttribute(receiverNode, writer);
        if (receiverNode.hasDefined(CHANNEL_CREATION_OPTIONS)) {
            writeChannelCreationOptions(writer, receiverNode.get(CHANNEL_CREATION_OPTIONS));
        }
        writer.writeEndElement();
    }
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property)

Example 60 with Property

use of org.jboss.dmr.Property in project wildfly by wildfly.

the class EJB3SubsystemXMLPersister method writeDatabaseDataStores.

private void writeDatabaseDataStores(final XMLExtendedStreamWriter writer, final ModelNode timerServiceModel) throws XMLStreamException {
    if (timerServiceModel.hasDefined(EJB3SubsystemModel.DATABASE_DATA_STORE)) {
        List<Property> stores = timerServiceModel.get(EJB3SubsystemModel.DATABASE_DATA_STORE).asPropertyList();
        for (Property property : stores) {
            writer.writeStartElement(EJB3SubsystemXMLElement.DATABASE_DATA_STORE.getLocalName());
            ModelNode store = property.getValue();
            writer.writeAttribute(EJB3SubsystemXMLAttribute.NAME.getLocalName(), property.getName());
            DatabaseDataStoreResourceDefinition.DATASOURCE_JNDI_NAME.marshallAsAttribute(store, writer);
            DatabaseDataStoreResourceDefinition.DATABASE.marshallAsAttribute(store, writer);
            DatabaseDataStoreResourceDefinition.PARTITION.marshallAsAttribute(store, writer);
            DatabaseDataStoreResourceDefinition.REFRESH_INTERVAL.marshallAsAttribute(store, writer);
            DatabaseDataStoreResourceDefinition.ALLOW_EXECUTION.marshallAsAttribute(store, writer);
            writer.writeEndElement();
        }
    }
}
Also used : ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property)

Aggregations

Property (org.jboss.dmr.Property)179 ModelNode (org.jboss.dmr.ModelNode)144 HashMap (java.util.HashMap)19 Test (org.junit.Test)19 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)12 PathAddress (org.jboss.as.controller.PathAddress)11 ArrayList (java.util.ArrayList)10 ValueExpression (org.jboss.dmr.ValueExpression)10 ModelType (org.jboss.dmr.ModelType)9 Map (java.util.Map)8 HashSet (java.util.HashSet)7 ArrayDeque (java.util.ArrayDeque)6 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)6 OperationFailedException (org.jboss.as.controller.OperationFailedException)6 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)6 Properties (java.util.Properties)5 LoginModuleControlFlag (javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag)4 SimpleString (org.apache.activemq.artemis.api.core.SimpleString)4 HttpResponse (org.apache.http.HttpResponse)3 HttpGet (org.apache.http.client.methods.HttpGet)3