[jboss-svn-commits] JBL Code SVN: r12407 - in labs/jbossesb/workspace/dbevenius/product: core/listeners/src/org/jboss/soa/esb/listeners/config and 19 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jun 8 02:36:42 EDT 2007
Author: beve
Date: 2007-06-08 02:36:42 -0400 (Fri, 08 Jun 2007)
New Revision: 12407
Added:
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateConn.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java
labs/jbossesb/workspace/dbevenius/product/lib/ext/hibernate3.jar
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp
Removed:
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp
Modified:
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerUtil.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java
labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
labs/jbossesb/workspace/dbevenius/product/etc/schemas/xml/jbossesb-1.0.1.xsd
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/aggregator/build.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/conf/base-build.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/jbpm_simple1/build.xml
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/simple_cbr/build.xml
Log:
Merge from main 12393:12406
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerTagNames.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -92,6 +92,9 @@
public static final String FILE_POST_SFX_TAG = "postSuffix";
public static final String FILE_POST_DEL_TAG = "postDelete";
+ /** Hibernate related */
+ public static final String HIBERNATE_OBJECT_DATA_TAG = "hibernateObject";
+
/** SQL related */
public static final String SQL_ROW_DATA_TAG = "sqlRowData";
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerUtil.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ListenerUtil.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -332,6 +332,7 @@
}
} // ________________________________
+
/**
* Find an attribute in the tree (arg 0) or assign default value (arg 2)
*
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -29,12 +29,14 @@
import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
import org.jboss.soa.esb.listeners.config.GroovyListenerDocument.GroovyListener;
+import org.jboss.soa.esb.listeners.config.HibernateListenerDocument.HibernateListener;
import org.jboss.soa.esb.listeners.config.JbrListenerDocument.JbrListener;
import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
import org.jboss.soa.esb.listeners.config.mappers.FsListenerMapper;
import org.jboss.soa.esb.listeners.config.mappers.FtpListenerMapper;
import org.jboss.soa.esb.listeners.config.mappers.GroovyListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.HibernateListenerMapper;
import org.jboss.soa.esb.listeners.config.mappers.JbrListenerMapper;
import org.jboss.soa.esb.listeners.config.mappers.JcaGatewayMapper;
import org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapper;
@@ -100,8 +102,8 @@
JmsListenerMapper.map(root, (JmsListener)gateway, model);
} else if (gateway instanceof FsListener){
FsListenerMapper.map(root, (FsListener)gateway, model);
- } else if(gateway instanceof JcaGatewayDocument.JcaGateway) {
- JcaGatewayMapper.map(root, (JcaGatewayDocument.JcaGateway)gateway, model);
+ } else if(gateway instanceof JcaGatewayDocument.JcaGateway) {
+ JcaGatewayMapper.map(root, (JcaGatewayDocument.JcaGateway)gateway, model);
} else if (gateway instanceof FtpListener) {
FtpListenerMapper.map(root, (FtpListener)gateway, model);
} else if (gateway instanceof SqlListener) {
@@ -110,6 +112,8 @@
JbrListenerMapper.map(root, (JbrListener)gateway, model);
} else if (gateway instanceof GroovyListener) {
GroovyListenerMapper.map(root, (GroovyListener)gateway, model);
+ } else if (gateway instanceof HibernateListener) {
+ HibernateListenerMapper.map(root, (HibernateListener)gateway, model);
} else {
UntypedListenerMapper.map(root, gateway, model);
}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java (from rev 12406, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,122 @@
+/*
+ * 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.listeners.config.mappers;
+
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.HibernateBusDocument.HibernateBus;
+import org.jboss.soa.esb.listeners.config.HibernateListenerDocument.HibernateListener;
+import org.jboss.soa.esb.listeners.config.HibernateMessageFilterDocument.HibernateMessageFilter;
+import org.jboss.soa.esb.listeners.config.HibernateProviderDocument.HibernateProvider;
+
+import org.jboss.soa.esb.listeners.gateway.HibernateGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a <fs-listener> XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateListenerMapper {
+
+ /**
+ * Perform the mapping.
+ * @param root The "ConfigTree" configuration root node.
+ * @param listener The Jmslistener to be mapped into the ConfigTree.
+ * @param model The configuration model from which the mapping is being performed.
+ * @return The ConfigTree listener configuration node.
+ * @throws ConfigurationException Invalid listener configuration.
+ */
+ public static Element map(Element root, HibernateListener listener, XMLBeansModel model) throws ConfigurationException {
+ Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+ HibernateBus bus;
+ HibernateProvider provider;
+
+ try {
+ bus = (HibernateBus) model.getBus(listener.getBusidref());
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "]. A <hibernate-listener> must reference a <hibernate-bus>.");
+ }
+ try {
+ provider = (HibernateProvider) model.getProvider(bus);
+ } catch (ClassCastException e) {
+ throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "]. Should be contained within a <hibernate-provider> instance. Unexpected exception - this should have caused a validation error!");
+ }
+
+ List<HibernateMessageFilter> messageFilters = null;
+ messageFilters = listener.getHibernateMessageFilterList();
+
+ if(messageFilters.size() == 0) {
+ messageFilters = bus.getHibernateMessageFilterList();
+ if(messageFilters == null) {
+ throw new ConfigurationException("No <hibernate-message-filter> defined on either <hibernate-listener> [" + listener.getName() + "] or <hibernate-bus> [" + bus.getBusid() + "].");
+ }
+ }
+ listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
+ // Map the standard listener attributes - common across all listener types...
+ MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+ // Map the <property> elements targeted at the listener - from the listener itself.
+ MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+ if(listener.getIsGateway()) {
+ listenerNode.setAttribute("gatewayClass", HibernateGatewayListener.class.getName());
+ // Map EPR related attributes onto the listener - from the bus and provider and listener.
+ // Note: This will change - the Gateways will also support the EPR element...
+ mapHibernateEprProperties(listenerNode, provider, messageFilters);
+ MapperUtil.mapEPRProperties(listener, listenerNode, model);
+ } else {
+ Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+ // Map EPR related attributes onto the EPR - from the bus and provider and listener...
+ mapHibernateEprProperties(eprNode, provider, messageFilters);
+ MapperUtil.mapEPRProperties(listener, eprNode, model);
+ // Remove any empty attributes set on the EPR config...
+ YADOMUtil.removeEmptyAttributes(eprNode);
+ }
+
+ // Remove any empty attributes set on the listener config...
+ YADOMUtil.removeEmptyAttributes(listenerNode);
+
+ return listenerNode;
+ }
+
+ /**
+ * mapHibernateEprProperties creates a ConfigTree with the details we need
+ * from the HibernateProvider and MessageFilters.
+ * @param toElement the element we are passing on
+ * @param provider the provider object
+ * @param messageFilters collection of MessageFilters we need to implement
+ */
+ private static void mapHibernateEprProperties(Element toElement, HibernateProvider provider, List<HibernateMessageFilter> messageFilters) {
+ toElement.setAttribute(HibernateEpr.HIBERNATE_CFG_TAG, provider.getHibernateCfgFile());
+ for (HibernateMessageFilter messageFilter: messageFilters) {
+ Element temp = YADOMUtil.addElement(toElement, "messagefilter");
+ temp.setAttribute(HibernateEpr.CLASS_NAME_TAG, messageFilter.getClassname());
+ temp.setAttribute(HibernateEpr.EVENT_TAG, messageFilter.getEvent());
+ toElement.appendChild(temp);
+ }
+ }
+}
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -125,15 +125,11 @@
+ " started on thread " + Thread.currentThread().getName());
}
- do
- {
- File[] fileList;
- try
- {
+ do {
+ File[] fileList;
+ try {
fileList = getFileList();
- }
- catch (GatewayException e)
- {
+ } catch (GatewayException e) {
_logger.error("Can't retrieve file list", e);
continue;
}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java (from rev 12406, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,29 @@
+package org.jboss.soa.esb.listeners.gateway;
+
+public class HibernateEventBean {
+ private String m_event;
+ private String m_className;
+
+ public HibernateEventBean() {
+ }
+
+ public HibernateEventBean(String f_event, String f_className) {
+ m_event = f_event;
+ m_className = f_className;
+ }
+
+ public String getClassname() {
+ return m_className;
+ }
+
+ public void setClassname(String name) {
+ m_className = name;
+ }
+ public String getEvent() {
+ return m_event;
+ }
+
+ public void setEvent(String m_event) {
+ this.m_event = m_event;
+ }
+}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java (from rev 12406, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,326 @@
+/*
+ * 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.listeners.gateway;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.log4j.Logger;
+import org.hibernate.HibernateException;
+import org.hibernate.event.*;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.persist.HibernateConn;
+
+import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * This class is a Hibernate EventListener which implements hooks to all the available
+ * hibernate events. It's not used at the moment, but might be a way of augmenting
+ * the Hibernate Interceptor hooks which are currently implemented.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateEventListener implements
+ AutoFlushEventListener,
+ DeleteEventListener,
+ DirtyCheckEventListener,
+ EvictEventListener,
+ FlushEntityEventListener,
+ FlushEventListener,
+ InitializeCollectionEventListener,
+ LoadEventListener,
+ LockEventListener,
+ MergeEventListener,
+ PersistEventListener,
+ PostDeleteEventListener,
+ PostInsertEventListener,
+ PostLoadEventListener,
+ PostUpdateEventListener,
+ PreDeleteEventListener,
+ PreInsertEventListener,
+ PreLoadEventListener,
+ PreUpdateEventListener,
+ RefreshEventListener,
+ ReplicateEventListener,
+ SaveOrUpdateEventListener {
+
+ private static final long serialVersionUID = 7125882028251049616L;
+ protected HibernateConn m_conn;
+ protected final static Logger m_logger = Logger.getLogger(HibernateEventListener.class);
+
+ public HibernateEventListener() {
+ super();
+
+ }
+
+ protected Object doPreSend() {
+ try {
+ return queue.take();
+ } catch (InterruptedException e) {
+ m_logger.warn(" interrupted while getting event off queue " , e);
+ return null;
+ }
+ }
+
+ protected BlockingQueue<AbstractEvent> queue = new LinkedBlockingQueue<AbstractEvent>();
+
+ // Hibernate based event methods......
+
+ public void onDelete(DeleteEvent event) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+
+ if(m_logger.isDebugEnabled()) {
+ m_logger.debug(" Receiving delete event: " + event);
+ }
+ try {
+ queue.put(event);
+ } catch (InterruptedException e) {
+ m_logger.info(" Event was interrupted onDelete on adding to queue",e);
+ }
+ }
+
+ public void onSaveOrUpdate(SaveOrUpdateEvent event) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+
+ if(m_logger.isDebugEnabled()) {
+ m_logger.debug(" Receiving save or update event: " + event);
+ }
+ try {
+ queue.put(event);
+ } catch (InterruptedException e) {
+ m_logger.info(" Event was interrupted onSaveOrUpdate on adding to queue",e);
+ }
+ }
+
+ public void onLoad(LoadEvent event, LoadType type) throws HibernateException {
+ // TODO do something with the type : type.getName()
+ System.out.println("HibernateEventLister!");
+
+ if(m_logger.isDebugEnabled()) {
+ m_logger.debug(" Receiving load event: " + event);
+ }
+ try {
+ queue.put(event);
+ } catch (InterruptedException e) {
+ m_logger.info(" Event was interrupted onLoad on adding to queue",e);
+ }
+
+ }
+
+ /// hibernate message composer
+ public static class HibernateMessageComposer extends AbstractMessageComposer {
+
+ @Override
+ protected void populateMessage(Message message, Object obj) throws MessageDeliverException {
+ Object instanceObj = null;
+ String entityName = null;
+ Serializable entityId = null;
+ Object result = null;
+ EventSource source = null;
+ Serializable requestId = null;
+ String type = null;
+
+
+ if(obj instanceof DeleteEvent) {
+ DeleteEvent devent = (DeleteEvent)obj;
+ entityName = devent.getEntityName();
+ instanceObj = devent.getObject();
+ source = devent.getSession();
+ type = "delete";
+ } else if (obj instanceof SaveOrUpdateEvent) {
+ SaveOrUpdateEvent sevent = (SaveOrUpdateEvent) obj;
+ entityName = sevent.getEntityName();
+ instanceObj = sevent.getObject();
+ source = sevent.getSession();
+ entityId = sevent.getResultId();
+ requestId = sevent.getRequestedId();
+ type = "saveOrUpdate";
+ } else if (obj instanceof LoadEvent) {
+ LoadEvent levent = (LoadEvent)obj;
+ instanceObj = levent.getInstanceToLoad();
+ entityName = levent.getEntityClassName();
+ entityId = levent.getEntityId();
+ result = levent.getResult();
+ source = levent.getSession();
+ type = "load";
+ }
+
+
+
+ if(source != null)
+ message.getProperties().setProperty("eventSource",source);
+ if(instanceObj != null)
+ message.getProperties().setProperty("objectInstance",instanceObj);
+ if(entityId != null)
+ message.getProperties().setProperty("entityId",entityId);
+ if(requestId != null)
+ message.getProperties().setProperty("requestId",requestId);
+ if(entityName != null)
+ message.getProperties().setProperty("entityName",entityName);
+ if(type != null)
+ message.getProperties().setProperty("type",type);
+ }
+
+ public void setConfiguration(ConfigTree config) {
+ }
+
+ }
+
+ /**
+ * Obtain a new database connection with parameter info
+ *
+ * @return A new connection
+ * @throws ConfigurationException -
+ * if problems are encountered
+ */
+ protected HibernateConn getHibernateConn()
+ {
+ if (null == m_conn) {
+ }
+ return m_conn;
+ }
+
+ public void onDelete(DeleteEvent arg0, Set arg1) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onDelete");
+ }
+
+ public void onPostInsert (PostInsertEvent event) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPostInsert");
+ }
+
+ public void onDirtyCheck(DirtyCheckEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onDirtyCheck");
+ }
+
+ public void onEvict(EvictEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onEvict");
+ }
+
+ public void onFlushEntity(FlushEntityEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onFlushEntity");
+ }
+
+ public void onFlush(FlushEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onFlush");
+ }
+
+ public void onInitializeCollection(InitializeCollectionEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onEvict");
+ }
+
+ public void onLock(LockEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onLock");
+ }
+
+ public void onMerge(MergeEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onMerge");
+ }
+
+ public void onMerge(MergeEvent arg0, Map arg1) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onMerge");
+ }
+
+ public void onPersist(PersistEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPersist");
+ }
+
+ public void onPersist(PersistEvent arg0, Map arg1) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPersist");
+ }
+
+ public void onPostDelete(PostDeleteEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPostDelete");
+ }
+
+ public void onPostLoad(PostLoadEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPostLoad");
+ }
+
+ public void onPostUpdate(PostUpdateEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPostUpdate");
+ }
+
+ public boolean onPreDelete(PreDeleteEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPreDelete");
+ return false;
+ }
+
+ public boolean onPreInsert(PreInsertEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPreInsert");
+ return false;
+ }
+
+ public void onPreLoad(PreLoadEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPreLoad");
+ }
+
+ public boolean onPreUpdate(PreUpdateEvent arg0) {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onPreUpdate");
+ return false;
+ }
+
+ public void onRefresh(RefreshEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onRefresh");
+ }
+
+ public void onRefresh(RefreshEvent arg0, Map arg1) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onRefresh");
+ }
+
+ public void onReplicate(ReplicateEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onReplicate");
+ }
+
+ public void onAutoFlush(AutoFlushEvent arg0) throws HibernateException {
+ System.out.println("HibernateEventLister!");
+ m_logger.error("onAutoFlush");
+ }
+
+}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java (from rev 12406, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.listeners.gateway;
+
+import java.util.Collection;
+import java.util.ArrayList;
+
+import org.apache.log4j.Logger;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.persist.HibernateSessionFactory;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+/**
+ * HibernateGatewayListener is a listener which creates a HibernateInterceptor for
+ * the classname/events that need to be listened to.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ *
+ */
+public class HibernateGatewayListener extends AbstractManagedLifecycle {
+ private static final long serialVersionUID = -8794895112076882394L;
+
+ private String m_cfgFile;
+ private ConfigTree m_config;
+ protected Object _composer;
+ protected Class _composerClass;
+ protected String _composerName;
+ protected String m_targetServiceCategory, m_targetServiceName;
+
+ protected Collection<EPR> m_targetEprs;
+
+ private static final String MESSAGE_FILTER = "messagefilter";
+
+ protected final static Logger m_logger = Logger.getLogger(HibernateGatewayListener.class);
+
+ /**
+ * This constructor takes in a configTree element and grabs the hibernate configuration
+ * file name.
+ *
+ * @param config configtree
+ * @throws ConfigurationException
+ */
+ public HibernateGatewayListener(ConfigTree config) throws ConfigurationException {
+ super(config);
+ m_config = config;
+ m_cfgFile = ListenerUtil.obtainAtt(m_config, HibernateEpr.HIBERNATE_CFG_TAG, null);
+ }
+
+ @Override
+ protected void doDestroy() throws ManagedLifecycleException {
+ }
+
+ @Override
+ protected void doInitialise() throws ManagedLifecycleException {
+ ArrayList<HibernateEventBean> eventList = new ArrayList<HibernateEventBean>();
+
+ Configuration cfg = new Configuration();
+ cfg.configure(m_cfgFile);
+
+ // Need to loop through messagefilters and add them as interceptors
+ for (ConfigTree ct : m_config.getChildren(MESSAGE_FILTER)) {
+ try {
+ String tempEvent = ListenerUtil.obtainAtt(ct, HibernateEpr.EVENT_TAG, null);
+ String[] events = tempEvent.split(",");
+ for (int i = 0; i<events.length; i++) {
+ HibernateEventBean heb = new HibernateEventBean();
+ heb.setEvent(events[i]);
+ heb.setClassname(ListenerUtil.obtainAtt(ct, HibernateEpr.CLASS_NAME_TAG, null));
+ eventList.add(heb);
+ }
+ } catch (ConfigurationException ce) {
+ m_logger.error("Problem parsing Message Filter event/classname");
+ }
+ }
+
+ try {
+ // Grab the session factory and close it - if we have a hot re-deploy,
+ // we need to close the SessionFactory so that the old interceptors don't get
+ // in the way.
+ SessionFactory sf = null;
+ try {
+ sf = HibernateSessionFactory.getInstance(cfg);
+ sf.close();
+ } catch (Exception e) {
+ // Ignore.
+ }
+
+ sf = HibernateSessionFactory.getInstance(cfg);
+ if (eventList.size() != 0) {
+ cfg.setInterceptor(new HibernateInterceptor(m_config, eventList));
+ }
+ } catch (ConfigurationException ce) {
+ throw new ManagedLifecycleException(ce.getMessage());
+ }
+
+
+
+
+ }
+
+ @Override
+ protected void doStart() throws ManagedLifecycleException {
+ }
+
+ @Override
+ protected void doStop() throws ManagedLifecycleException {
+ }
+}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java (from rev 12406, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,343 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.listeners.gateway;
+
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.log4j.Logger;
+import org.hibernate.CallbackException;
+import org.hibernate.EmptyInterceptor;
+import org.hibernate.Transaction;
+import org.hibernate.type.Type;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.listeners.gateway.HibernateEventListener.HibernateMessageComposer;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * HibernateInterceptor intercepts Hibernate events and sends the object they are
+ * being performed upon in a message. The object is sent in the body of the message
+ * with the "hibernateObject" string. The default composer for the HibernateInterceptor
+ * is PackageHibernateMessageContents.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ *
+ */
+public class HibernateInterceptor extends EmptyInterceptor {
+
+ private static final long serialVersionUID = 1L;
+ private ArrayList<HibernateEventBean> m_events;
+ private final static Logger m_logger = Logger.getLogger(HibernateInterceptor.class);
+ private Courier m_courier;
+
+ protected Class m_composerClass;
+ protected Method m_processMethod;
+ protected Object m_composer;
+ protected String m_composerName;
+ protected ConfigTree m_config;
+
+ protected Collection<EPR> m_targetEprs;
+ protected String m_targetServiceCategory, m_targetServiceName;
+
+ // Event Strings
+ private static final String DELETE_EVENT = "onDelete";
+ private static final String SAVE_EVENT = "onSave";
+ private static final String LOAD_EVENT = "onLoad";
+ private static final String FLUSH_DIRTY_EVENT = "onFlushDirty";
+ private static final String COLLECTION_UPDATE_EVENT = "onCollectionUpdate";
+ private static final String COLLECTION_REMOVE_EVENT = "onCollectionRemove";
+
+
+ /**
+ * This constructor takes in a configuration and a list of hibernate events to
+ * monitor.
+ * @param f_config
+ * @param f_list
+ * @throws ManagedLifecycleException
+ */
+ public HibernateInterceptor(ConfigTree f_config, ArrayList<HibernateEventBean> f_list) throws ManagedLifecycleException {
+ m_config = f_config;
+ m_events = f_list;
+ m_composerName = HibernateMessageComposer.class.getName();
+ m_composerClass = HibernateMessageComposer.class;
+ m_composer = new HibernateMessageComposer();
+
+ try {
+ m_targetServiceCategory = ListenerUtil.obtainAtt(m_config,
+ ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+ m_targetServiceName = ListenerUtil.obtainAtt(m_config,
+ ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+ m_targetEprs = RegistryUtil.getEprs(m_targetServiceCategory,m_targetServiceName);
+ if (null == m_targetEprs || m_targetEprs.size() < 1)
+ throw new ManagedLifecycleException("EPR <" + m_targetServiceName + "> not found in registry") ;
+ } catch (final RegistryException re) {
+ throw new ManagedLifecycleException("Unexpected registry exception", re) ;
+ } catch (ConfigurationException e) {
+ throw new ManagedLifecycleException(e.getMessage(), e);
+ }
+
+ try {
+ resolveComposerClass();
+ } catch (ConfigurationException e) {
+ // TODO Auto-generated catch block
+ throw new ManagedLifecycleException("Problem resolving composer class", e);
+ }
+
+ }
+
+ /**
+ * Create message and put messageObject in the body.
+ * @param messageObject hibernate object that goes in the body of the message
+ * @return the message just created
+ */
+ private Message createMessage(Object messageObject) {
+ Object obj = null;
+ try {
+ obj = m_processMethod.invoke(m_composer, new Object[] { messageObject });
+ if (null == obj) {
+ m_logger.error("Action class method <" + m_processMethod
+ .getName() + "> returned a null object");
+ }
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ Message message = (Message) obj;
+ return message;
+ }
+
+ /**
+ * Delivers the message.
+ * @param messageObject
+ */
+ private void deliverMessage(Message message) {
+ Throwable thrown = null;
+ String text = null;
+
+ try {
+ boolean bSent = false;
+ for (EPR current : m_targetEprs) {
+ m_courier = CourierFactory.getCourier(current);
+
+ try {
+ if (m_courier.deliver(message)) {
+ bSent = true;
+ break;
+ }
+ } finally {
+ CourierUtil.cleanCourier(m_courier) ;
+ }
+ }
+
+ if (!bSent) {
+ text = "Target service <" + m_targetServiceCategory + "," + m_targetServiceName + "> is not registered";
+ thrown = new Exception(text);
+ }
+ } catch (ClassCastException e) {
+ thrown = e;
+ text = "Action class method <" + m_processMethod.getName() + "> returned a non Message object";
+ } catch (CourierException e) {
+ thrown = e;
+ text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED";
+ } catch (MalformedEPRException ex) {
+ thrown = ex;
+ text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with malformed EPR.";
+ } catch (IllegalArgumentException e) {
+ thrown = e;
+ text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with IllegalArgumentException.";
+ }
+ if (null != thrown) {
+ m_logger.error(text);
+ m_logger.debug(text, thrown);
+ //changeStatusToError();
+ }
+ }
+
+
+ /**
+ * This method resolves the composer class. As a default, the HibernateInterceptor
+ * uses
+ * @throws ConfigurationException
+ */
+ protected void resolveComposerClass() throws ConfigurationException {
+ try
+ {
+ String sProcessMethod = null;
+ m_composerName = m_config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
+ if (null != m_composerName) {
+ m_composerClass = ClassUtil.forName(m_composerName, getClass());
+ Constructor oConst = m_composerClass.getConstructor(new Class[] { ConfigTree.class });
+ m_composer = oConst.newInstance(m_config);
+ sProcessMethod = m_config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
+ } else {
+ m_composerName = PackageHibernateMessageContents.class.getName();
+ m_composerClass = PackageHibernateMessageContents.class;
+ m_composer = new PackageHibernateMessageContents();
+ sProcessMethod = "process";
+ m_logger.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " - Using default composer class : " + m_composerName);
+ }
+
+ m_processMethod = m_composerClass.getMethod(sProcessMethod, new Class[] { Object.class });
+ } catch (InvocationTargetException ex) {
+ m_logger.debug(ex);
+ throw new ConfigurationException(ex);
+ } catch (IllegalAccessException ex) {
+ m_logger.debug(ex);
+ throw new ConfigurationException(ex);
+ } catch (InstantiationException ex) {
+ m_logger.debug(ex);
+ throw new ConfigurationException(ex);
+ } catch (ClassNotFoundException ex) {
+ m_logger.debug(ex);
+ throw new ConfigurationException(ex);
+ } catch (NoSuchMethodException ex) {
+ m_logger.debug(ex);
+ throw new ConfigurationException(ex);
+ }
+ }
+
+ public void afterTransactionBegin(Transaction arg0) {
+ m_logger.debug("afterTransactionBegin");
+ }
+
+ public void afterTransactionCompletion(Transaction arg0) {
+ m_logger.debug("afterTransactionCompletion");
+ }
+
+ public void beforeTransactionCompletion(Transaction arg0) {
+ m_logger.debug("beforeTransactionCompletion");
+ }
+
+ public void onCollectionRecreate(Object entity, Serializable id) throws CallbackException {
+ m_logger.debug("onCollectionRecreate");
+ }
+
+ public void onCollectionRemove(Object entity, Serializable id) throws CallbackException {
+ System.out.println("onCollectionRemove");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(COLLECTION_REMOVE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ deliverMessage(message);
+ }
+ }
+ }
+ }
+
+ public void onCollectionUpdate(Object entity, Serializable id) throws CallbackException {
+ System.out.println("onCollectionUpdate");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(COLLECTION_UPDATE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ deliverMessage(message);
+ }
+ }
+ }
+ }
+
+ public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
+ System.out.println("onDelete");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(DELETE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ deliverMessage(message);
+ }
+ }
+ }
+ }
+
+ public boolean onFlushDirty(Object entity, Serializable id, Object[] newValues, Object[] oldValues, String[] propertyNames, Type[] types) throws CallbackException {
+ m_logger.debug("onFlushDirty");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(FLUSH_DIRTY_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ deliverMessage(message);
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
+ System.out.println("onLoad");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(LOAD_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ deliverMessage(message);
+ }
+ }
+ }
+ return false;
+ }
+
+ public boolean onSave(Object entity, Serializable id, Object[] state,
+ String[] propertyNames, Type[] types) throws CallbackException {
+ System.out.println("onSave");
+ for (HibernateEventBean heb: m_events) {
+ if (heb.getEvent().equals(SAVE_EVENT)) {
+ if (entity.getClass().getName().equals(heb.getClassname())) {
+ Message message = createMessage(entity);
+ deliverMessage(message);
+ }
+ }
+ }
+ return false;
+ }
+
+ public void postFlush(Iterator arg0) throws CallbackException {
+ m_logger.debug("postFlush");
+ }
+
+ public void preFlush(Iterator arg0) throws CallbackException {
+ m_logger.debug("preFlush");
+ }
+}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java (from rev 12406, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,50 @@
+/*
+* 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.listeners.gateway;
+
+import java.io.Serializable;
+
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+* Default packaging for Hibernate Entity messages. <p/>It will just drop the
+* Hibernate entity into a message.
+*
+* @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+* @since Version 4.2
+*
+*/
+public class PackageHibernateMessageContents {
+ public Message process (Object obj) {
+ if (!(obj instanceof Serializable))
+ throw new IllegalArgumentException("Object must be serializable");
+
+ Message message = MessageFactory.getInstance().getMessage();
+
+ message.getBody().add(ListenerTagNames.HIBERNATE_OBJECT_DATA_TAG, obj);
+
+ return message;
+ }
+
+}
\ No newline at end of file
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -22,6 +22,7 @@
package org.jboss.soa.esb.listeners.gateway;
+import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -590,7 +591,7 @@
}
/*
- * HSQL does not support FOR UPDATE! All tables appear to
+ * HS QL does not support FOR UPDATE! All tables appear to
* be inherently updatable!
*/
@@ -765,7 +766,7 @@
{
public Message process (Object obj)
{
- if (!(obj instanceof Map))
+ if (!(obj instanceof Serializable))
throw new IllegalArgumentException("Object must be instance of Map");
Message message = MessageFactory.getInstance().getMessage();
Copied: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java (from rev 12406, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,408 @@
+/*
+ * 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.internal.soa.esb.couriers;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.helpers.persist.HibernateConn;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Courier which delivers message.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ *
+ */
+public class HibernateCourier implements PickUpOnlyCourier, DeliverOnlyCourier {
+
+ protected HibernateConn m_conn = null;
+ protected HibernateEpr m_epr = null;
+ protected static Logger m_Logger = Logger.getLogger(HibernateCourier.class);
+
+ protected Query m_prepDelete = null;
+ protected Query m_prepInsert = null;
+ protected Query m_prepUpdate = null;
+ protected Query m_prepSelUpd = null;
+ protected Query m_prepGetList = null;
+
+ private boolean m_isReceiver = false;
+ protected long m_pollLatency = 200;
+
+
+ private HibernateCourier() {
+ }
+
+ /**
+ * package protected constructor - Objects of Courier should only be
+ * instantiated by the Factory
+ *
+ * @param epr
+ */
+ HibernateCourier(HibernateEpr epr) throws CourierException {
+ this(epr, false);
+ }
+
+ public HibernateCourier(HibernateEpr epr, boolean pickUpOnly) {
+ m_isReceiver = pickUpOnly;
+ m_epr = epr;
+ }
+
+ public void cleanup() {
+ if (null != m_conn) {
+ try {
+ m_conn.release();
+ } catch (Exception e) {
+ m_Logger.error("Unable to release connection", e);
+ }
+ }
+ }
+
+ /**
+ * package the ESB message in a java.io.Serializable, and write it
+ *
+ * @param message
+ * Message - the message to deliverAsync
+ * @return boolean - the result of the delivery
+ * @throws CourierException -
+ * if problems were encountered
+ */
+ public boolean deliver(Message message) throws CourierException {
+ if (m_isReceiver)
+ throw new CourierException("This is a read-only Courier");
+
+ if (null == message)
+ return false;
+
+ String msgId = null;
+ Call call = message.getHeader().getCall();
+ if (null==call)
+ message.getHeader().setCall(call=new Call());
+ try {
+ if (null == call.getMessageID())
+ call.setMessageID(new URI(UUID.randomUUID().toString()));
+ msgId = call.getMessageID().toString();
+ } catch (URISyntaxException e) {
+ throw new CourierException("Problems with message header ",e);
+ }
+ /*
+ if (null == m_conn) {
+ try {
+ m_conn = getConn();
+ } catch (Exception e) {
+ throw new CourierException(e);
+ }
+ }
+
+
+ while (m_conn != null) {
+ try {
+ //TODO: Need to get the inserts working
+ int iCol = 1;
+ Query ins = insertStatement();
+ return true;
+ } catch (HibernateException e) {
+ if (null != m_conn) {
+ try {
+ m_conn.rollback();
+ } catch (Exception roll) {
+ m_Logger.error("", roll);
+ }
+ }
+
+ m_Logger.error("Hibernate exception during deliver", e);
+ throw new CourierException(e);
+ } catch (Exception e) {
+ m_Logger.error("", e);
+ }
+ }
+ */
+ return false;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier#pickup(long)
+ */
+
+ public Message pickup(long millis) throws CourierException,
+ CourierTimeoutException {
+ Message result = null;
+ /*
+ long limit = System.currentTimeMillis()
+ + ((millis < 100) ? 100 : millis);
+ do {
+ try {
+ List<String> list = getRowList();
+
+ if (null != list) {
+ for (String messageId : list) {
+ if (null == (result = tryToPickup(messageId)))
+ continue;
+ return result;
+ }
+ }
+ } catch (Exception e) {
+ m_Logger.error("Exception during pickup", e);
+ return null;
+ } finally {
+ if (m_conn != null) {
+ try {
+ m_conn.rollback();
+ } catch (HibernateException e) {} //ignore
+ }
+ }
+
+ try {
+ long lSleep = limit - System.currentTimeMillis();
+ if (m_pollLatency < lSleep)
+ lSleep = m_pollLatency;
+ if (lSleep > 0)
+ Thread.sleep(lSleep);
+ } catch (InterruptedException e) {
+ return null;
+ }
+ } while (System.currentTimeMillis() <= limit);
+ */
+ return null;
+ }
+
+
+ /*
+ private List getRowList() throws CourierException
+ {
+ if (null == m_conn)
+ {
+ try {
+ m_conn = getConn();
+ } catch (Exception e) {
+ throw new CourierException(e);
+ }
+ }
+ while (m_conn != null)
+ {
+ try {
+ Query query = listStatement();
+ return m_conn.execQuery(query);
+ } catch (Exception e) {
+ m_Logger.error("Problem getting row list", e);
+ }
+ }
+ return null;
+ }
+ */
+
+ /*
+ protected Query listStatement()
+ {
+ if (null == m_prepGetList)
+ try {
+ String sb = "select x." + m_epr.getMessageField() + ", "
+ + "x." + m_epr.getTimestampColumn() + " "
+ + "from " + m_epr.getClassName() + " x "
+ + "where x." + m_epr.getStatusField() + " = " + State.Pending.getColumnValue();
+ m_prepGetList = getConn().getSession().createQuery(sb);
+ } catch (Exception e) {
+ m_Logger.debug("Unable to prepare list query", e);
+ return null;
+ }
+ return m_prepGetList;
+ }
+ */
+
+ /*
+ private Query insertStatement() {
+ if (null == m_prepInsert)
+ try
+ {
+ String[] columns =
+ {m_epr.getMessageField(), m_epr.getDataField(),
+ m_epr.getStatusField(), m_epr.getTimestampColumn() };
+
+ StringBuilder sb = new StringBuilder("insert into ").append(
+ m_epr.getClassName()).append("(");
+ int i1 = 0;
+ for (String col : columns)
+ sb.append((i1++ < 1) ? " " : ",").append(col);
+ sb.append(") values (?,?,?,?)");
+ m_prepInsert = getConn().getSession().createQuery(sb.toString());
+ } catch (Exception e) {
+ m_Logger.debug("Problem creating insertion query: ", e);
+ return null;
+ }
+ return m_prepInsert;
+ }
+ */
+
+ /*
+ private Message tryToPickup(String messageId) {
+ int iParm = 1;
+
+ Query updateQuery = selectUpdateStatement();
+ updateQuery.setString("messageid", messageId);
+ updateQuery.setString("statusid", State.Pending.getColumnValue());
+
+ while (m_conn != null) {
+ try {
+ List<String>list = m_conn.execQuery(updateQuery);
+ for (String data : list) {
+ Exception courEx = null;
+ try {
+ Message result = Util.deserialize((Serializable) data);
+ deleteMsg(messageId);
+ changeStatus(messageId, State.Done);
+ return result;
+ } catch (ClassCastException e) {
+ m_Logger.debug("", e);
+ courEx = e;
+ } catch (SAXParseException e) {
+ m_Logger.debug("", e);
+ courEx = e;
+ } catch (Exception e) {
+ throw new CourierException(e);
+ }
+ if (null != courEx) {
+ deleteMsg(messageId);
+ changeStatus(messageId, State.Error);
+ continue;
+ }
+ }
+ return null;
+ } catch (Exception e) {
+ m_Logger.error("", e);
+ }
+ }
+ return null;
+ }
+ */
+
+ /*
+ protected Query selectUpdateStatement() {
+ if (m_prepSelUpd == null) {
+ try {
+ String sb = "select x." + m_epr.getDataField() + " "
+ + "from " + m_epr.getClassName() + " x "
+ + "where x." + m_epr.getMessageField() + " = :messageid "
+ + "and x." + m_epr.getStatusField() + "= :statusid";
+ Query query = getConn().getSession().createQuery(sb);
+ } catch (Exception e) {
+ m_Logger.error("Problem creating select statement", e);
+ return null;
+ }
+ }
+
+ return m_prepSelUpd;
+ }
+ */
+
+ /*
+ private void deleteMsg(String messageId) {
+ Query delQuery = deleteStatement();
+ delQuery.setString("messageid", messageId);
+ m_conn.execQuery(delQuery);
+ m_conn.commit();
+
+ }
+
+ private void changeStatus(String messageId, State to) {
+ Query statusQuery = updateStatement();
+ statusQuery.setString("statusid", messageId);
+ statusQuery.setString("messageid", to.getColumnValue());
+ m_conn.execQuery(statusQuery);
+ m_conn.commit();
+ }
+
+ private Query deleteStatement() {
+ if (null == m_prepDelete) {
+ try
+ {
+ String delStatement = new String("delete " + m_epr.getClassName()
+ + " x where x." + m_epr.getMessageField()
+ + " = :messageid");
+ m_prepDelete = getConn().getSession().createQuery(delStatement);
+ } catch (Exception e) {
+ m_Logger.error("Problem creating deletion query: ", e);
+ return null;
+ }
+ }
+ return m_prepDelete;
+ }
+
+ private Query updateStatement() {
+ if (null == m_prepUpdate) {
+ try {
+ String upStatement = new String("update " + m_epr.getClassName() + " x "
+ + "set " + m_epr.getStatusField() + " = :statusid"
+ + "where x." + m_epr.getStatusField()
+ + " = :messageid");
+ m_prepUpdate = getConn().getSession().createQuery(upStatement);
+ } catch (Exception e) {
+ m_Logger.error("Problem creating update query: ", e);
+ return null;
+ }
+ }
+ return m_prepUpdate;
+ }
+
+ private HibernateConn getConn() throws MalformedEPRException
+ {
+ if (null == m_conn) {
+ try {
+ m_conn = new HibernateConn(m_epr.getHibernateCfgFile());
+ } catch (URISyntaxException ex) {
+ throw new MalformedEPRException(ex);
+ }
+ }
+ return m_conn;
+ }
+
+ public void setPollLatency(Long millis)
+ {
+ if (millis <= 200)
+ m_Logger.error("Poll latency must be >= 200 milliseconds - Keeping old value of "+ m_pollLatency);
+ else
+ m_pollLatency = millis;
+ } // ________________________________
+
+
+ protected enum State {
+ Pending, WorkInProgress, Done, Error;
+ String getColumnValue() {
+ return toString().substring(0, 1);
+ }
+ }
+ */
+}
Modified: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -30,6 +30,7 @@
import org.jboss.soa.esb.addressing.EPR;
import org.jboss.soa.esb.addressing.eprs.FTPEpr;
import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
import org.jboss.soa.esb.common.Environment;
@@ -54,76 +55,81 @@
{
public Message onOutput (Message msg) throws CourierException
{
- final Environment.Transports type ;
- final String name ;
+ final Environment.Transports type ;
+ final String name ;
EPR destination = msg.getHeader().getCall().getTo();
- if (destination != null)
- {
- if (destination instanceof FTPEpr)
+ if (destination != null)
+ {
+ if (destination instanceof FTPEpr)
+ {
+ try
{
- try
- {
- type = Environment.Transports.FTP;
+ type = Environment.Transports.FTP;
- String dir = ModulePropertyManager.getPropertyManager(
- ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+ String dir = ModulePropertyManager.getPropertyManager(
+ ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
Environment.FTP_LOCALDIR, System.getProperty("java.io.tmpdir"));
- name = dir + File.separator + msg.getHeader().getCall().getMessageID().toString() +
- ((FTPEpr) destination).getPostDirectory();
- }
- catch (URISyntaxException ex)
- {
- throw new CourierException(ex);
- }
+ name = dir + File.separator + msg.getHeader().getCall().getMessageID().toString() +
+ ((FTPEpr) destination).getPostDirectory();
}
- else if (destination instanceof FileEpr)
+ catch (URISyntaxException ex)
{
- try
- {
- type = Environment.Transports.File;
+ throw new CourierException(ex);
+ }
+ }
+ else if (destination instanceof FileEpr)
+ {
+ try
+ {
+ type = Environment.Transports.File;
- name = ((FileEpr) destination).getURL() + File.separator +
- msg.getHeader().getCall().getMessageID().toString() + ((FileEpr) destination).getPostSuffix();
- }
- catch (MalformedURLException ex)
- {
- throw new CourierException(ex);
- }
- catch (URISyntaxException ex)
- {
- throw new CourierException(ex);
- }
- }
- else if (destination instanceof JMSEpr)
+ name = ((FileEpr) destination).getURL() + File.separator +
+ msg.getHeader().getCall().getMessageID().toString() + ((FileEpr) destination).getPostSuffix();
+ }
+ catch (MalformedURLException ex)
{
- type = Environment.Transports.JMS;
-
- name = destination.getAddr().toString();
+ throw new CourierException(ex);
}
- else if (destination instanceof JDBCEpr)
+ catch (URISyntaxException ex)
{
- type = Environment.Transports.SQL;
+ throw new CourierException(ex);
+ }
+ }
+ else if (destination instanceof JMSEpr)
+ {
+ type = Environment.Transports.JMS;
+
+ name = destination.getAddr().toString();
+ }
+ else if (destination instanceof JDBCEpr)
+ {
+ type = Environment.Transports.SQL;
- name = destination.getAddr().toString();
- }
- else
- {
- type = null ;
- name = null ;
- }
- }
- else
- {
- type = null ;
- name = null ;
- }
+ name = destination.getAddr().toString();
+ }
+ else if (destination instanceof HibernateEpr)
+ {
+ type = Environment.Transports.Hibernate;
+ name = destination.getAddr().toString();
+ }
+ else
+ {
+ type = null ;
+ name = null ;
+ }
+ }
+ else
+ {
+ type = null ;
+ name = null ;
+ }
- final Properties props = msg.getProperties() ;
- setProperty(props, Environment.TRANSPORT_TYPE, type) ;
- setProperty(props, Environment.MESSAGE_SOURCE, name);
- props.setProperty(Environment.MESSAGE_ENTRY_TIME, Calendar.getInstance().getTime().toString());
- return msg;
+ final Properties props = msg.getProperties() ;
+ setProperty(props, Environment.TRANSPORT_TYPE, type) ;
+ setProperty(props, Environment.MESSAGE_SOURCE, name);
+ props.setProperty(Environment.MESSAGE_ENTRY_TIME, Calendar.getInstance().getTime().toString());
+ return msg;
}
public Message onInput (Message msg) throws CourierException
@@ -133,15 +139,15 @@
return msg;
}
- private void setProperty(final Properties props, final String name, final Object value)
- {
- if (value == null)
- {
- props.remove(name) ;
- }
- else
- {
- props.setProperty(name, value) ;
- }
- }
+ private void setProperty(final Properties props, final String name, final Object value)
+ {
+ if (value == null)
+ {
+ props.remove(name) ;
+ }
+ else
+ {
+ props.setProperty(name, value) ;
+ }
+ }
}
Copied: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java (from rev 12406, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,39 @@
+/*
+ * 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.addressing.eprs;
+
+import java.net.URISyntaxException;
+
+public class DefaultHibernateReplyToEpr extends HibernateEpr
+{
+
+ public DefaultHibernateReplyToEpr(HibernateEpr epr) throws URISyntaxException
+ {
+ super(epr);
+ setClassName(replyToClassName(epr));
+ }
+
+ public static String replyToClassName(HibernateEpr epr) throws URISyntaxException
+ {
+ return epr.getClassName()+HibernateEpr.DEFAULT_REPLY_TO_CLASS_SUFFIX;
+ }
+}
\ No newline at end of file
Copied: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java (from rev 12406, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,361 @@
+/*
+ * 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.addressing.eprs;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+public class HibernateEpr extends EPR {
+
+ public static final String LOAD_LISTENER = "loadListener";
+ public static final String SAVE_LISTENER = "saveListener";
+ public static final String DELETE_LISTENER = "deleteListener";
+
+ public static final String CLASS_NAME_TAG = "classname";
+ public static final String EVENT_TAG = "event";
+ public static final String HIBERNATE_CFG_TAG = "hibernate-cfg-file";
+
+
+
+ public static final String MESSAGE_FIELD_TAG = "message-field";
+ public static final String STATUS_FIELD_TAG = "status-field";
+ public static final String DATA_FIELD_TAG = "data-field";
+ public static final String TIMESTAMP_FIELD_TAG = "insert-timestamp-field";
+ public static final String POST_DEL_TAG = "postDelete";
+ public static final String ERROR_DEL_TAG = "errorDelete";
+
+
+ public static final String DEFAULT_REPLY_TO_CLASS_SUFFIX = "_reply_table";
+
+ private boolean loadListener = true;
+ private boolean saveListener = true;
+ private boolean deleteListener = true;
+ private boolean cfgFileSet = false;
+ private boolean classNameSet = false;
+ private boolean statusSet = false;
+ private boolean messageSet = false;
+ private boolean timestampSet = false;
+ private boolean dataSet = false;
+
+ private static URI m_type;
+
+
+ public HibernateEpr(EPR epr) {
+ copy(epr);
+ }
+
+ public HibernateEpr (EPR epr, Element header)
+ {
+ copy(epr);
+
+ NodeList nl = header.getChildNodes();
+ for (int i = 0; i < nl.getLength(); i++)
+ {
+ try
+ {
+ String prefix = nl.item(i).getPrefix();
+ String tag = nl.item(i).getLocalName();
+
+ if (tag != null)
+ {
+ if (tag.equals(HIBERNATE_CFG_TAG)) {
+ getAddr().addExtension(HIBERNATE_CFG_TAG, nl.item(i).getTextContent());
+ } else if (tag.equals(CLASS_NAME_TAG)) {
+ getAddr().addExtension(CLASS_NAME_TAG, nl.item(i).getTextContent());
+ } else if (tag.equals(EVENT_TAG)) {
+ getAddr().addExtension(EVENT_TAG, nl.item(i).getTextContent());
+ }
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public PortReference getAddr() {
+ // TODO Auto-generated method stub
+ return super.getAddr();
+ }
+
+ @Override
+ public void setAddr(PortReference uri) {
+ // TODO Auto-generated method stub
+ super.setAddr(uri);
+ }
+
+ /**
+ * @return the driver used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getHibernateCfgFile () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(HIBERNATE_CFG_TAG);
+ }
+
+ /**
+ * Set the tablename that is used by this EPR.
+ *
+ * @param tableName the table name.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setHibernateCfgFile(String cfgFile) throws URISyntaxException
+ {
+ if (cfgFile == null)
+ throw new IllegalArgumentException();
+
+ if (cfgFileSet)
+ throw new IllegalStateException("Table name already set.");
+
+ getAddr().addExtension(HIBERNATE_CFG_TAG, cfgFile);
+ cfgFileSet = true;
+ }
+
+ /**
+ * Set the tablename that is used by this EPR.
+ *
+ * @param tableName the table name.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setClassName (String className) throws URISyntaxException
+ {
+ if (className == null)
+ throw new IllegalArgumentException();
+
+ if (classNameSet)
+ throw new IllegalStateException("Table name already set.");
+
+ getAddr().addExtension(CLASS_NAME_TAG, className);
+ classNameSet = true;
+ }
+
+ /**
+ * @return the table name used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getClassName () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(CLASS_NAME_TAG);
+ }
+
+
+
+
+ /**
+ * Set the event that is used by this EPR.
+ *
+ * @param tableName the table name.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setEvent (String eventName) throws URISyntaxException
+ {
+ if (eventName == null)
+ throw new IllegalArgumentException();
+
+ if (classNameSet)
+ throw new IllegalStateException("Table name already set.");
+
+ getAddr().addExtension(EVENT_TAG, eventName);
+ classNameSet = true;
+ }
+
+ /**
+ * @return the table name used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getEvent () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(EVENT_TAG);
+ }
+
+ /**
+ * Set the status column that is used by this EPR.
+ *
+ * @param statusField the status field.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setStatusField (String statusField) throws URISyntaxException
+ {
+ if (statusField == null)
+ throw new IllegalArgumentException();
+
+ if (statusSet)
+ throw new IllegalStateException("Status column already set.");
+
+ getAddr().addExtension(STATUS_FIELD_TAG, statusField);
+ statusSet = true;
+ }
+
+ /**
+ * @return the status column name used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getStatusField () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(STATUS_FIELD_TAG);
+ }
+
+ /**
+ * Set the message id column name that is used by this EPR.
+ *
+ * @param messageFieldName the column name for the message ID.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setMessageField (String messageFieldName) throws URISyntaxException
+ {
+ if (messageFieldName == null)
+ throw new IllegalArgumentException();
+
+ if (messageSet)
+ throw new IllegalStateException("Message Id column already set.");
+
+ getAddr().addExtension(MESSAGE_FIELD_TAG, messageFieldName);
+ messageSet = true;
+ }
+
+ /**
+ * @return the message id column used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getMessageField () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(MESSAGE_FIELD_TAG);
+ }
+
+
+ /**
+ * Set the column that is used by this EPR to store timestamp when the message was inserted.
+ *
+ * @param timeField the column name.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setTimestampField (String timeField) throws URISyntaxException
+ {
+ if (timeField == null)
+ throw new IllegalArgumentException();
+
+ if (timestampSet)
+ throw new IllegalStateException("Timestamp column already set.");
+
+ getAddr().addExtension(TIMESTAMP_FIELD_TAG, timeField);
+ timestampSet = true;
+ }
+
+ /**
+ * @return the timestamp column name used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getTimestampColumn () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(TIMESTAMP_FIELD_TAG);
+ }
+
+ /**
+ * Set the field that is used by this EPR to store message data.
+ *
+ * @param dataField the column name.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final void setDataField (String dataField) throws URISyntaxException
+ {
+ if (dataField == null)
+ throw new IllegalArgumentException();
+
+ if (dataSet)
+ throw new IllegalStateException("Data field already set.");
+
+ getAddr().addExtension(DATA_FIELD_TAG, dataField);
+ dataSet = true;
+ }
+
+ /**
+ * @return the data column name used by this EPR.
+ * @throws URISyntaxException thrown if this EPR is malformed.
+ */
+
+ public final String getDataField () throws URISyntaxException
+ {
+ return getAddr().getExtensionValue(DATA_FIELD_TAG);
+ }
+
+
+ public boolean isDeleteListener() {
+ return deleteListener;
+ }
+
+ public void setDeleteListener(boolean deleteListener) {
+ this.deleteListener = deleteListener;
+ }
+
+ public boolean isLoadListener() {
+ return loadListener;
+ }
+
+ public void setLoadListener(boolean loadListener) {
+ this.loadListener = loadListener;
+ }
+
+ public boolean isSaveListener() {
+ return saveListener;
+ }
+
+ public void setSaveListener(boolean saveListener) {
+ this.saveListener = saveListener;
+ }
+
+ public static final URI type ()
+ {
+ return m_type;
+ }
+
+ static
+ {
+ try
+ {
+ m_type = new URI("urn:jboss/esb/epr/type/hibernate");
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+
+ throw new ExceptionInInitializerError(ex.toString());
+ }
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/common/Environment.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -26,7 +26,7 @@
{
public enum Transports
{
- File, FTP, JMS, SQL;
+ File, FTP, JMS, SQL, Hibernate;
}
public static final String PROPERTIES_FILE = "org.jboss.soa.esb.propertyFile";
@@ -142,4 +142,4 @@
*/
public static final String FILTER_NAME = "org.jboss.soa.esb.courier.filter";
-}
\ No newline at end of file
+}
Modified: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -46,11 +46,13 @@
import org.jboss.soa.esb.addressing.MalformedEPRException;
import org.jboss.soa.esb.addressing.eprs.DefaultFileReplyToEpr;
import org.jboss.soa.esb.addressing.eprs.DefaultFtpReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.DefaultHibernateReplyToEpr;
import org.jboss.soa.esb.addressing.eprs.DefaultJdbcReplyToEpr;
import org.jboss.soa.esb.addressing.eprs.DefaultJmsReplyToEpr;
import org.jboss.soa.esb.addressing.eprs.DefaultSftpReplyToEpr;
import org.jboss.soa.esb.addressing.eprs.FTPEpr;
import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
import org.jboss.soa.esb.addressing.eprs.JMSEpr;
import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
@@ -91,6 +93,8 @@
return new DefaultFileReplyToEpr((FileEpr)toEpr);
if(toEpr instanceof JDBCEpr)
return new DefaultJdbcReplyToEpr((JDBCEpr)toEpr);
+ if(toEpr instanceof HibernateEpr)
+ return new DefaultHibernateReplyToEpr((HibernateEpr)toEpr);
}
catch (MalformedURLException ex)
{
Copied: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateConn.java (from rev 12406, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateConn.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateConn.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateConn.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,158 @@
+/*
+ * 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.helpers.persist;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.jboss.soa.esb.ConfigurationException;
+
+/**
+ * This class is a Hibernate EventListener which implements hooks to all the available
+ * hibernate events. It's not used at the moment, but might be a way of augmenting
+ * the Hibernate Interceptor hooks which are currently implemented.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateConn
+{
+ protected final static Logger m_Logger = Logger.getLogger(HibernateConn.class);
+
+ private Session m_session = null;
+ private Transaction m_tx = null;
+
+ /**
+ * Constructor.
+ *
+ * @param f_cfgfile configuration file name
+ */
+ public HibernateConn(String f_cfgfile)
+ {
+ Configuration cfg = new Configuration();
+ cfg.configure(f_cfgfile);
+ SessionFactory sf = null;
+ try {
+ sf = HibernateSessionFactory.getInstance(cfg);
+ } catch (ConfigurationException e) {
+ m_Logger.error("", e);
+ }
+
+ m_session = sf.getCurrentSession();
+ }
+
+ /**
+ *
+ */
+ public void commit() {
+ if (null != m_tx)
+ {
+ m_tx.commit();
+ }
+ }
+
+ /**
+ *
+ */
+ public void rollback() {
+ if (null != m_tx)
+ {
+ m_tx.rollback();
+ }
+ }
+
+ /**
+ *
+ */
+ public void release() {
+ if (null != m_tx)
+ {
+ try
+ {
+ m_tx.rollback();
+ } catch (Exception eRoll) {
+ }
+ }
+ m_tx = null;
+ } // __________________________________
+
+ public Transaction getTransaction() {
+ if (null == m_tx)
+ {
+ connect();
+ }
+
+ return m_tx;
+ } // __________________________________
+
+ public Session getSession() {
+ return m_session;
+ }
+
+ public List execQuery(Query f_query) {
+ List l = null;
+ Transaction tx = null;
+ try {
+ tx = getTransaction();
+ l = f_query.list();
+ tx.commit();
+ } catch (Exception e) {
+ m_Logger.error("", e);
+ if (tx != null && tx.isActive()) {
+ tx.rollback();
+ }
+ }
+ return l;
+ }
+
+ private void connect() {
+ if (m_tx != null) {
+ return;
+ }
+
+ for (int i1 = 0; i1 < 5; i1++) {
+ try {
+ m_tx = m_session.beginTransaction();
+ break;
+ } catch (Exception e) {
+ m_Logger.debug("", e);
+ }
+
+ try {
+ Thread.sleep(2000 + (new Double(100 * Math.random()))
+ .longValue());
+ } catch (InterruptedException ex) {
+ m_Logger.error("Thread interrupted.", ex);
+ }
+ }
+
+ if (m_tx == null)
+ {
+ throw new RuntimeException("connect() FAILED: no connection");
+ }
+ }
+}
\ No newline at end of file
Copied: labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java (from rev 12406, labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,106 @@
+/*
+ * 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.helpers.persist;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.jboss.soa.esb.ConfigurationException;
+
+/**
+ * HibernateSessionFactory is a singleton for hibernate's SessionFactory object. The Listener
+ * uses JNDI to store the Hibernate SessionFactory.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ *
+ */
+public class HibernateSessionFactory {
+ public static final String HIBERNATE_JNDI = "java:comp/env/hibernate/SessionFactory";
+
+ private static SessionFactory sf = null;
+ private static final Logger m_Logger = Logger.getLogger(HibernateSessionFactory.class);
+
+ private HibernateSessionFactory() {
+ }
+
+ public static SessionFactory getInstance() {
+ if (sf != null) {
+ return sf;
+ } else {
+ return null;
+ }
+ }
+
+ public static SessionFactory getInstance(Configuration f_cfg) throws ConfigurationException {
+ if (sf == null) {
+ init(f_cfg);
+ }
+ return sf;
+ }
+
+ /**
+ * Grab InitialContext out of JNDI.
+ * @param f_cfg hibernate configuration
+ * @throws ConfigurationException
+ */
+ private static synchronized void init(Configuration f_cfg) throws ConfigurationException {
+ String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
+
+ Context ic = null;
+ // Look up SessionFactory in JNDI
+ if (cfgName != null) {
+ try {
+ ic = new InitialContext();
+ sf = (SessionFactory) ic.lookup(cfgName);
+ m_Logger.debug("Found SessionFactory in JNDI.");
+ } catch (NamingException ne) {
+ m_Logger.debug("Could not find SessionFactory in JNDI.", ne);
+ }
+ } else {
+ f_cfg.setProperty(Environment.SESSION_FACTORY_NAME, HIBERNATE_JNDI);
+ cfgName = HIBERNATE_JNDI;
+ }
+
+ if (sf == null) {
+ if (f_cfg != null) {
+ // Let Hibernate bind it to JNDI
+ m_Logger.debug("Build SessionFactory from Configuration.");
+ f_cfg.buildSessionFactory();
+ } else {
+ throw new ConfigurationException("Hibernate Configuration is null");
+ }
+ }
+ }
+
+ public static void close() {
+ if (sf != null) {
+ sf.close();
+ }
+ sf = null;
+ }
+}
\ No newline at end of file
Modified: labs/jbossesb/workspace/dbevenius/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/etc/schemas/xml/jbossesb-1.0.1.xsd 2007-06-08 06:36:42 UTC (rev 12407)
@@ -799,6 +799,87 @@
</xsd:element>
<!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
+ Hibernate Type Implementations.
+ 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
+ <xsd:element name="hibernate-message-filter">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">A Hibernate filter.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:attribute name="classname" use="required" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">The class name to monitor.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ <xsd:attribute name="event" use="optional" type="xsd:string" default="message_id">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">A comma-separated list of events to intercept.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-bus" substitutionGroup="jesb:bus">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">A hibernate-bus is a specific instance of a bus using the Hibernate protocol.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:bus">
+ <xsd:sequence>
+ <xsd:element ref="jesb:hibernate-message-filter" maxOccurs="unbounded" minOccurs="1"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-provider" substitutionGroup="jesb:provider">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">A specific instance of a provider, providing a hibernate service.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:provider">
+ <xsd:attribute name="hibernate-cfg-file" use="required" type="xsd:string">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">The Hibernate configuration file to use.</xsd:documentation>
+ </xsd:annotation>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="hibernate-listener" substitutionGroup="jesb:listener">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">A specific listener using the hibernate protocol.</xsd:documentation>
+ </xsd:annotation>
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="jesb:listener">
+ <xsd:sequence>
+ <xsd:element ref="jesb:hibernate-message-filter" maxOccurs="unbounded" minOccurs="0"/>
+ </xsd:sequence>
+ <xsd:attribute name="poll-frequency-seconds" use="optional" default="10">
+ <xsd:annotation>
+ <xsd:documentation xml:lang="en">The frequency with which this listener polls the db in
+ seconds. Defaults to 10 seconds.
+ </xsd:documentation>
+ </xsd:annotation>
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:integer">
+ <xsd:minExclusive value="0"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+
+
+ <!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
JBoss Remoting Type Implementations.
88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
<xsd:element name="jbr-bus" substitutionGroup="jesb:bus">
Copied: labs/jbossesb/workspace/dbevenius/product/lib/ext/hibernate3.jar (from rev 12406, labs/jbossesb/trunk/product/lib/ext/hibernate3.jar)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/aggregator/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/aggregator/build.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/aggregator/build.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -10,7 +10,7 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
- <target name="run" depends="compile,jar"
+ <target name="run" depends="compile"
description="runs the inbound Router/splitter">
<echo>Inbound Router/Splitter:</echo>
<java fork="yes" classname="org.jboss.soa.esb.listeners.StandAloneBootStrapper" failonerror="true">
Modified: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/conf/base-build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/conf/base-build.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/conf/base-build.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -301,14 +301,6 @@
<unjar src="${build.dir}/${ant.project.name}.esb" dest="${dest}"/>
</target>
- <target name="jar" depends="compile">
- <jar destfile="${build.dir}/${ant.project.name}.jar">
- <fileset dir="${build.dir}/classes"/>
- <fileset dir="${basedir}/src" excludes="**/*.java" /> <!-- Please leave the src dir in here! -->
- <fileset dir="${basedir}" includes="${additional.deploys}" excludes="build/**" />
- </jar>
- </target>
-
<target name="package-deployment">
<mkdir dir="lib"/>
<jar destfile="${build.dir}/${ant.project.name}.esb">
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action)
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/build.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,137 +0,0 @@
-<project name="Quickstart_helloworld_hibernate_action"
- default="run" basedir=".">
-
- <description>
- ${ant.project.name}
- ${line.separator}
- </description>
-
- <property name="additional.deploys" value="lib/*.jar" />
-
-
- <!-- Import the base Ant build script... -->
- <import file="../conf/base-build.xml"/>
-
- <path id="hibernate-classpath">
- <pathelement location="${basedir}/build/classes"/>
- <fileset dir="${basedir}/lib" includes="*.jar"/>
- </path>
-
- <target name="deploy" depends="build-ear">
- <copy file="${build.dir}/${ant.project.name}.ear"
- todir="${org.jboss.esb.server.deploy.dir}"/>
- </target>
-
- <target name="config" depends="compile">
- <copy file="hibernate.cfg.xml"
- todir="build/classes"/>
- <copy file="${basedir}/src/org/jboss/soa/esb/samples/quickstart/hibernateaction/esb-mappings.hbm.xml"
- todir="build/classes/org/jboss/soa/esb/samples/quickstart/hibernateaction"/>
- </target>
-
- <target name="build-ear" depends="package-deployment">
- <jar destfile="${build.dir}/${ant.project.name}.jar">
- <fileset dir="${build.dir}/classes">
- <include name="**"/>
- </fileset>
- <fileset dir="${basedir}">
- <include name="hibernate.cfg.xml"/>
- <include name="esb-mappings.hbm.xml"/>
- </fileset>
- <fileset dir="${basedir}/src">
- <include name="**/*.xml"/>
- </fileset>
- </jar>
- <!-- We build the .esb in a custom manner because
- we are packaging it within an .ear -->
- <mkdir dir="${build.dir}/META-INF"/>
- <copy file="jboss-esb.xml" todir="${build.dir}/META-INF"/>
- <delete file="${build.dir}/${ant.project.name}.esb"/>
- <jar destfile="${build.dir}/${ant.project.name}.esb">
- <fileset dir="${build.dir}">
- <include name="META-INF/*"/>
- </fileset>
- </jar>
-
- <war warfile="${build.dir}/${ant.project.name}.war"
- webxml="${basedir}/resources/WEB-INF/web.xml">
- <fileset dir="${basedir}/view">
- <include name="**/*"/>
- </fileset>
- </war>
-
- <ear destfile="${build.dir}/${ant.project.name}.ear"
- appxml="${basedir}/resources/application.xml">
- <fileset dir="${build.dir}">
- <include name="*.jar"/>
- <include name="*.war"/>
- <include name="*.esb"/>
- </fileset>
- <fileset dir="${basedir}/lib/ext">
- <include name="mysql-connector-java-3.1.12-bin.jar"/>
- </fileset>
- </ear>
- </target>
-
- <target name="runtest" depends="config"
- description="Insert row data into hibernate polled by gateway">
- <echo>basedir=${basedir}</echo>
- <echo>Insert row data into hibernate polled by gateway</echo>
-
- <java classname="org.jboss.soa.esb.samples.quickstart.hibernateaction.GatewayPopulator">
- <classpath refid="hibernate-classpath"/>
- </java>
- </target>
-
- <target name="dropdb"
- description="drop database">
- <echo>Drop database</echo>
- <exec executable="mysql" >
- <arg value="--user=root" />
- <arg value="--password=" />
- <arg value="--execute=drop database test_sql_gateway" />
- </exec>
- </target>
-
- <target name="createdb" depends="config"
- description="createdb">
- <echo>Create database and test table</echo>
- <exec executable="mysql" input="create.sql" >
- <arg value="--user=root" />
- <arg value="--password=" />
- </exec>
- <!--
- <taskdef name="htools"
- classname="org.hibernate.tool.ant.HibernateToolTask"
- classpathref="hibernate-classpath"/>
- <htools destdir="${basedir}">
- <classpath refid="hibernate-classpath"/>
- <configuration
- configurationfile="hibernate.cfg.xml"/>
- <hbm2ddl drop="true" outputfilename="sample.sql"/>
- </htools>
- -->
- </target>
-
- <target name="purgetable"
- description="purgetable">
- <echo>Purge sql table polled by gateway</echo>
- <exec executable="mysql">
- <arg value="--user=root" />
- <arg value="--password=" />
- <arg value="--database=test_sql_gateway" />
- <arg value="--execute=delete from gateway_table" />
- </exec>
- </target>
-
- <target name="select"
- description="select * from gateway_table">
- <echo>Select * from gateway_table</echo>
- <exec executable="mysql" >
- <arg value="--user=root" />
- <arg value="--password=" />
- <arg value="--database=test_sql_gateway" />
- <arg value="--execute=select * from gateway_table" />
- </exec>
- </target>
-</project>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/build.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/build.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,137 @@
+<project name="Quickstart_helloworld_hibernate_action"
+ default="run" basedir=".">
+
+ <description>
+ ${ant.project.name}
+ ${line.separator}
+ </description>
+
+ <property name="additional.deploys" value="lib/*.jar" />
+
+
+ <!-- Import the base Ant build script... -->
+ <import file="../conf/base-build.xml"/>
+
+ <path id="hibernate-classpath">
+ <pathelement location="${basedir}/build/classes"/>
+ <fileset dir="${basedir}/lib" includes="*.jar"/>
+ </path>
+
+ <target name="deploy" depends="build-ear">
+ <copy file="${build.dir}/${ant.project.name}.ear"
+ todir="${org.jboss.esb.server.deploy.dir}"/>
+ </target>
+
+ <target name="config" depends="compile">
+ <copy file="hibernate.cfg.xml"
+ todir="build/classes"/>
+ <copy file="${basedir}/src/org/jboss/soa/esb/samples/quickstart/hibernateaction/esb-mappings.hbm.xml"
+ todir="build/classes/org/jboss/soa/esb/samples/quickstart/hibernateaction"/>
+ </target>
+
+ <target name="build-ear" depends="package-deployment">
+ <jar destfile="${build.dir}/${ant.project.name}.jar">
+ <fileset dir="${build.dir}/classes">
+ <include name="**"/>
+ </fileset>
+ <fileset dir="${basedir}">
+ <include name="hibernate.cfg.xml"/>
+ <include name="esb-mappings.hbm.xml"/>
+ </fileset>
+ <fileset dir="${basedir}/src">
+ <include name="**/*.xml"/>
+ </fileset>
+ </jar>
+ <!-- We build the .esb in a custom manner because
+ we are packaging it within an .ear -->
+ <mkdir dir="${build.dir}/META-INF"/>
+ <copy file="jboss-esb.xml" todir="${build.dir}/META-INF"/>
+ <delete file="${build.dir}/${ant.project.name}.esb"/>
+ <jar destfile="${build.dir}/${ant.project.name}.esb">
+ <fileset dir="${build.dir}">
+ <include name="META-INF/*"/>
+ </fileset>
+ </jar>
+
+ <war warfile="${build.dir}/${ant.project.name}.war"
+ webxml="${basedir}/resources/WEB-INF/web.xml">
+ <fileset dir="${basedir}/view">
+ <include name="**/*"/>
+ </fileset>
+ </war>
+
+ <ear destfile="${build.dir}/${ant.project.name}.ear"
+ appxml="${basedir}/resources/application.xml">
+ <fileset dir="${build.dir}">
+ <include name="*.jar"/>
+ <include name="*.war"/>
+ <include name="*.esb"/>
+ </fileset>
+ <fileset dir="${basedir}/lib/ext">
+ <include name="mysql-connector-java-3.1.12-bin.jar"/>
+ </fileset>
+ </ear>
+ </target>
+
+ <target name="runtest" depends="config"
+ description="Insert row data into hibernate polled by gateway">
+ <echo>basedir=${basedir}</echo>
+ <echo>Insert row data into hibernate polled by gateway</echo>
+
+ <java classname="org.jboss.soa.esb.samples.quickstart.hibernateaction.GatewayPopulator">
+ <classpath refid="hibernate-classpath"/>
+ </java>
+ </target>
+
+ <target name="dropdb"
+ description="drop database">
+ <echo>Drop database</echo>
+ <exec executable="mysql" >
+ <arg value="--user=root" />
+ <arg value="--password=" />
+ <arg value="--execute=drop database test_sql_gateway" />
+ </exec>
+ </target>
+
+ <target name="createdb" depends="config"
+ description="createdb">
+ <echo>Create database and test table</echo>
+ <exec executable="mysql" input="create.sql" >
+ <arg value="--user=root" />
+ <arg value="--password=" />
+ </exec>
+ <!--
+ <taskdef name="htools"
+ classname="org.hibernate.tool.ant.HibernateToolTask"
+ classpathref="hibernate-classpath"/>
+ <htools destdir="${basedir}">
+ <classpath refid="hibernate-classpath"/>
+ <configuration
+ configurationfile="hibernate.cfg.xml"/>
+ <hbm2ddl drop="true" outputfilename="sample.sql"/>
+ </htools>
+ -->
+ </target>
+
+ <target name="purgetable"
+ description="purgetable">
+ <echo>Purge sql table polled by gateway</echo>
+ <exec executable="mysql">
+ <arg value="--user=root" />
+ <arg value="--password=" />
+ <arg value="--database=test_sql_gateway" />
+ <arg value="--execute=delete from gateway_table" />
+ </exec>
+ </target>
+
+ <target name="select"
+ description="select * from gateway_table">
+ <echo>Select * from gateway_table</echo>
+ <exec executable="mysql" >
+ <arg value="--user=root" />
+ <arg value="--password=" />
+ <arg value="--database=test_sql_gateway" />
+ <arg value="--execute=select * from gateway_table" />
+ </exec>
+ </target>
+</project>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/create.sql 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,11 +0,0 @@
--- drop database orders;
-create database orders;
-use orders;
-create table orders
-(
-unique_id serial,
-product text,
-quantity int,
-price float
-);
-create unique index uid_index on orders (unique_id);
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/create.sql)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/create.sql 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,11 @@
+-- drop database orders;
+create database orders;
+use orders;
+create table orders
+(
+unique_id serial,
+product text,
+quantity int,
+price float
+);
+create unique index uid_index on orders (unique_id);
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,21 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE hibernate-configuration PUBLIC
-"-//Hibernate/Hibernate Configuration DTD//EN"
-"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
-<session-factory>
- <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
- <property name="hibernate.connection.url">jdbc:mysql://localhost/orders</property>
- <property name="hibernate.connection.username">root</property>
- <property name="hibernate.connection.password"></property>
- <property name="hibernate.connection.pool_size">10</property>
- <property name="show_sql">true</property>
- <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
- <property name="hibernate.hbm2ddl.auto">update</property>
- <property name="current_session_context_class">thread</property>
-<!-- <property name="hibernate.session_factory_name">java:comp/env/hibernate/SessionFactory</property> -->
- <property name="hibernate.session_factory_name">SessionFactory</property>
- <!-- Mapping files -->
- <mapping resource="org/jboss/soa/esb/samples/quickstart/hibernateaction/esb-mappings.hbm.xml"/>
-</session-factory>
-</hibernate-configuration>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/hibernate.cfg.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,21 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+"-//Hibernate/Hibernate Configuration DTD//EN"
+"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+<session-factory>
+ <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+ <property name="hibernate.connection.url">jdbc:mysql://localhost/orders</property>
+ <property name="hibernate.connection.username">root</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.connection.pool_size">10</property>
+ <property name="show_sql">true</property>
+ <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
+ <property name="hibernate.hbm2ddl.auto">update</property>
+ <property name="current_session_context_class">thread</property>
+<!-- <property name="hibernate.session_factory_name">java:comp/env/hibernate/SessionFactory</property> -->
+ <property name="hibernate.session_factory_name">SessionFactory</property>
+ <!-- Mapping files -->
+ <mapping resource="org/jboss/soa/esb/samples/quickstart/hibernateaction/esb-mappings.hbm.xml"/>
+</session-factory>
+</hibernate-configuration>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,55 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
- <providers>
- <hibernate-provider name="Hibernateprovider"
- hibernate-cfg-file="hibernate.cfg.xml">
- <hibernate-bus busid="helloHibernateChannel" >
- <hibernate-message-filter
- classname="org.jboss.soa.esb.samples.quickstart.hibernateaction.Order"
- event="onLoad,onDelete"/>
- </hibernate-bus>
- </hibernate-provider>
-
- <jms-provider name="JBossMQ"
- connection-factory="ConnectionFactory"
- jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
- jndi-URL="localhost" >
-
- <jms-bus busid="quickstartEsbChannel">
- <jms-message-filter
- dest-type="QUEUE"
- dest-name="queue/A"
- selector="source='fromHelloworldHibernateAction'"
- />
- </jms-bus>
-
- </jms-provider>
-
- </providers>
-
- <services>
- <service
- category="myCategory"
- name="myJmsListener"
- description="Hello World Hibernate Action (esb hibernate listener)">
- <listeners>
- <hibernate-listener name="HibernateGateway"
- busidref="helloHibernateChannel"
- maxThreads="1"
- is-gateway="true"/>
- <jms-listener name="helloWorldJmsAction"
- busidref="quickstartEsbChannel"
- maxThreads="1"
- />
- </listeners>
- <actions>
- <action name="action1"
- class="org.jboss.soa.esb.samples.quickstart.hibernateaction.MyAction"
- process="displayMessage"
- />
- </actions>
- </service>
- </services>
-
-</jbossesb>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,55 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+ <providers>
+ <hibernate-provider name="Hibernateprovider"
+ hibernate-cfg-file="hibernate.cfg.xml">
+ <hibernate-bus busid="helloHibernateChannel" >
+ <hibernate-message-filter
+ classname="org.jboss.soa.esb.samples.quickstart.hibernateaction.Order"
+ event="onLoad,onDelete"/>
+ </hibernate-bus>
+ </hibernate-provider>
+
+ <jms-provider name="JBossMQ"
+ connection-factory="ConnectionFactory"
+ jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+ jndi-URL="localhost" >
+
+ <jms-bus busid="quickstartEsbChannel">
+ <jms-message-filter
+ dest-type="QUEUE"
+ dest-name="queue/A"
+ selector="source='fromHelloworldHibernateAction'"
+ />
+ </jms-bus>
+
+ </jms-provider>
+
+ </providers>
+
+ <services>
+ <service
+ category="myCategory"
+ name="myJmsListener"
+ description="Hello World Hibernate Action (esb hibernate listener)">
+ <listeners>
+ <hibernate-listener name="HibernateGateway"
+ busidref="helloHibernateChannel"
+ maxThreads="1"
+ is-gateway="true"/>
+ <jms-listener name="helloWorldJmsAction"
+ busidref="quickstartEsbChannel"
+ maxThreads="1"
+ />
+ </listeners>
+ <actions>
+ <action name="action1"
+ class="org.jboss.soa.esb.samples.quickstart.hibernateaction.MyAction"
+ process="displayMessage"
+ />
+ </actions>
+ </service>
+ </services>
+
+</jbossesb>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- JBoss, Home of Professional Open Source
- Copyright 2006, JBoss Inc., and others contributors as indicated
- by the @authors tag. All rights reserved.
- See the copyright.txt in the distribution for a
- full listing of individual contributors.
- This copyrighted material is made available to anyone wishing to use,
- modify, copy, or redistribute it subject to the terms and conditions
- of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- 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,
- v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301, USA.
-
- (C) 2005-2006,
- @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
- These options are described in the JBossESB manual.
- Defaults are provided here for convenience only.
-
- Please read through this file prior to using the system, and consider
- updating the specified entries.
--->
-<esb
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
- <properties name="core">
- <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
- <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
- <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
- </properties>
- <properties name="registry">
- <property name="org.jboss.soa.esb.registry.queryManagerURI"
- value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
- <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
- value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
- <property name="org.jboss.soa.esb.registry.implementationClass"
- value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
- <property name="org.jboss.soa.esb.registry.factoryClass"
- value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
- <property name="org.jboss.soa.esb.registry.user"
- value="jbossesb"/>
- <property name="org.jboss.soa.esb.registry.password"
- value="password"/>
- <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
- <property name="org.jboss.soa.esb.scout.proxy.transportClass"
- value="org.apache.ws.scout.transport.RMITransport"/>
- </properties>
- <properties name="transports" depends="core">
- <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
- <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
- <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
- <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
- </properties>
- <properties name="connection">
- <property name="min-pool-size" value="5"/>
- <property name="max-pool=size" value="10"/>
- <property name="blocking-timeout-millis" value="5000"/>
- <property name="abandoned-connection-timeout" value="10000"/>
- <property name="abandoned-connection-time-interval" value="30000"/>
- </properties>
- <properties name="dbstore">
- <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
- <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
- <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
- <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
- <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
- <!--table managed by pool to test for valid connections - created by pool automatically -->
- <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
- <!-- # of milliseconds to timeout waiting for a connection from pool -->
- <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
- </properties>
- <properties name="messagerouting">
- <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
- </properties>
-</esb>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jbossesb-properties.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2006, JBoss Inc., and others contributors as indicated
+ by the @authors tag. All rights reserved.
+ See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+ This copyrighted material is made available to anyone wishing to use,
+ modify, copy, or redistribute it subject to the terms and conditions
+ of the GNU Lesser General Public License, v. 2.1.
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ 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,
+ v.2.1 along with this distribution; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA.
+
+ (C) 2005-2006,
+ @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+ These options are described in the JBossESB manual.
+ Defaults are provided here for convenience only.
+
+ Please read through this file prior to using the system, and consider
+ updating the specified entries.
+-->
+<esb
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+ <properties name="core">
+ <property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+ <property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+ <property name="org.jboss.soa.esb.persistence.connection.factory" value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+ </properties>
+ <properties name="registry">
+ <property name="org.jboss.soa.esb.registry.queryManagerURI"
+ value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>
+ <property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"
+ value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+ <property name="org.jboss.soa.esb.registry.implementationClass"
+ value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+ <property name="org.jboss.soa.esb.registry.factoryClass"
+ value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+ <property name="org.jboss.soa.esb.registry.user"
+ value="jbossesb"/>
+ <property name="org.jboss.soa.esb.registry.password"
+ value="password"/>
+ <!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+ <property name="org.jboss.soa.esb.scout.proxy.transportClass"
+ value="org.apache.ws.scout.transport.RMITransport"/>
+ </properties>
+ <properties name="transports" depends="core">
+ <property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+ <property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+ <property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+ <property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+ </properties>
+ <properties name="connection">
+ <property name="min-pool-size" value="5"/>
+ <property name="max-pool=size" value="10"/>
+ <property name="blocking-timeout-millis" value="5000"/>
+ <property name="abandoned-connection-timeout" value="10000"/>
+ <property name="abandoned-connection-time-interval" value="30000"/>
+ </properties>
+ <properties name="dbstore">
+ <property name="org.jboss.soa.esb.persistence.db.connection.url" value="jdbc:hsqldb:hsql://localhost:9001/jbossesb"/>
+ <property name="org.jboss.soa.esb.persistence.db.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+ <property name="org.jboss.soa.esb.persistence.db.user" value="sa"/>
+ <property name="org.jboss.soa.esb.persistence.db.pwd" value=""/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.initial.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.min.size" value="2"/>
+ <property name="org.jboss.soa.esb.persistence.db.pool.max.size" value="5"/>
+ <!--table managed by pool to test for valid connections - created by pool automatically -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.test.table" value="pooltest"/>
+ <!-- # of milliseconds to timeout waiting for a connection from pool -->
+ <property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis" value="5000"/>
+ </properties>
+ <properties name="messagerouting">
+ <property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+ </properties>
+</esb>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/jndi.properties 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
-
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/juddi.properties 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/listener.log 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,5 +0,0 @@
-2007-06-04 20:26:53,177 ERROR [main][org.jboss.soa.esb.listeners.config.XmlValidatorImpl] 1-ERROR-null-13:cvc-complex-type.4: Attribute 'tablename' must appear on element 'hibernate-message-filter'.
-2007-06-04 20:26:53,189 ERROR [main][org.jboss.soa.esb.listeners.config.ConfigurationController] The configuration file /Users/tcunning/src/esb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
- did not pass validation for the following reasons:
-** 1. ERROR-null-13:cvc-complex-type.4: Attribute 'tablename' must appear on element 'hibernate-message-filter'.
-
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/listener.log)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/listener.log 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,5 @@
+2007-06-04 20:26:53,177 ERROR [main][org.jboss.soa.esb.listeners.config.XmlValidatorImpl] 1-ERROR-null-13:cvc-complex-type.4: Attribute 'tablename' must appear on element 'hibernate-message-filter'.
+2007-06-04 20:26:53,189 ERROR [main][org.jboss.soa.esb.listeners.config.ConfigurationController] The configuration file /Users/tcunning/src/esb/trunk/product/samples/quickstarts/helloworld_hibernate_action/jboss-esb.xml
+ did not pass validation for the following reasons:
+** 1. ERROR-null-13:cvc-complex-type.4: Attribute 'tablename' must appear on element 'hibernate-message-filter'.
+
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,40 +0,0 @@
-### direct log messages to stdout ###
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
-
-### set log levels - for more verbose logging change 'info' to 'debug' ###
-
-log4j.rootLogger=debug, stdout
-
-log4j.logger.org.hibernate=info
-#log4j.logger.org.hibernate=debug
-
-### log HQL query parser activity
-#log4j.logger.org.hibernate.hql.ast.AST=debug
-
-### log just the SQL
-log4j.logger.org.hibernate.SQL=debug
-
-### log JDBC bind parameters ###
-log4j.logger.org.hibernate.type=info
-
-### log schema export/update ###
-log4j.logger.org.hibernate.tool.hbm2ddl=info
-
-### log HQL parse trees
-#log4j.logger.org.hibernate.hql=debug
-
-### log cache activity ###
-log4j.logger.org.hibernate.cache=info
-
-### log transaction activity
-#log4j.logger.org.hibernate.transaction=debug
-
-### log JDBC resource acquisition
-#log4j.logger.org.hibernate.jdbc=debug
-
-### enable the following line if you want to track down connection ###
-### leakages when using DriverManagerConnectionProvider ###
-#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.properties 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,40 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### set log levels - for more verbose logging change 'info' to 'debug' ###
+
+log4j.rootLogger=debug, stdout
+
+log4j.logger.org.hibernate=info
+#log4j.logger.org.hibernate=debug
+
+### log HQL query parser activity
+#log4j.logger.org.hibernate.hql.ast.AST=debug
+
+### log just the SQL
+log4j.logger.org.hibernate.SQL=debug
+
+### log JDBC bind parameters ###
+log4j.logger.org.hibernate.type=info
+
+### log schema export/update ###
+log4j.logger.org.hibernate.tool.hbm2ddl=info
+
+### log HQL parse trees
+#log4j.logger.org.hibernate.hql=debug
+
+### log cache activity ###
+log4j.logger.org.hibernate.cache=info
+
+### log transaction activity
+#log4j.logger.org.hibernate.transaction=debug
+
+### log JDBC resource acquisition
+#log4j.logger.org.hibernate.jdbc=debug
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.org.hibernate.connection.DriverManagerConnectionProvider=trace
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
- | For more configuration infromation and examples see the Jakarta Log4j
- | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="Target" value="System.out"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================================= -->
- <!-- Preserve messages in a local file -->
- <!-- ================================= -->
-
- <!-- A size based file rolling appender -->
- <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
- <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
- <param name="File" value="./listener.log"/>
- <param name="Append" value="false"/>
- <param name="MaxFileSize" value="500KB"/>
- <param name="MaxBackupIndex" value="1"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
- </layout>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.hibernate">
- <priority value="INFO"/>
- </category>
- <category name="org.jboss">
- <priority value="WARN"/>
- </category>
- <category name="org.jboss.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.jboss.internal.soa.esb">
- <priority value="ERROR"/>
- </category>
- <category name="org.apache">
- <priority value="ERROR"/>
- </category>
- <category name="quickstart">
- <priority value="INFO"/>
- </category>
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="CONSOLE"/>
- <appender-ref ref="FILE"/>
- </root>
-
-</log4j:configuration>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/log4j.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Log4j Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+ | For more configuration infromation and examples see the Jakarta Log4j
+ | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+ <!-- ============================== -->
+ <!-- Append messages to the console -->
+ <!-- ============================== -->
+
+ <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <!-- The default pattern: Date Priority [Category] Message\n -->
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================================= -->
+ <!-- Preserve messages in a local file -->
+ <!-- ================================= -->
+
+ <!-- A size based file rolling appender -->
+ <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+ <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+ <param name="File" value="./listener.log"/>
+ <param name="Append" value="false"/>
+ <param name="MaxFileSize" value="500KB"/>
+ <param name="MaxBackupIndex" value="1"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- ================ -->
+ <!-- Limit categories -->
+ <!-- ================ -->
+
+ <category name="org.hibernate">
+ <priority value="INFO"/>
+ </category>
+ <category name="org.jboss">
+ <priority value="WARN"/>
+ </category>
+ <category name="org.jboss.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.jboss.internal.soa.esb">
+ <priority value="ERROR"/>
+ </category>
+ <category name="org.apache">
+ <priority value="ERROR"/>
+ </category>
+ <category name="quickstart">
+ <priority value="INFO"/>
+ </category>
+ <!-- ======================= -->
+ <!-- Setup the Root category -->
+ <!-- ======================= -->
+
+ <root>
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="FILE"/>
+ </root>
+
+</log4j:configuration>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/readme.txt 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,43 +0,0 @@
-Overview:
-=========
-This Quickstart requires jboss-4.2.0.GA.
-
-This is a demonstration of a Hibernate listener. This test is configured
-to use a mysql database running on localhost (see jbossesb.xml). This
-quickstart builds an ear containing both an .esb and a .war. The .war
-has a series of .jsps which demonstrate insert/delete/load/update.
-
-If you browse the .war and insert items, you can see the Hibernate entities
-that you load and delete items, you can watch the Hibernate entities sent
-in messages to JBoss's console.
-
-Running this quickstart:
-========================
- Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts and a
- more detailed descripton of the different ways to run the quickstarts.
-
-Before Running:
-===============
- 1. install mysql if you have not already.
- 2. start the mysql database
- 3. edit mysql.proprties with the user and password to be used with mysql
- 4. ant createdb
-
-
-To Run .ear mode:
-=======================
- 1. In a command terminal window in the quickstart folder type 'ant deploy'.
- 2. Assuming that your appserver is running tomcat on port 8080, Browse to http://localhost:8080/hibernateaction/list.jsp
- 3. Watch the events in the JBoss appserver console.
-
-Project file descriptions:
-==========================
- jbossesb.xml:
- The JMS gateway and ESB configuration file. It is listening for new rows in the gateway table.
-
- create.sql:
- Will create the database and tables.
-
- lib:
- Additional jars needed. For example jar for database drivers
-
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/readme.txt)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/readme.txt 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,43 @@
+Overview:
+=========
+This Quickstart requires jboss-4.2.0.GA.
+
+This is a demonstration of a Hibernate listener. This test is configured
+to use a mysql database running on localhost (see jbossesb.xml). This
+quickstart builds an ear containing both an .esb and a .war. The .war
+has a series of .jsps which demonstrate insert/delete/load/update.
+
+If you browse the .war and insert items, you can see the Hibernate entities
+that you load and delete items, you can watch the Hibernate entities sent
+in messages to JBoss's console.
+
+Running this quickstart:
+========================
+ Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts and a
+ more detailed descripton of the different ways to run the quickstarts.
+
+Before Running:
+===============
+ 1. install mysql if you have not already.
+ 2. start the mysql database
+ 3. edit mysql.proprties with the user and password to be used with mysql
+ 4. ant createdb
+
+
+To Run .ear mode:
+=======================
+ 1. In a command terminal window in the quickstart folder type 'ant deploy'.
+ 2. Assuming that your appserver is running tomcat on port 8080, Browse to http://localhost:8080/hibernateaction/list.jsp
+ 3. Watch the events in the JBoss appserver console.
+
+Project file descriptions:
+==========================
+ jbossesb.xml:
+ The JMS gateway and ESB configuration file. It is listening for new rows in the gateway table.
+
+ create.sql:
+ Will create the database and tables.
+
+ lib:
+ Additional jars needed. For example jar for database drivers
+
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources)
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF)
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
-
- <display-name>Helloworld Hibernate Action</display-name>
-
- <description>Demonstration of Hibernate Listener.</description>
-
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
-
-</web-app>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/WEB-INF/web.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>Helloworld Hibernate Action</display-name>
+
+ <description>Demonstration of Hibernate Listener.</description>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+</web-app>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<application xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
- version="5">
-
- <display-name>helloworld_hibernate_action</display-name>
-
- <module>
- <web>
- <web-uri>Quickstart_helloworld_hibernate_action.war</web-uri>
- <context-root>/hibernateaction</context-root>
- </web>
- </module>
-
- <module>
- <java>Quickstart_helloworld_hibernate_action.jar</java>
- </module>
-
- <module>
- <java>Quickstart_helloworld_hibernate_action.esb</java>
- </module>
-
- <module>
- <java>mysql-connector-java-3.1.12-bin.jar</java>
- </module>
-
-</application>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/resources/application.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+
+ <display-name>helloworld_hibernate_action</display-name>
+
+ <module>
+ <web>
+ <web-uri>Quickstart_helloworld_hibernate_action.war</web-uri>
+ <context-root>/hibernateaction</context-root>
+ </web>
+ </module>
+
+ <module>
+ <java>Quickstart_helloworld_hibernate_action.jar</java>
+ </module>
+
+ <module>
+ <java>Quickstart_helloworld_hibernate_action.esb</java>
+ </module>
+
+ <module>
+ <java>mysql-connector-java-3.1.12-bin.jar</java>
+ </module>
+
+</application>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view)
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,15 +0,0 @@
-<html>
-<body>
-<%
- String product = request.getParameter("product");
- String quantString = request.getParameter("quantity");
- String priceString = request.getParameter("price");
-
- int quantity = Integer.parseInt(quantString);
- float price = Float.parseFloat(priceString);
-%>
-Product: <%=product%><p>
-Quantity: <%=quantity%><p>
-Price: <%=price%><p>
-</body>
-</html>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/action.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,15 @@
+<html>
+<body>
+<%
+ String product = request.getParameter("product");
+ String quantString = request.getParameter("quantity");
+ String priceString = request.getParameter("price");
+
+ int quantity = Integer.parseInt(quantString);
+ float price = Float.parseFloat(priceString);
+%>
+Product: <%=product%><p>
+Quantity: <%=quantity%><p>
+Price: <%=price%><p>
+</body>
+</html>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,23 +0,0 @@
-<%@ page import="java.util.Iterator" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.hibernate.Session" %>
-<%@ page import="org.hibernate.Transaction" %>
-<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
-<%
- long id = Long.parseLong(request.getParameter("id"));
- Transaction tx = null;
- Session sess = SessionFactorySingleton.getInstance().getCurrentSession();
- try {
- tx = sess.beginTransaction();
- Object order = sess.load (Order.class, new Long(id));
- sess.delete(order);
- tx.commit();
- } catch (Exception e) {
- e.printStackTrace();
- if (tx != null && tx.isActive()) {
- tx.rollback();
- }
- }
- response.sendRedirect(request.getContextPath() + "/list.jsp");
-
-%>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/delete.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,23 @@
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.hibernate.Session" %>
+<%@ page import="org.hibernate.Transaction" %>
+<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
+<%
+ long id = Long.parseLong(request.getParameter("id"));
+ Transaction tx = null;
+ Session sess = SessionFactorySingleton.getInstance().getCurrentSession();
+ try {
+ tx = sess.beginTransaction();
+ Object order = sess.load (Order.class, new Long(id));
+ sess.delete(order);
+ tx.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (tx != null && tx.isActive()) {
+ tx.rollback();
+ }
+ }
+ response.sendRedirect(request.getContextPath() + "/list.jsp");
+
+%>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,52 +0,0 @@
-<%@ page import="java.util.Iterator" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.hibernate.Session" %>
-<%@ page import="org.hibernate.Transaction" %>
-<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
-<html>
-<head>
-<title>Hibernate Listener Example</title>
-<link rel="shortcut icon" href="http://www.jboss.com/favicon.ico"/>
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
-</head>
-<%
- long id = Long.parseLong(request.getParameter("id"));
- Order order = null;
- Transaction tx = null;
- Session sess = SessionFactorySingleton.getInstance().getCurrentSession();
-
- try {
- tx = sess.beginTransaction();
- order = (Order) sess.load (Order.class, new Long(id));
- tx.commit();
- } catch (Exception e) {
- e.printStackTrace();
- }
-%>
-
-<body>
- <form id="orderRequest" action="insert.jsp" method="post">
- <table width="100%" border="0" cellpadding="10" cellspacing="3">
- <tr><td>Product</td><td><input type="text"
- value="<%=order.getProduct()%>"
- name="product" id="product"/></td></tr>
- <tr><td>Quantity</td><td><input type="text"
- value="<%=order.getQuantity()%>"
- name="quantity" id="quantity"/></td></tr>
- <tr><td>Price</td><td><input type="text"
- value="<%=order.getPrice()%>"
- name="price" id="price"/></td></tr>
- <tr><td><input type="submit" value="submit"></td></tr>
- </table>
- </form>
-</body>
-</html>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/edit.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,52 @@
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.hibernate.Session" %>
+<%@ page import="org.hibernate.Transaction" %>
+<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
+<html>
+<head>
+<title>Hibernate Listener Example</title>
+<link rel="shortcut icon" href="http://www.jboss.com/favicon.ico"/>
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
+</head>
+<%
+ long id = Long.parseLong(request.getParameter("id"));
+ Order order = null;
+ Transaction tx = null;
+ Session sess = SessionFactorySingleton.getInstance().getCurrentSession();
+
+ try {
+ tx = sess.beginTransaction();
+ order = (Order) sess.load (Order.class, new Long(id));
+ tx.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+%>
+
+<body>
+ <form id="orderRequest" action="insert.jsp" method="post">
+ <table width="100%" border="0" cellpadding="10" cellspacing="3">
+ <tr><td>Product</td><td><input type="text"
+ value="<%=order.getProduct()%>"
+ name="product" id="product"/></td></tr>
+ <tr><td>Quantity</td><td><input type="text"
+ value="<%=order.getQuantity()%>"
+ name="quantity" id="quantity"/></td></tr>
+ <tr><td>Price</td><td><input type="text"
+ value="<%=order.getPrice()%>"
+ name="price" id="price"/></td></tr>
+ <tr><td><input type="submit" value="submit"></td></tr>
+ </table>
+ </form>
+</body>
+</html>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,29 +0,0 @@
-<html>
-<head>
-<title>Hibernate Listener Example</title>
-<link rel="shortcut icon" href="http://www.jboss.com/favicon.ico"/>
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
-</head>
-<body>
- <form id="orderRequest" action="insert.jsp" method="post">
- <table width="100%" border="0" cellpadding="10" cellspacing="3">
- <tr><td>Product</td><td><input type="text" value="Widgets"
- name="product" id="product"/></td></tr>
- <tr><td>Quantity</td><td><input type="text" value="2"
- name="quantity" id="quantity"/></td></tr>
- <tr><td>Price</td><td><input type="text" value="2.40"
- name="price" id="price"/></td></tr>
- <tr><td><input type="submit" value="submit"></td></tr>
- </table>
- </form>
-</body>
-</html>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/index.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,29 @@
+<html>
+<head>
+<title>Hibernate Listener Example</title>
+<link rel="shortcut icon" href="http://www.jboss.com/favicon.ico"/>
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
+</head>
+<body>
+ <form id="orderRequest" action="insert.jsp" method="post">
+ <table width="100%" border="0" cellpadding="10" cellspacing="3">
+ <tr><td>Product</td><td><input type="text" value="Widgets"
+ name="product" id="product"/></td></tr>
+ <tr><td>Quantity</td><td><input type="text" value="2"
+ name="quantity" id="quantity"/></td></tr>
+ <tr><td>Price</td><td><input type="text" value="2.40"
+ name="price" id="price"/></td></tr>
+ <tr><td><input type="submit" value="submit"></td></tr>
+ </table>
+ </form>
+</body>
+</html>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,38 +0,0 @@
-<%@ page import="java.util.Iterator" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.hibernate.Session" %>
-<%@ page import="org.hibernate.Transaction" %>
-<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
-<html>
-<body>
-<%
- String product = request.getParameter("product");
- String quantString = request.getParameter("quantity");
- String priceString = request.getParameter("price");
-
- int quantity = Integer.parseInt(quantString);
- float price = Float.parseFloat(priceString);
-
- Order insOrder = new Order(product, new Integer(quantity),
- new Float(price));
- Transaction tx = null;
- Session sess = SessionFactorySingleton.getInstance().openSession();
- try {
- tx = sess.beginTransaction();
- sess.save(insOrder);
- tx.commit();
- sess.flush();
- } catch (Exception e) {
- e.printStackTrace();
- if (tx != null && tx.isActive()) {
- tx.rollback();
- }
- }
-
- response.sendRedirect(request.getContextPath() + "/list.jsp");
-%>
-Product: <%=product%><p>
-Quantity: <%=quantity%><p>
-Price: <%=price%><p>
-</body>
-</html>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/insert.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,38 @@
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.hibernate.Session" %>
+<%@ page import="org.hibernate.Transaction" %>
+<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
+<html>
+<body>
+<%
+ String product = request.getParameter("product");
+ String quantString = request.getParameter("quantity");
+ String priceString = request.getParameter("price");
+
+ int quantity = Integer.parseInt(quantString);
+ float price = Float.parseFloat(priceString);
+
+ Order insOrder = new Order(product, new Integer(quantity),
+ new Float(price));
+ Transaction tx = null;
+ Session sess = SessionFactorySingleton.getInstance().openSession();
+ try {
+ tx = sess.beginTransaction();
+ sess.save(insOrder);
+ tx.commit();
+ sess.flush();
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (tx != null && tx.isActive()) {
+ tx.rollback();
+ }
+ }
+
+ response.sendRedirect(request.getContextPath() + "/list.jsp");
+%>
+Product: <%=product%><p>
+Quantity: <%=quantity%><p>
+Price: <%=price%><p>
+</body>
+</html>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,59 +0,0 @@
-<%@ page import="java.util.Iterator" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.hibernate.Session" %>
-<%@ page import="org.hibernate.Transaction" %>
-<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
-
-<html>
-<head>
-<title>Hibernate Listener Example</title>
-<link rel="shortcut icon" href="http://www.jboss.com/favicon.ico"/>
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
-<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
-</head>
-<body>
- <form id="orderRequest" action="/processorder" method="post">
- <table width="100%" border="0" cellpadding="10" cellspacing="3">
- <tr>
- <td>Product</td>
- <td>Quantity</td>
- <td>Price</td>
- <td>Action</td>
- </tr>
- <%
- Transaction tx = null;
- Session sess = SessionFactorySingleton.getInstance().openSession();
-
- try {
- tx = sess.beginTransaction();
- List records = sess.createQuery("select o from Order as o").list();
- for (Iterator iter = records.iterator(); iter.hasNext();) {
- Order order = (Order) iter.next();
- if (order != null) {
- %>
- <tr>
- <td><%=order.getProduct()%></td>
- <td><%=order.getQuantity()%></td>
- <td><%=order.getPrice()%></td>
- <td><a href="<%=request.getContextPath() + "/edit.jsp"%>?id=<%=order.getId()%>">Edit</a> |
- <a href="<%=request.getContextPath() + "/delete.jsp"%>?id=<%=order.getId()%>">Delete</a></td>
- </tr>
- <%
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- %>
- <tr><td colspan="3"><a href="<%=request.getContextPath() + "/index.jsp"%>">Return to Entry Page</a></td>
- </table>
-</body>
-</html>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/list.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,59 @@
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.hibernate.Session" %>
+<%@ page import="org.hibernate.Transaction" %>
+<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
+
+<html>
+<head>
+<title>Hibernate Listener Example</title>
+<link rel="shortcut icon" href="http://www.jboss.com/favicon.ico"/>
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/custom.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/global.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/headings.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/layout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/navigation.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/pagelayout.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/tables.css" type="text/css" media="all">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/screen.css" type="text/css" media="screen">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/print.css" type="text/css" media="print">
+<link rel="stylesheet" href="http://www.jboss.com/themes/jbosstheme/style/common.css" type="text/css" media="all">
+</head>
+<body>
+ <form id="orderRequest" action="/processorder" method="post">
+ <table width="100%" border="0" cellpadding="10" cellspacing="3">
+ <tr>
+ <td>Product</td>
+ <td>Quantity</td>
+ <td>Price</td>
+ <td>Action</td>
+ </tr>
+ <%
+ Transaction tx = null;
+ Session sess = SessionFactorySingleton.getInstance().openSession();
+
+ try {
+ tx = sess.beginTransaction();
+ List records = sess.createQuery("select o from Order as o").list();
+ for (Iterator iter = records.iterator(); iter.hasNext();) {
+ Order order = (Order) iter.next();
+ if (order != null) {
+ %>
+ <tr>
+ <td><%=order.getProduct()%></td>
+ <td><%=order.getQuantity()%></td>
+ <td><%=order.getPrice()%></td>
+ <td><a href="<%=request.getContextPath() + "/edit.jsp"%>?id=<%=order.getId()%>">Edit</a> |
+ <a href="<%=request.getContextPath() + "/delete.jsp"%>?id=<%=order.getId()%>">Delete</a></td>
+ </tr>
+ <%
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ %>
+ <tr><td colspan="3"><a href="<%=request.getContextPath() + "/index.jsp"%>">Return to Entry Page</a></td>
+ </table>
+</body>
+</html>
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -1,37 +0,0 @@
-<%@ page import="java.util.Iterator" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.hibernate.Session" %>
-<%@ page import="org.hibernate.Transaction" %>
-<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
-<%
- String product = request.getParameter("product");
- String quantString = request.getParameter("quantity");
- String priceString = request.getParameter("price");
-
- int quantity = Integer.parseInt(quantString);
- float price = Float.parseFloat(priceString);
-
- Transaction tx = null;
- Session sess = SessionFactorySingleton.getInstance().getCurrentSession();
- try {
- tx = sess.beginTransaction();
- Query q = sess.createQuery("update Order "
- + "set product = :product, "
- + "set quantity = :quantity, "
- + "set price = :price");
- q.setString("product", product);
- q.setInteger("quantity", new Integer(quantity));
- q.setLong("price", new Long(price));
- q.executeUpdate();
- tx.commit();
- } catch (Exception e) {
- e.printStackTrace();
- if (tx != null && tx.isActive()) {
- tx.rollback();
- }
- } finally {
- sess.close();
- }
-
- response.sendRedirect(request.getContextPath() + "/list.jsp");
-%>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp (from rev 12406, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_hibernate_action/view/update.jsp 2007-06-08 06:36:42 UTC (rev 12407)
@@ -0,0 +1,37 @@
+<%@ page import="java.util.Iterator" %>
+<%@ page import="java.util.List" %>
+<%@ page import="org.hibernate.Session" %>
+<%@ page import="org.hibernate.Transaction" %>
+<%@ page import="org.jboss.soa.esb.samples.quickstart.hibernateaction.*" %>
+<%
+ String product = request.getParameter("product");
+ String quantString = request.getParameter("quantity");
+ String priceString = request.getParameter("price");
+
+ int quantity = Integer.parseInt(quantString);
+ float price = Float.parseFloat(priceString);
+
+ Transaction tx = null;
+ Session sess = SessionFactorySingleton.getInstance().getCurrentSession();
+ try {
+ tx = sess.beginTransaction();
+ Query q = sess.createQuery("update Order "
+ + "set product = :product, "
+ + "set quantity = :quantity, "
+ + "set price = :price");
+ q.setString("product", product);
+ q.setInteger("quantity", new Integer(quantity));
+ q.setLong("price", new Long(price));
+ q.executeUpdate();
+ tx.commit();
+ } catch (Exception e) {
+ e.printStackTrace();
+ if (tx != null && tx.isActive()) {
+ tx.rollback();
+ }
+ } finally {
+ sess.close();
+ }
+
+ response.sendRedirect(request.getContextPath() + "/list.jsp");
+%>
Modified: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/jbpm_simple1/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/jbpm_simple1/build.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/jbpm_simple1/build.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -6,6 +6,7 @@
</description>
<property name="additional.deploys" value="simpleProcessDefinition.xml"/>
+ <property name="deploy.exploded" value="true"/>
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
@@ -22,16 +23,6 @@
</copy>
</target>
- <target name="deployesb-archive-after"/>
- <target name="deployesb-archive-before"/>
-
- <target name="quickstart-specific-deploys">
- <property name="dest" location="${org.jboss.esb.server.deploy.dir}/${ant.project.name}.esb"/>
- <delete quiet="true" dir="${dest}"/>
- <mkdir dir="${dest}"/>
- <unjar src="${build.dir}/${ant.project.name}.esb" dest="${dest}"/>
- </target>
-
<target name="runtest" depends="compile"
description="run full jBPM process lifecycle test">
<echo>Configure and invoke several jbpm processors</echo>
Modified: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/simple_cbr/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/simple_cbr/build.xml 2007-06-08 06:12:44 UTC (rev 12406)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/simple_cbr/build.xml 2007-06-08 06:36:42 UTC (rev 12407)
@@ -8,20 +8,11 @@
<!-- Import the base Ant build script... -->
<import file="../conf/base-build.xml"/>
- <property name="rules.jar.name" value="${ant.project.name}_rules.jar"/>
<property name="myrules.drl" value="SimpleCBRRules.drl"/>
<property name="myrules.xpath.drl" value="SimpleCBRRules-XPath.drl"/>
<property name="additional.deploys" value=" build/classes/${myrules.drl}, build/classes/${myrules.xpath.drl}" />
- <target name="quickstart-specific-deploys">
- <echo message="jar rules to ${rules.jar.name}" />
- <jar destfile="${rules.jar.name}" basedir="${basedir}/src/services/rules" includes="*.*"/>
- <copy
- todir="build/lib"
- file="${rules.jar.name}" />
- </target>
-
<target name="config">
<copy todir="${basedir}/build/classes" >
<fileset dir="src/services/rules">
More information about the jboss-svn-commits
mailing list