[jboss-svn-commits] JBL Code SVN: r7884 - in labs/jbossesb/trunk/product: . core core/listeners/src/org/jboss/soa/esb/listeners/old core/services core/services/src/org/jboss/soa/esb/services core/services/tests/src/org/jboss/soa/esb/services/beans
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Nov 28 12:55:38 EST 2006
Author: tfennelly
Date: 2006-11-28 12:55:28 -0500 (Tue, 28 Nov 2006)
New Revision: 7884
Removed:
labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java
labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java
labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java
labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/beans/
labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/beans/NotificationUnitTest.java
Modified:
labs/jbossesb/trunk/product/build.xml
labs/jbossesb/trunk/product/core/build.xml
labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/GpListener.java
labs/jbossesb/trunk/product/core/services/build.xml
Log:
Removed the notification Session Bean.
Modified: labs/jbossesb/trunk/product/build.xml
===================================================================
--- labs/jbossesb/trunk/product/build.xml 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/build.xml 2006-11-28 17:55:28 UTC (rev 7884)
@@ -116,8 +116,6 @@
<ant dir="core" target="jar"/>
</target>
- <!-- add ear file rule -->
-
<target name="org.jboss.esb.javadocs"
depends="org.jboss.esb.internal.init">
<echo message="Building javadocs"/>
@@ -258,10 +256,6 @@
</copy>
</target>
- <target name="earinstr" depends="purge,compile">
- <ant dir="core" target="earinstr"/>
- </target>
-
<!-- Clean targets -->
<target name="org.jboss.esb.clean">
<echo message="Cleaning modules"/>
@@ -288,16 +282,14 @@
<target name="purge" depends="org.jboss.esb.purge"/>
<target name="javadoc" depends="org.jboss.esb.javadocs"/>
- <target name="deploy" depends="install">
- <ant dir="install" target="configure"/>
- <copy file="${org.jboss.esb.installationdirectory}/lib/jbossesb-appl.ear"
- todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy"/>
+ <target name="deploy">
+ <echo message="****" />
+ <echo message="**** DEPRECATED TARGET:" />
+ <echo message="**** No longer deploying a J2EE EAR file. All hard dependencies on an Application Server have been removed!" />
+ <echo message="**** Just run the 'install' target instead!" />
+ <echo message="****" />
</target>
- <target name="deploy-instr" depends="earinstr">
- <copy file="${org.jboss.esb.internal.dest}/tests/coverage/all/jbossesb-appl.ear"
- todir="${org.jboss.esb.appserver.home}/server/${org.jboss.esb.appserver.config}/deploy"/>
- </target>
<target name="instr-report">
<ant dir="core" target="instr-report"/>
</target>
Modified: labs/jbossesb/trunk/product/core/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/build.xml 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/build.xml 2006-11-28 17:55:28 UTC (rev 7884)
@@ -60,52 +60,11 @@
<ant dir="rosetta" target="jar"/>
<ant dir="listeners" target="jar"/>
<ant dir="services" target="jar"/>
- <antcall target="-ear"/>
</target>
- <target name="-ear">
- <ear destfile="${org.jboss.esb.internal.dest}/dist/lib/jbossesb-appl.ear"
- appxml="services/src/META-INF/application.xml">
- <fileset dir="${org.jboss.esb.internal.dest}/dist/lib"
- includes="*.jar"
- />
- <fileset dir="../lib/ext/"
- includes="jbossts-common.jar"
- />
- </ear>
- </target>
-
<property name="classes.dir" value="${org.jboss.esb.internal.dest}/classes"/>
<property name="coverage.dir" value="${org.jboss.esb.internal.dest}/tests/coverage"/>
- <target name="earinstr">
- <echo message="Building Instrumented App"/>
- <!-- Instrument everything... -->
- <delete dir="${coverage.dir}/all" />
- <mkdir dir="${coverage.dir}/all" />
- <emma>
- <instr instrpath="${classes.dir}/rosetta" destdir="${coverage.dir}/all/instr" metadatafile="${coverage.dir}/all/coverage.emma" />
- </emma>
- <emma>
- <instr instrpath="${classes.dir}/listeners" destdir="${coverage.dir}/all/instr" metadatafile="${coverage.dir}/all/coverage.emma" />
- </emma>
- <emma>
- <instr instrpath="${classes.dir}/services" destdir="${coverage.dir}/all/instr" metadatafile="${coverage.dir}/all/coverage.emma" />
- </emma>
-
- <!-- Jar everything, including what disn't get intrumented i.e. interfaces etc... -->
- <jar destfile="${org.jboss.esb.internal.dest}/tests/coverage/all/jbossesb-instr-all.jar">
- <fileset dir="${classes.dir}/rosetta"/><fileset dir="${classes.dir}/listeners"/><fileset dir="${classes.dir}/services"/>
- <fileset dir="${coverage.dir}/all/instr" />
- </jar>
-
- <ear destfile="${coverage.dir}/all/jbossesb-appl.ear" appxml="services/tests/application.xml">
- <fileset dir="${coverage.dir}/all/" includes="jbossesb-instr-all.jar"/>
- <fileset dir="../lib/ext/" includes="jbossts-common.jar" />
- </ear>
-
- </target>
-
<target name="instr-report">
<emma>
<report sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/GpListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/GpListener.java 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/GpListener.java 2006-11-28 17:55:28 UTC (rev 7884)
@@ -44,7 +44,6 @@
import org.jboss.soa.esb.notification.NotificationList;
import org.jboss.soa.esb.parameters.ParamRepositoryException;
import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-import org.jboss.soa.esb.services.NotificationHandlerFactory;
import org.jboss.soa.esb.services.NotificationManager;
import org.jboss.soa.esb.util.Util;
import org.xml.sax.SAXException;
@@ -585,7 +584,8 @@
NotificationList oNL = new NotificationList(oCurr);
if (!oNL.isOK())
continue;
- getNotifHandler().sendNotifications(oCurr, oNotif);
+
+ oNL.sendNotification(oNotif);
}
} catch (Exception e) {
}
@@ -619,12 +619,13 @@
oPS.close();
String sMsg = oBO.toString();
- for (ConfigTree oCurr : p_oP
- .getChildren(NotificationList.ELEMENT)) {
+ for (ConfigTree oCurr : p_oP.getChildren(NotificationList.ELEMENT)) {
NotificationList oNL = new NotificationList(oCurr);
+
if (!oNL.isErr())
continue;
- getNotifHandler().sendNotifications(oNL, sMsg);
+
+ oNL.sendNotification(sMsg);
}
} catch (Exception e) {
}
@@ -634,27 +635,4 @@
private static final Object s_oSync = new Integer(0);
- /**
- * Lazy instantiator of a InotificationHandler
- *
- * @return - a reference to an implementation of the interface or null if it
- * can't be instantiated
- */
- protected static NotificationManager getNotifHandler() {
- if (null != s_oNH)
- return s_oNH;
- synchronized (s_oSync) {
- if (null == s_oNH)
- try {
- s_oNH = NotificationHandlerFactory.getNotifHandler(
- "remote", Configuration.getJndiServerType(),
- Configuration.getJndiServerURL());
- } catch (Exception e) {
- Logger.getLogger(GpListener.class).error(
- "Notification FAILED", e);
- }
- }
- return s_oNH;
- } // ______________________________
-
} // ____________________________________________________________________________
Modified: labs/jbossesb/trunk/product/core/services/build.xml
===================================================================
--- labs/jbossesb/trunk/product/core/services/build.xml 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/services/build.xml 2006-11-28 17:55:28 UTC (rev 7884)
@@ -122,22 +122,8 @@
includes="**/*.drl,**/*.dsl"
/>
- <antcall target="-ear"/>
</target>
- <target name="-ear">
- <ear destfile="${org.jboss.esb.services.dist.dir}/lib/jbossesb-appl.ear"
- appxml="${org.jboss.esb.services.metainf.dir}/application.xml">
- <fileset dir="${org.jboss.esb.services.dist.dir}"
- includes="jbossesb-rosetta.jar
- ,CQ3ServicesClient.jar
- ,CQ3Services.jar
- "/>
- </ear>
-
- </target>
-
-
<!-- =================================================================== -->
<!-- Test -->
<!-- =================================================================== -->
Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateLocal.java 2006-11-28 17:55:28 UTC (rev 7884)
@@ -1,52 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.soa.esb.services;
-
-import java.io.Serializable;
-
-import javax.naming.Context;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.beans.NotificationHandler;
-
-public class NotifHandlerBsDelegateLocal implements NotificationManager
-{
- private NotificationHandler m_oNotifH;
-
- public NotifHandlerBsDelegateLocal(Context p_ctx) throws Exception
- {
- m_oNotifH = (NotificationHandler) p_ctx.lookup("jbossesb-appl/NotificationHandlerBean/local");
- m_oNotifH.create();
- }
-
- public void sendNotifications(ConfigTree p_oP, Serializable p_o)
- throws Exception
- {
- m_oNotifH.sendNotifications(p_oP.toString(), p_o);
- }
-
- public void sendNotifications(Serializable p_o) throws Exception
- {
- m_oNotifH.sendNotifications(null, p_o);
- }
-}
Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotifHandlerBsDelegateRemote.java 2006-11-28 17:55:28 UTC (rev 7884)
@@ -1,53 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.soa.esb.services;
-
-import java.io.Serializable;
-
-import javax.naming.Context;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.beans.NotificationHandler;
-
-public class NotifHandlerBsDelegateRemote implements NotificationManager
-{
- private NotificationHandler m_oNotifH;
-
- public NotifHandlerBsDelegateRemote(Context p_ctx) throws Exception
- {
- m_oNotifH = (NotificationHandler) p_ctx.lookup("jbossesb-appl/NotificationHandlerBean/remote");
- m_oNotifH.create();
- }
-
- public void sendNotifications(ConfigTree p_oP, Serializable p_o)
- throws Exception
- {
- m_oNotifH.sendNotifications(p_oP.toString(), p_o);
- }
-
- public void sendNotifications(Serializable p_o) throws Exception
- {
- m_oNotifH.sendNotifications(null, p_o);
- }
-}
Deleted: labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/services/src/org/jboss/soa/esb/services/NotificationHandlerFactory.java 2006-11-28 17:55:28 UTC (rev 7884)
@@ -1,60 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.soa.esb.services;
-
-import java.util.Arrays;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-import org.jboss.soa.esb.helpers.AppServerContext;
-
-
-public class NotificationHandlerFactory
-{
- private static final String [] s_saTypes = {"local","remote","mock"};
- private final static int LCL=0;
- private final static int REM=1;
- private final static int MOK=2;
-
- public static NotificationManager getNotifHandler
- (String p_sLocRem, String p_sJndiType, String p_sJndiServer) throws Exception
- {
- int iIndex = Arrays.binarySearch(s_saTypes,p_sLocRem.toLowerCase());
- if (iIndex < 0) return null;
- switch (iIndex)
- {
- case LCL: return new NotifHandlerBsDelegateLocal(new InitialContext());
- case REM: return getNotifHandler
- (AppServerContext.getServerContext(p_sJndiType,p_sJndiServer));
- case MOK: return null; //return new MockNotificationHandler();
- }
- throw new Exception("Invalid Notification Handler Delegate <" + p_sLocRem + ">");
- }
-
- private static NotificationManager getNotifHandler(Context p_oCtx) throws Exception
- {
- return new NotifHandlerBsDelegateRemote(p_oCtx);
- }
-}
Deleted: labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/beans/NotificationUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/beans/NotificationUnitTest.java 2006-11-28 17:41:30 UTC (rev 7883)
+++ labs/jbossesb/trunk/product/core/services/tests/src/org/jboss/soa/esb/services/beans/NotificationUnitTest.java 2006-11-28 17:55:28 UTC (rev 7884)
@@ -1,227 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt 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.soa.esb.services.beans;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Hashtable;
-
-import javax.naming.InitialContext;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.Priority;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.common.tests.EJBContainerSetup;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.notification.NotificationList;
-import org.jboss.soa.esb.notification.NotificationTarget;
-import org.jboss.soa.esb.notification.NotifySqlTable;
-
-
-public class NotificationUnitTest extends BaseTest
-{
- private Logger logger = Logger.getLogger(NotificationUnitTest.class);
-
- public void testNotification() {
- try {
- logger.log(Priority.INFO, "Notification Test");
- InitialContext ctx = getInitialContext();
- @SuppressWarnings("unused")
- NotificationHandler local = (NotificationHandler ) ctx.lookup("NotificationHandlerBean/local");
- ConfigTree oEl = new ConfigTree("MyFileList");
- oEl.setAttribute(NotificationList.TYPE,"OK");
-
- // oEl.addElemChild(fileListTarget());
- // oEl.addElemChild(emailTarget());
- // oEl.addElemChild(jmsQueueTarget());
- // oEl.addElemChild(jmsTopicTarget());
- sqlTableTarget(oEl);
-
- NotificationList oNL = new NotificationList(oEl);
-
- // to see how the XML looks like
- // this is just a unit test class
- // Typically the XML is used in a parameter object (ConfigTree.fromXml())
- System.out.println(oNL.toString());
-
- // a simple timestamped message
- Date oNow = new Date(System.currentTimeMillis());
- SimpleDateFormat oStamp = new SimpleDateFormat("dd/MMM/yyyy HH:mm:ss.SSS");
- @SuppressWarnings("unused")
- StringBuilder sb = new StringBuilder(oStamp.format(oNow))
- .append(" This message from Notification test");
-
- //KS local.sendNotifications(oNL.toString(),sb.toString());
-
- } catch (Exception e) {
- fail();
- logger.log(Priority.ERROR, e.getMessage(), e);
- }
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite(NotificationUnitTest.class);
- return new EJBContainerSetup(suite);
- }
-
- public static InitialContext getInitialContext() throws Exception
- {
- Hashtable props = getInitialContextProperties();
- return new InitialContext(props);
- }
-
- private static Hashtable getInitialContextProperties()
- {
- Hashtable<String,String> props = new Hashtable<String,String>();
- props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
- props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
- return props;
- }
-
-// static ConfigTree emailTarget() throws Exception
-// {
-// ConfigTree oTgt = new ConfigTree(NotificationList.CHILD_TGT);
-// oTgt.setAttribute(NotificationTarget.PRM_NOTIF_CLASS,"NotifyEmail");
-// oTgt.setAttribute(Email.FROM,"sender at jboss.com");
-// oTgt.setAttribute(Email.SENDTO,"receiver1 at hotmail.com,receiver2 at jboss.com");;
-// oTgt.setAttribute(Email.SUBJECT,"TEST from Rosetta");
-// oTgt.setAttribute(Email.MESSAGE,"This is the text of your message");
-//
-// // This class does NOT send the e-mails, the app server does
-// // consequently these paths would have to be accessible in the
-// // application server (filesystem / mounts)
-// String[] sa = {"/tmp/tomcat.sh","/tmp/program.js"};
-// for (String sCurr : sa)
-// oTgt.addTextChild(Email.ATTACH,sCurr);
-//
-// return oTgt;
-// } //________________________________
-//
-// static ConfigTree fileListTarget() throws Exception
-// {
-// ConfigTree oTgt = new ConfigTree(NotificationList.CHILD_TGT);
-// oTgt.setAttribute(NotificationTarget.PRM_NOTIF_CLASS,"NotifyFiles");
-//
-// // This class does NOT write the files, the app server does
-// // consequently these paths would have to be accessible in the
-// // application server (filesystem / mounts)
-// String[] sa = {"file:///tmp/file1.notif","file:///tmp/file2.notif"};
-// for (String sCurr : sa)
-// { ConfigTree oFile = new ConfigTree(NotifyFiles.CHILD_FILE);
-// oFile.setAttribute(NotifyFiles.ATT_URI,sCurr);
-// oFile.setAttribute(NotifyFiles.ATT_APPEND,Boolean.toString(true));
-// oTgt.addElemChild(oFile);
-// }
-// return oTgt;
-// } //________________________________
-//
-// static ConfigTree jmsQueueTarget() throws Exception
-// {
-// ConfigTree oTgt = new ConfigTree(NotificationList.CHILD_TGT);
-// oTgt.setAttribute(NotificationTarget.PRM_NOTIF_CLASS,"NotifyQueues");
-//
-// String[] sa = {"queue/A","queue/B"};
-// for (String sCurr : sa)
-// { ConfigTree oQ = new ConfigTree(NotifyQueues.CHILD_QUEUE);
-// oQ.setAttribute(NotifyJMS.ATT_DEST_NAME,sCurr);
-// for (ConfigTree oProp : getMessageProperties())
-// oQ.addElemChild(oProp);
-// oTgt.addElemChild(oQ);
-// }
-// return oTgt;
-// } //________________________________
-//
-// static ConfigTree jmsTopicTarget() throws Exception
-// {
-// ConfigTree oTgt = new ConfigTree(NotificationList.CHILD_TGT);
-// oTgt.setAttribute(NotificationTarget.PRM_NOTIF_CLASS,"NotifyTopics");
-//
-// String[] sa = {"topic/testTopic"};
-// for (String sCurr : sa)
-// { ConfigTree oQ = new ConfigTree(NotifyTopics.CHILD_TOPIC);
-// oQ.setAttribute(NotifyJMS.ATT_DEST_NAME,sCurr);
-// for (ConfigTree oProp : getMessageProperties())
-// oQ.addElemChild(oProp);
-// oTgt.addElemChild(oQ);
-// }
-// return oTgt;
-// } //________________________________
-//
-// static ConfigTree[] getMessageProperties() throws Exception
-// {
-// KeyValuePair[] oaProps = new KeyValuePair[]
-// {new KeyValuePair("prop1","111")
-// ,new KeyValuePair("prop2","bbb")
-// ,new KeyValuePair("prop3","abc123")
-// };
-// ConfigTree[] oaRet = new ConfigTree[oaProps.length];
-// int iCurr = 0;
-// for (KeyValuePair oCurr : oaProps)
-// { ConfigTree oElem = new ConfigTree(NotifyJMS.CHILD_MSG_PROP);
-// oElem.setAttribute(NotifyJMS.ATT_PROP_NAME,oCurr.getKey());
-// oElem.setAttribute(NotifyJMS.ATT_PROP_VALUE,oCurr.getValue());
-// oaRet[iCurr++] = oElem;
-// }
-// return oaRet;
-// } //________________________________
-
- static ConfigTree sqlTableTarget(ConfigTree dad) throws Exception
- {
- ConfigTree oTgt = new ConfigTree(NotificationList.CHILD_TGT,dad);
- oTgt.setAttribute(NotificationTarget.PRM_NOTIF_CLASS,"NotifySqlTable");
-
- oTgt.setAttribute(SimpleDataSource.DRIVER,"org.postgresql.Driver");
- oTgt.setAttribute(SimpleDataSource.URL,"jdbc:postgresql://localhost:5432/jbossesb");
- oTgt.setAttribute(SimpleDataSource.USER,"postgres");
- oTgt.setAttribute(SimpleDataSource.PASSWORD,"postgres");
-
- // Table name for insert - must exist in database (URL)
- oTgt.setAttribute(NotifySqlTable.ATT_TABLE,"test_notif_table");
- // Column that will contain the dynamic data generated by the ActionClass
- // must exist in table (ATT_TABLE above)
- oTgt.setAttribute(NotifySqlTable.ATT_DATA,"msg");
-
- // constant data that can be also added in the insert
- // (perhaps needed for queries)
- // Key = column name (it must exist in the table, same as ATT_DATA column)
- KeyValuePair[] oaCols = new KeyValuePair[]
- {new KeyValuePair("src","TestNotification")
- ,new KeyValuePair("ref","any Ref")
- ,new KeyValuePair("val1","VVVV 11111")
- };
- for (KeyValuePair oCurr : oaCols)
- { ConfigTree oElem = new ConfigTree(NotifySqlTable.CHILD_COLUMN,oTgt);
- oElem.setAttribute(NotifySqlTable.ATT_NAME,oCurr.getKey());
- oElem.setAttribute(NotifySqlTable.ATT_VALUE,oCurr.getValue());
- }
-
- return oTgt;
- }
-
-}
-
-
More information about the jboss-svn-commits
mailing list