Skip to content

Commit

Permalink
MODE-2591 Changes the name of the datasource JNDI attribute for the D…
Browse files Browse the repository at this point in the history
…B persistence

This should now match the other DS JNDI names used by the database binary store and JDBC metadata connector
  • Loading branch information
Horia Chiorean committed Apr 21, 2016
1 parent 459a6ab commit 0e747bd
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 20 deletions.
Expand Up @@ -271,7 +271,7 @@
and indexes are stored within the server's data directory. This is the simplest way to configure a repository
that uses defaults for everything; feel free to change and specify other configuration options. -->
<repository name="sample" anonymous-roles="admin" cluster-name="sample-cluster" cluster-stack="tcp">
<db-persistence datasource-jndi="java:jboss/datasources/sampleDS"/>
<db-persistence data-source-jndi-name="java:jboss/datasources/sampleDS"/>
<file-binary-storage path="modeshape/sample/binaries" relative-to="${jboss.server.data.dir}"/>
</repository>
</subsystem>
Expand Down
Expand Up @@ -43,7 +43,6 @@ public enum Attribute {
DRIVER("driver"),
USERNAME("username"),
PASSWORD("password"),
PERSISTENCE_DS_JNDI("datasource-jndi"),
COMPRESS("compress"),
POOL_SIZE("pool-size"),
REPOSITORY_MODULE_DEPENDENCIES("depends-on"),
Expand Down
Expand Up @@ -357,7 +357,7 @@ private ModelNode parseDBPersistence(XMLExtendedStreamReader reader, String repo
case COMPRESS:
ModelAttributes.DB_COMPRESS.parseAndSetParameter(attrValue, persistence, reader);
break;
case PERSISTENCE_DS_JNDI:
case DATA_SOURCE_JNDI_NAME:
ModelAttributes.PERSISTENCE_DS_JNDI_NAME.parseAndSetParameter(attrValue, persistence, reader);
break;
case POOL_SIZE:
Expand Down
Expand Up @@ -852,10 +852,10 @@ public class ModelAttributes {
.build();

public static final MappedSimpleAttributeDefinition PERSISTENCE_DS_JNDI_NAME =
new MappedAttributeDefinitionBuilder(Attribute.PERSISTENCE_DS_JNDI.getLocalName(), ModelType.STRING,
new MappedAttributeDefinitionBuilder(Attribute.DATA_SOURCE_JNDI_NAME.getLocalName(), ModelType.STRING,
FieldName.STORAGE, FieldName.PERSISTENCE,
RelationalDbConfig.DATASOURCE_JNDI_NAME)
.setXmlName(Attribute.PERSISTENCE_DS_JNDI.getLocalName())
.setXmlName(Attribute.DATA_SOURCE_JNDI_NAME.getLocalName())
.setAllowExpression(true)
.setAllowNull(true)
.setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES)
Expand Down
Expand Up @@ -97,10 +97,9 @@ modeshape.repository.db-persistence.url = JDBC connection url
modeshape.repository.db-persistence.driver = JDBC driver FQN
modeshape.repository.db-persistence.username = JDBC connection username
modeshape.repository.db-persistence.password = JDBC connection password
modeshape.repository.db-persistence.datasource-jndi= JNDI datasource name
modeshape.repository.db-persistence.compress= Whether to compress binary data or not
modeshape.repository.db-persistence.pool-size= JDBC pool size
modeshape.repository.db-persistence.data-source-jndi-name= DS JNDI name
modeshape.repository.db-persistence.data-source-jndi-name= Datasource JNDI name
modeshape.repository.file-persistence = ModeShape FS persistence
modeshape.repository.file-persistence.add = Add ModeShape FS persistence
modeshape.repository.file-persistence.remove = Remove ModeShape FS persistence
Expand Down
Expand Up @@ -577,9 +577,11 @@
<xs:documentation>The password used for the JDBC connection authentication</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="datasource-jndi" type="xs:string" use="optional">
<xs:attribute name="data-source-jndi-name" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>The JNDI name of a DataSource. If used, this datasource *must not* be JTA enabled</xs:documentation>
<xs:documentation>
Specifies the JNDI name of the JDBC data source that should be used to store the repository data.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="compress" type="xs:boolean" use="optional" default="false">
Expand Down
@@ -1,6 +1,6 @@
<subsystem xmlns="urn:jboss:domain:modeshape:3.0">
<repository name="sampleDB">
<db-persistence url="jdbc:h2:mem:modeshape;DB_CLOSE_DELAY=0;" compress="false" create-on-start="false" datasource-jndi="name"
<db-persistence url="jdbc:h2:mem:modeshape;DB_CLOSE_DELAY=0;" compress="false" create-on-start="false" data-source-jndi-name="name"
driver="org.h2.Driver" drop-on-exit="false" fetch-size="1000" password="s" pool-size="11" table-name="MODESHAPE_REPOSITORY"
username="sa"/>
</repository>
Expand Down
Expand Up @@ -472,7 +472,7 @@
</external-sources>
</repository>
<repository name="dbBinaryJDBCRepository" anonymous-roles="admin">
<db-persistence drop-on-exit="true" datasource-jndi="java:jboss/datasources/ModeshapePersistenceDS"/>
<db-persistence drop-on-exit="true" data-source-jndi-name="java:jboss/datasources/ModeshapePersistenceDS"/>
<workspaces allow-workspace-creation="true" default-workspace="default">
<workspace name="default"/>
<initial-content>initial-content-default.xml</initial-content>
Expand All @@ -486,26 +486,26 @@
anonymous-roles="admin"
cluster-name="modeshape-wf-it1"
cluster-config="${jboss.server.config.dir}/modeshape/jgroups-test-config.xml">
<db-persistence datasource-jndi="java:jboss/datasources/ModeshapeClusterDS1"/>
<db-persistence data-source-jndi-name="java:jboss/datasources/ModeshapeClusterDS1"/>
</repository>
<repository name="repo-clustered2"
anonymous-roles="admin"
cluster-name="modeshape-wf-it1"
cluster-config="${jboss.server.config.dir}/modeshape/jgroups-test-config.xml">
<db-persistence datasource-jndi="java:jboss/datasources/ModeshapeClusterDS1"/>
<db-persistence data-source-jndi-name="java:jboss/datasources/ModeshapeClusterDS1"/>
</repository>

<repository name="repo-clustered3"
anonymous-roles="admin"
cluster-name="modeshape-wf-it2"
cluster-stack="tcp">
<db-persistence datasource-jndi="java:jboss/datasources/ModeshapeClusterDS2"/>
<db-persistence data-source-jndi-name="java:jboss/datasources/ModeshapeClusterDS2"/>
</repository>
<repository name="repo-clustered4"
anonymous-roles="admin"
cluster-name="modeshape-wf-it2"
cluster-stack="tcp">
<db-persistence datasource-jndi="java:jboss/datasources/ModeshapeClusterDS2"/>
<db-persistence data-source-jndi-name="java:jboss/datasources/ModeshapeClusterDS2"/>
</repository>
<repository name="compositeBinaryStoreRepository" anonymous-roles="admin">
<composite-binary-storage min-value-size="100">
Expand Down
Expand Up @@ -107,7 +107,7 @@
"default" : "",
"description" : "The db connection password"
},
"datasourceJNDI" : {
"dataSourceJndiName" : {
"type" : "string",
"description" : "The JNDI name of an existing datasource"
},
Expand Down
Expand Up @@ -23,7 +23,7 @@
"driver" : "test",
"username" : "test",
"password" : "",
"datasourceJNDI" : "test",
"dataSourceJndiName" : "test",
"tableName" : "test",
"createOnStart" : true,
"dropOnExit" : false,
Expand Down
Expand Up @@ -15,7 +15,7 @@
"driver" : "test",
"username" : "test",
"password" : "",
"datasourceJNDI" : "test",
"dataSourceJndiName" : "test",
"tableName" : "test",
"createOnStart" : true,
"dropOnExit" : false,
Expand Down
Expand Up @@ -107,7 +107,7 @@
"default" : "",
"description" : "The db connection password"
},
"datasourceJNDI" : {
"dataSourceJndiName" : {
"type" : "string",
"description" : "The JNDI name of an existing datasource"
},
Expand Down
Expand Up @@ -40,7 +40,7 @@ public final class RelationalDbConfig {
public static final String DRIVER = "driver";
public static final String USERNAME = "username";
public static final String PASSWORD = "password";
public static final String DATASOURCE_JNDI_NAME = "datasourceJNDI";
public static final String DATASOURCE_JNDI_NAME = "dataSourceJndiName";
public static final String POOL_SIZE = "poolSize";

protected static final String DEFAULT_CONNECTION_URL = "jdbc:h2:mem:modeshape;DB_CLOSE_DELAY=0;MVCC=TRUE";
Expand Down

0 comments on commit 0e747bd

Please sign in to comment.