[jboss-cvs] JBossAS SVN: r111777 - in trunk: connector/src/etc/example-config and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 18 12:34:28 EDT 2011
Author: alesj
Date: 2011-07-18 12:34:28 -0400 (Mon, 18 Jul 2011)
New Revision: 111777
Added:
trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiService.java
trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiServiceMBean.java
Modified:
trunk/build/build.xml
trunk/connector/src/etc/example-config/hsqldb-ds.xml
trunk/varia/src/assembly/jboss-bindingservice.xml
Log:
[JBAS-9419]; add DefaultDS alias to new AS7 default DS jndi name.
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2011-07-18 15:08:58 UTC (rev 111776)
+++ trunk/build/build.xml 2011-07-18 16:34:28 UTC (rev 111777)
@@ -1237,6 +1237,7 @@
<include name="jboss-as-varia-properties-plugin.jar"/>
<include name="jboss-as-varia-jboss-monitoring.jar"/>
<include name="jboss-as-varia-jboss-srp.jar"/>
+ <include name="jboss-as-varia-jboss-bindingservice.jar"/>
</fileset>
<mapper type="glob" from="jboss-as-varia-*.jar" to="*.jar"/>
</copy>
Modified: trunk/connector/src/etc/example-config/hsqldb-ds.xml
===================================================================
--- trunk/connector/src/etc/example-config/hsqldb-ds.xml 2011-07-18 15:08:58 UTC (rev 111776)
+++ trunk/connector/src/etc/example-config/hsqldb-ds.xml 2011-07-18 16:34:28 UTC (rev 111777)
@@ -121,5 +121,12 @@
<attribute name="Database">localDB</attribute>
<attribute name="InProcessMode">true</attribute>
</mbean>
-
+
+ <!-- Create an alias to new JBoss7 default DS name -->
+ <mbean code="org.jboss.services.binding.AliasJndiService"
+ name="jboss.jca:name=jboss/datasources/ExampleDS,service=DataSourceBinding">
+ <attribute name="Alias">java:jboss/datasources/ExampleDS</attribute>
+ <attribute name="Original">java:DefaultDS</attribute>
+ </mbean>
+
</datasources>
Modified: trunk/varia/src/assembly/jboss-bindingservice.xml
===================================================================
--- trunk/varia/src/assembly/jboss-bindingservice.xml 2011-07-18 15:08:58 UTC (rev 111776)
+++ trunk/varia/src/assembly/jboss-bindingservice.xml 2011-07-18 16:34:28 UTC (rev 111777)
@@ -9,7 +9,7 @@
<directory>target/classes</directory>
<outputDirectory>/</outputDirectory>
<includes>
- <include>org/jboss/services/binding/**</include>
+ <include>org/jboss/services/binding/AliasJndiService**</include>
</includes>
</fileSet>
</fileSets>
Copied: trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiService.java (from rev 111768, trunk/varia/src/main/java/org/jboss/jdbc/HypersonicDatabase.java)
===================================================================
--- trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiService.java (rev 0)
+++ trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiService.java 2011-07-18 16:34:28 UTC (rev 111777)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.services.binding;
+
+import org.jboss.naming.Util;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * Register JNDI alias for original.
+ * e.g. new AS7 default DS --> legacy default DS
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class AliasJndiService extends ServiceMBeanSupport
+ implements AliasJndiServiceMBean
+{
+ private String alias;
+ private String original;
+
+ @Override
+ protected void startService() throws Exception
+ {
+ Util.createLinkRef(alias, original);
+ }
+
+ @Override
+ protected void stopService() throws Exception
+ {
+ Util.removeLinkRef(alias);
+ }
+
+ public String getAlias()
+ {
+ return alias;
+ }
+
+ public void setAlias(String alias)
+ {
+ this.alias = alias;
+ }
+
+ public String getOriginal()
+ {
+ return original;
+ }
+
+ public void setOriginal(String original)
+ {
+ this.original = original;
+ }
+}
Property changes on: trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiService.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
Copied: trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiServiceMBean.java (from rev 111768, trunk/varia/src/main/java/org/jboss/jdbc/HypersonicDatabaseMBean.java)
===================================================================
--- trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiServiceMBean.java (rev 0)
+++ trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiServiceMBean.java 2011-07-18 16:34:28 UTC (rev 111777)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.services.binding;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * MBean interface.
+ */
+public interface AliasJndiServiceMBean extends ServiceMBean
+{
+ String getAlias();
+ void setAlias(String alias);
+
+ String getOriginal();
+ void setOriginal(String original);
+}
Property changes on: trunk/varia/src/main/java/org/jboss/services/binding/AliasJndiServiceMBean.java
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision
Added: svn:eol-style
+ native
More information about the jboss-cvs-commits
mailing list