[jboss-svn-commits] JBL Code SVN: r11906 - in labs/jbossesb/workspace/dbevenius/product: core/listeners/src/org/jboss/soa/esb/actions and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu May 17 04:44:29 EDT 2007
Author: beve
Date: 2007-05-17 04:44:28 -0400 (Thu, 17 May 2007)
New Revision: 11906
Added:
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ServiceInvoker.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/lib/
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar
Removed:
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar
Modified:
labs/jbossesb/workspace/dbevenius/product/build-distr.xml
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/build.xml
labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/META-INF/MANIFEST.MF
labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/src/org/jboss/soa/eclipse/wizards/ESBNewWizard.java
labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/template.jar
labs/jbossesb/workspace/dbevenius/product/tools/updatesite/features/org.jboss.soa.esb.template_1.0.0/feature.xml
labs/jbossesb/workspace/dbevenius/product/tools/updatesite/plugins/org.jboss.soa.esb.eclipse.template_1.0.0.jar
Log:
Merge from main 11887:11903
Modified: labs/jbossesb/workspace/dbevenius/product/build-distr.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/build-distr.xml 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/build-distr.xml 2007-05-17 08:44:28 UTC (rev 11906)
@@ -51,13 +51,11 @@
<include name="**/*"/>
</fileset>
</copy>
- <!--
<copy todir="${esbserver.dist.dir}/server/default/deploy">
<fileset dir="ftp/build">
<include name="ftp-server.sar/**/*"/>
</fileset>
</copy>
- -->
<copy todir="${esbserver.dist.dir}/server/default/deploy">
<fileset dir="tools/configeditor/editor/dist">
<include name="jbossesb-config-editor.war"/>
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -44,10 +44,13 @@
*/
public static Object getTaskObject(Message message)
{
- Object payload = (null==message)? null : message.getBody().get(CURRENT_OBJECT);
-
- if(payload == null) {
+ Object payload = null ;
+ if (message != null) {
+ payload = message.getBody().get(CURRENT_OBJECT);
+
+ if(payload == null) {
payload = message.getBody().getByteArray();
+ }
}
return payload;
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ServiceInvoker.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/ServiceInvoker.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ServiceInvoker.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/ServiceInvoker.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,112 @@
+/*
+* 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;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+import java.util.Collection;
+
+/**
+ * At initialization, this object looks up target EPR for a given service/category.
+ * The postMessage method invokes on a target EPR.
+ *
+ * This class is really for use with Gateways, but could be used by clients to pre-initialize a service lookup
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServiceInvoker
+{
+ private String name;
+ private String category;
+
+ private Collection<EPR> targetEprs;
+
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getCategory()
+ {
+ return category;
+ }
+
+ public void setCategory(String category)
+ {
+ this.category = category;
+ }
+
+ public void start()
+ {
+ try
+ {
+ targetEprs = RegistryUtil.getEprs(category, name);
+ }
+ catch (final RegistryException re)
+ {
+ throw new RuntimeException("Unexpected registry exception", re) ;
+ }
+
+ }
+
+ public void postMessage(Message message) throws CourierException, MalformedEPRException
+ {
+ boolean bSent = false;
+ for (EPR current : targetEprs)
+ {
+ Courier courier = CourierFactory.getCourier(current);
+ try
+ {
+ System.out.println("Trying EPR: " + current);
+ if (courier.deliver(message))
+ {
+ bSent = true;
+ break;
+ }
+ }
+ finally
+ {
+ CourierUtil.cleanCourier(courier);
+ }
+ }
+ if (!bSent)
+ {
+ String text = "Target service <" + category + "," + name + "> is not registered";
+ throw new CourierException(text);
+ }
+ }
+}
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -37,6 +37,7 @@
import org.jboss.soa.esb.listeners.message.MessageAwareListener;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.milyn.xml.DomUtils;
/**
* Mapper utility methods.
@@ -93,8 +94,17 @@
protected static void mapProperties(List<Property> properties, Element target) {
// Map the property elements to actions attributes...
for(Property property : properties) {
- target.setAttribute(property.getName(), property.getValue());
- }
+ Element propertyElement = target.getOwnerDocument().createElement("property");
+ serialize(property, propertyElement);
+ if (propertyElement.hasChildNodes())
+ {
+ DomUtils.copyChildNodes(propertyElement, target);
+ }
+ else
+ {
+ target.setAttribute(property.getName(), property.getValue());
+ }
+ }
}
/**
Modified: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -32,13 +32,10 @@
import java.util.Properties;
import java.util.Set;
-import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.MessageConsumer;
-import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueSession;
-import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.NamingException;
@@ -62,7 +59,6 @@
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.services.registry.RegistryException;
import org.jboss.soa.esb.util.ClassUtil;
@@ -72,7 +68,7 @@
* serial version uid for this class
*/
private static final long serialVersionUID = 5070422864110923930L;
-
+
public JmsGatewayListener (ConfigTree listenerConfig) throws ConfigurationException
{
super(listenerConfig) ;
@@ -80,10 +76,10 @@
checkMyParms();
} // __________________________________
-
+
/**
* Handle the initialisation of the managed instance.
- *
+ *
* @throws ManagedLifecycleException for errors while initialisation.
*/
protected void doInitialise()
@@ -99,7 +95,7 @@
{
throw new ManagedLifecycleException("Unexpected registry exception", re) ;
}
-
+
try
{
prepareMessageReceiver();
@@ -116,7 +112,7 @@
{
throw new ManagedLifecycleException("Unexpected configuration exception from prepareMessageReceiver", ce);
}
-
+
if (_serviceName != null)
{
try
@@ -129,7 +125,7 @@
}
}
}
-
+
/**
* Execute on the thread.
*/
@@ -211,7 +207,7 @@
/**
* Handle the destroy of the managed instance.
- *
+ *
* @throws ManagedLifecycleException for errors while destroying.
*/
protected void doDestroy()
@@ -221,7 +217,7 @@
{
RegistryUtil.unregister(_serviceCategory, _serviceName, _myEpr) ;
}
-
+
if (_messageReceiver != null)
{
try
@@ -230,7 +226,7 @@
}
catch (final JMSException jmse) {} // ignore
}
-
+
if (_queueSession != null)
{
_pool.closeSession(_queueSession);
@@ -239,7 +235,7 @@
/**
* Check for mandatory and optional attributes in parameter tree
- *
+ *
* @throws ConfigurationException -
* if mandatory atts are not right or actionClass not in
* classpath
@@ -287,7 +283,7 @@
_logger
.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " - Using default composer class : " + _composerName);
}
-
+
_processMethod = _composerClass.getMethod(sProcessMethod,
new Class[] { Object.class });
}
@@ -303,7 +299,7 @@
_queue = null;
Properties environment = new Properties();
-
+
String sJndiURL = _config.getAttribute(JMSEpr.JNDI_URL_TAG);
String sJndiContextFactory = _config.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
String sJndiPkgPrefix = _config.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
@@ -313,11 +309,11 @@
Set<String> names=_config.getAttributeNames();
for (String name : names) {
if (name.startsWith("java.naming.")) {
- environment.setProperty(name, _config.getAttribute(name));
+ environment.setProperty(name, _config.getAttribute(name));
}
}
Context oJndiCtx = NamingContext.getServerContext(environment);
-
+
if (null == oJndiCtx)
throw new ConfigurationException(
"Unable fo obtain jndi context <" + sJndiURL + "," + sJndiContextFactory + "," + sJndiPkgPrefix + ">");
@@ -332,15 +328,15 @@
_serviceName = _config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
_myEpr = (null == _serviceName) ? null : new JMSEpr(JMSEpr.QUEUE_TYPE,
_queueName, sFactClass, environment, _messageSelector);
-
+
_pool = JmsConnectionPoolContainer.getPool(environment, sFactClass, JMSEpr.QUEUE_TYPE);
-
+
try {
_queueSession = _pool.getQueueSession();
} catch (NamingException ne) {
throw new ConfigurationException("Failed to obtain queue session from pool", ne) ;
}
-
+
try {
_queue = (Queue) oJndiCtx.lookup(_queueName);
} catch (NamingException nex) {
@@ -358,7 +354,7 @@
/**
* Receive one message and retry if connection
- *
+ *
* @return javax.jms.Message - One input message, or null
*/
protected javax.jms.Message receiveOne ()
@@ -402,70 +398,7 @@
return null;
} // ________________________________
- /**
- * Default gateway action for plain jms messages <p/>It will just drop the
- * jms message contents into a esb Message
- *
- * @author <a
- * href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
- private static class PackageJmsMessageContents
- {
- @SuppressWarnings("unchecked")
- public Message process (Object obj) throws JMSException, IOException
- {
- if (!(obj instanceof javax.jms.Message))
- throw new IllegalArgumentException(
- "Object must be instance of javax.jms.Message");
- byte[] bytes = getMessageContent((javax.jms.Message) obj);
- if (null == bytes) return null;
-
- javax.jms.Message jmsMsg = (javax.jms.Message) obj;
- Message message = MessageFactory.getInstance().getMessage();
- message.getBody().setByteArray(getMessageContent(jmsMsg));
- Enumeration<String> EE = jmsMsg.getPropertyNames();
- if (null != EE)
- {
- while (EE.hasMoreElements())
- {
- String name = EE.nextElement();
- Object value = jmsMsg.getObjectProperty(name);
- if (null != value)
- message.getProperties().setProperty(name, value);
- }
- }
- return message;
- }
-
- private byte[] getMessageContent (javax.jms.Message jMess) throws JMSException, IOException
- {
- if (jMess instanceof TextMessage)
- return ((TextMessage) jMess).getText().getBytes();
-
- if (jMess instanceof BytesMessage)
- {
- BytesMessage jBytes = (BytesMessage) jMess;
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- byte[] ba = new byte[1000];
- int iQread;
- while (-1 != (iQread = jBytes.readBytes(ba)))
- if (iQread > 0) out.write(ba, 0, iQread);
- out.close();
- return out.toByteArray();
- }
-
- if (jMess instanceof ObjectMessage)
- return ((ObjectMessage) jMess).getObject().toString()
- .getBytes();
- _logger
- .warn("Message type " + jMess.getClass().getSimpleName() + " not supported - Message is ignored");
- return null;
- }
- } // ____________________________________________________
-
- protected final static Logger _logger = Logger
+ protected final static Logger _logger = Logger
.getLogger(JmsGatewayListener.class);
protected String _queueName;
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,96 @@
+/*
+* 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 org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+import javax.jms.JMSException;
+import javax.jms.TextMessage;
+import javax.jms.BytesMessage;
+import javax.jms.ObjectMessage;
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.util.Enumeration;
+
+/**
+ * Default gateway action for plain jms messages <p/>It will just drop the
+* jms message contents into a esb Message
+*
+* @author <a
+* href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+* @since Version 4.0
+*
+*/
+public class PackageJmsMessageContents
+{
+ @SuppressWarnings("unchecked")
+ public Message process (Object obj) throws JMSException, IOException
+ {
+ if (!(obj instanceof javax.jms.Message))
+ throw new IllegalArgumentException(
+ "Object must be instance of javax.jms.Message");
+ byte[] bytes = getMessageContent((javax.jms.Message) obj);
+ if (null == bytes) return null;
+
+ javax.jms.Message jmsMsg = (javax.jms.Message) obj;
+ Message message = MessageFactory.getInstance().getMessage();
+ message.getBody().setContents(getMessageContent(jmsMsg));
+ Enumeration<String> EE = jmsMsg.getPropertyNames();
+ if (null != EE)
+ {
+ while (EE.hasMoreElements())
+ {
+ String name = EE.nextElement();
+ Object value = jmsMsg.getObjectProperty(name);
+ if (null != value)
+ message.getProperties().setProperty(name, value);
+ }
+ }
+ return message;
+ }
+
+ private byte[] getMessageContent (javax.jms.Message jMess) throws JMSException, IOException
+ {
+ if (jMess instanceof TextMessage)
+ return ((TextMessage) jMess).getText().getBytes();
+
+ if (jMess instanceof BytesMessage)
+ {
+ BytesMessage jBytes = (BytesMessage) jMess;
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ byte[] ba = new byte[1000];
+ int iQread;
+ while (-1 != (iQread = jBytes.readBytes(ba)))
+ if (iQread > 0) out.write(ba, 0, iQread);
+ out.close();
+ return out.toByteArray();
+ }
+
+ if (jMess instanceof ObjectMessage)
+ return ((ObjectMessage) jMess).getObject().toString()
+ .getBytes();
+ JmsGatewayListener._logger
+ .warn("Message type " + jMess.getClass().getSimpleName() + " not supported - Message is ignored");
+ return null;
+ }
+} // ____________________________________________________
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca)
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,46 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import java.util.Map;
-
-/**
- * Bridges different vendor JCA implementations to activate an endpoint
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface ActivationBridge
-{
- void setAdapter(String adapter);
-
- void setMessagingTypeClass(Class messagingTypeClass);
-
- void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory);
-
- void setActivationProperties(Map<String, String> activationProperties);
-
- void activate();
-
- void deactivate();
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,46 @@
+/*
+* 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.jca;
+
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import java.util.Map;
+
+/**
+ * Bridges different vendor JCA implementations to activate an endpoint
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ActivationBridge
+{
+ void setAdapter(String adapter);
+
+ void setMessagingTypeClass(Class messagingTypeClass);
+
+ void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory);
+
+ void setActivationProperties(Map<String, String> activationProperties);
+
+ void activate();
+
+ void deactivate();
+}
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,44 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import java.lang.reflect.Method;
-
-/**
- * Contract between JCA and endpoint. Instances of this object are used by the message endpoint factory and endopint proxy
- * to obtain whether delivery is transacted and to invoke on the actual endpoint bean
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface EndpointContainer
-{
- /**
- * description used for logging and tracing
- */
- public String getDescription();
-
- public Object invoke(Method method, Object[] args) throws Throwable;
-
- public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException;
-
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,44 @@
+/*
+* 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.jca;
+
+import java.lang.reflect.Method;
+
+/**
+ * Contract between JCA and endpoint. Instances of this object are used by the message endpoint factory and endopint proxy
+ * to obtain whether delivery is transacted and to invoke on the actual endpoint bean
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface EndpointContainer
+{
+ /**
+ * description used for logging and tracing
+ */
+ public String getDescription();
+
+ public Object invoke(Method method, Object[] args) throws Throwable;
+
+ public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException;
+
+}
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,107 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import javax.resource.spi.UnavailableException;
-import javax.resource.spi.endpoint.MessageEndpoint;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.xa.XAResource;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class EndpointFactory implements MessageEndpointFactory
-{
- private EndpointContainer container;
- private Class messagingType;
- private ClassLoader loader;
-
- private Constructor proxyConstructor;
-
-
- public EndpointContainer getContainer()
- {
- return container;
- }
-
- public void setContainer(EndpointContainer container)
- {
- this.container = container;
- }
-
-
- public void setMessagingType(Class messagingType)
- {
- this.messagingType = messagingType;
- }
-
- public void setLoader(ClassLoader loader)
- {
- this.loader = loader;
- }
-
- public void start()
- {
- Class[] interfaces = {messagingType, MessageEndpoint.class};
- Class proxyClass = Proxy.getProxyClass(loader, interfaces);
- final Class[] constructorParams = {InvocationHandler.class};
- try
- {
- proxyConstructor = proxyClass.getConstructor(constructorParams);
- }
- catch (NoSuchMethodException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
- {
- EndpointProxy proxy = new EndpointProxy();
- proxy.setXaResource(xaResource);
- proxy.setMessageEndpointFactory(this);
- proxy.setContainer(container);
- proxy.setLoader(loader);
- Object[] args = {proxy};
- try
- {
- return (MessageEndpoint) proxyConstructor.newInstance(args);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- return null;
- }
- }
-
- public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
- {
- return container.isDeliveryTransacted(method);
- }
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,107 @@
+/*
+* 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.jca;
+
+import javax.resource.spi.UnavailableException;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.xa.XAResource;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class EndpointFactory implements MessageEndpointFactory
+{
+ private EndpointContainer container;
+ private Class messagingType;
+ private ClassLoader loader;
+
+ private Constructor proxyConstructor;
+
+
+ public EndpointContainer getContainer()
+ {
+ return container;
+ }
+
+ public void setContainer(EndpointContainer container)
+ {
+ this.container = container;
+ }
+
+
+ public void setMessagingType(Class messagingType)
+ {
+ this.messagingType = messagingType;
+ }
+
+ public void setLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ public void start()
+ {
+ Class[] interfaces = {messagingType, MessageEndpoint.class};
+ Class proxyClass = Proxy.getProxyClass(loader, interfaces);
+ final Class[] constructorParams = {InvocationHandler.class};
+ try
+ {
+ proxyConstructor = proxyClass.getConstructor(constructorParams);
+ }
+ catch (NoSuchMethodException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
+ {
+ EndpointProxy proxy = new EndpointProxy();
+ proxy.setXaResource(xaResource);
+ proxy.setMessageEndpointFactory(this);
+ proxy.setContainer(container);
+ proxy.setLoader(loader);
+ Object[] args = {proxy};
+ try
+ {
+ return (MessageEndpoint) proxyConstructor.newInstance(args);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
+ {
+ return container.isDeliveryTransacted(method);
+ }
+}
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,438 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
-import org.jboss.logging.Logger;
-import org.jboss.tm.TransactionManagerLocator;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.Status;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAResource;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class EndpointProxy implements InvocationHandler
-{
- private static final Logger log = Logger.getLogger(EndpointProxy.class);
-
- /**
- * Whether trace is enabled
- */
- private boolean trace = log.isTraceEnabled();
-
- /**
- * Whether this proxy has been released
- */
- protected SynchronizedBoolean released = new SynchronizedBoolean(false);
-
- /**
- * Whether we have delivered a message
- */
- protected boolean delivered = false;
-
- /**
- * The in use thread
- */
- protected Thread inUseThread = null;
-
- /**
- * The old classloader of the thread
- */
- protected ClassLoader oldClassLoader = null;
-
- /**
- * Any transaction we started
- */
- protected Transaction transaction = null;
-
- /**
- * Any suspended transaction
- */
- protected Transaction suspended = null;
-
- protected ClassLoader loader;
-
- private XAResource resource;
- private MessageEndpointFactory messageEndpointFactory;
- private EndpointContainer container;
-
-
- public void setContainer(EndpointContainer container)
- {
- this.container = container;
- }
-
- public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
- {
- this.messageEndpointFactory = messageEndpointFactory;
- }
-
- public void setXaResource(XAResource resource)
- {
- this.resource = resource;
- }
-
-
- public void setLoader(ClassLoader loader)
- {
- this.loader = loader;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Throwable
- {
- // Are we still useable?
- if (released.get())
- throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " has been released");
-
- // Concurrent invocation?
- Thread currentThread = Thread.currentThread();
- if (inUseThread != null && inUseThread.equals(currentThread) == false)
- throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " is already in use by another thread " + inUseThread);
- inUseThread = currentThread;
-
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " in use by " + method + " " + inUseThread);
-
- // Which operation?
- if (method.getName().equals("release"))
- {
- release(proxy);
- return null;
- }
- else if (method.getName().equals("beforeDelivery"))
- {
- before(proxy, method, args);
- return null;
- }
- else if (method.getName().equals("afterDelivery"))
- {
- after(proxy);
- return null;
- }
- else
- return delivery(proxy, method, args);
- }
-
- // -----------------------------------------------------------
-
- protected void release(Object proxy) throws Throwable
- {
- // We are now released
- released.set(true);
-
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
-
- // Tidyup any outstanding delivery
- if (oldClassLoader != null)
- {
- try
- {
- finish("release", proxy, false);
- }
- catch (Throwable t)
- {
- log.warn("Error in release ", t);
- }
- }
- }
-
- protected void before(Object proxy, Method method, Object[] args) throws Throwable
- {
- // Called out of sequence
- if (oldClassLoader != null)
- throw new IllegalStateException("Missing afterDelivery from the previous beforeDelivery for message endpoint " + getProxyString(proxy));
-
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
-
- // Set the classloader
- oldClassLoader = inUseThread.getContextClassLoader();
- inUseThread.setContextClassLoader(loader);
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " set context classloader to " + loader);
-
- // start any transaction
- try
- {
- // Is the delivery transacted?
- Method beforeMethod = (Method) args[0];
- boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(beforeMethod);
-
- startTransaction("beforeDelivery", proxy, method, args, isTransacted);
- }
- catch (Throwable t)
- {
- resetContextClassLoader(proxy);
- throw new ResourceException(t);
- }
- }
-
- protected void after(Object proxy) throws Throwable
- {
- // Called out of sequence
- if (oldClassLoader == null)
- throw new IllegalStateException("afterDelivery without a previous beforeDelivery for message endpoint " + getProxyString(proxy));
-
- // Finish this delivery committing if we can
- try
- {
- finish("afterDelivery", proxy, true);
- }
- catch (Throwable t)
- {
- throw new ResourceException(t);
- }
- }
-
- protected Object delivery(Object proxy, Method method, Object[] args) throws Throwable
- {
- // Have we already delivered a message?
- if (delivered)
- throw new IllegalStateException("Multiple message delivery between before and after delivery is not allowed for message endpoint " + getProxyString(proxy));
-
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " delivering");
-
- // Mark delivery if beforeDelivery was invoked
- if (oldClassLoader != null)
- delivered = true;
-
- boolean commit = true;
- try
- {
- // Check for starting a transaction
- if (oldClassLoader == null)
- {
- boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(method);
- startTransaction("delivery", proxy, method, args, isTransacted);
- }
- return container.invoke(method, args);
- }
- catch (Throwable t)
- {
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " delivery error", t);
- if (t instanceof Error || t instanceof RuntimeException)
- {
- if (transaction != null)
- transaction.setRollbackOnly();
- commit = false;
- }
- throw t;
- }
- finally
- {
- // No before/after delivery, end any transaction and release the lock
- if (oldClassLoader == null)
- {
- try
- {
- // Finish any transaction we started
- endTransaction(proxy, commit);
- }
- finally
- {
- releaseThreadLock(proxy);
- }
- }
- }
- }
-
- protected void finish(String context, Object proxy, boolean commit) throws Throwable
- {
- try
- {
- endTransaction(proxy, commit);
- }
- finally
- {
- // Reset delivered flag
- delivered = false;
- // Change back to the original context classloader
- resetContextClassLoader(proxy);
- // We no longer hold the lock
- releaseThreadLock(proxy);
- }
- }
-
- protected void startTransaction(String context, Object proxy, Method m, Object[] args, boolean isTransacted) throws Throwable
- {
- Method method;
-
- // Normal delivery
- if ("delivery".equals(context))
- method = m;
- // Before delivery
- else
- method = (Method) args[0];
-
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " method=" + method + " xaResource=" + resource + " transacted=" + isTransacted);
-
- // Get the transaction status
- TransactionManager tm = TransactionManagerLocator.getInstance().locate();
- suspended = tm.suspend();
-
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " currentTx=" + suspended);
-
- // Delivery is transacted
- if (isTransacted)
- {
- // No transaction means we start a new transaction and enlist the resource
- if (suspended == null)
- {
- tm.begin();
- transaction = tm.getTransaction();
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " started transaction=" + transaction);
-
- // Enlist the XAResource in the transaction
- if (resource != null)
- {
- transaction.enlistResource(resource);
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " enlisted=" + resource);
- }
- }
- else
- {
- // If there is already a transaction we ignore the XAResource (by spec 12.5.9)
- try
- {
- tm.resume(suspended);
- }
- finally
- {
- suspended = null;
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " transaction=" + suspended + " already active, IGNORED=" + resource);
- }
- }
- }
- }
-
- protected void endTransaction(Object proxy, boolean commit) throws Throwable
- {
- TransactionManager tm = null;
- Transaction currentTx = null;
- try
- {
- // If we started the transaction, commit it
- if (transaction != null)
- {
- tm = TransactionManagerLocator.getInstance().locate();
- currentTx = tm.getTransaction();
-
- // Suspend any bad transaction - there is bug somewhere, but we will try to tidy things up
- if (currentTx != null && currentTx.equals(transaction) == false)
- {
- log.warn("Current transaction " + currentTx + " is not the expected transaction.");
- tm.suspend();
- tm.resume(transaction);
- }
- else
- {
- // We have the correct transaction
- currentTx = null;
- }
-
- // Commit or rollback depending on the status
- if (commit == false || transaction.getStatus() == Status.STATUS_MARKED_ROLLBACK)
- {
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " rollback");
- tm.rollback();
- }
- else
- {
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " commit");
- tm.commit();
- }
- }
-
- // If we suspended the incoming transaction, resume it
- if (suspended != null)
- {
- try
- {
- tm = TransactionManagerLocator.getInstance().locate();
- tm.resume(suspended);
- }
- finally
- {
- suspended = null;
- }
- }
- }
- finally
- {
- // Resume any suspended transaction
- if (currentTx != null)
- {
- try
- {
- tm.resume(currentTx);
- }
- catch (Throwable t)
- {
- log.warn("MessageEndpoint " + getProxyString(proxy) + " failed to resume old transaction " + currentTx);
-
- }
- }
- }
- }
-
- protected void resetContextClassLoader(Object proxy)
- {
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " reset classloader " + oldClassLoader);
- inUseThread.setContextClassLoader(oldClassLoader);
- oldClassLoader = null;
- }
-
- protected void releaseThreadLock(Object proxy)
- {
- if (trace)
- log.trace("MessageEndpoint " + getProxyString(proxy) + " no longer in use by " + inUseThread);
- inUseThread = null;
- }
-
- protected String getProxyString(Object proxy)
- {
- return container.getDescription();
- }
-
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,438 @@
+/*
+* 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.jca;
+
+import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
+import org.jboss.logging.Logger;
+import org.jboss.tm.TransactionManagerLocator;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.Status;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class EndpointProxy implements InvocationHandler
+{
+ private static final Logger log = Logger.getLogger(EndpointProxy.class);
+
+ /**
+ * Whether trace is enabled
+ */
+ private boolean trace = log.isTraceEnabled();
+
+ /**
+ * Whether this proxy has been released
+ */
+ protected SynchronizedBoolean released = new SynchronizedBoolean(false);
+
+ /**
+ * Whether we have delivered a message
+ */
+ protected boolean delivered = false;
+
+ /**
+ * The in use thread
+ */
+ protected Thread inUseThread = null;
+
+ /**
+ * The old classloader of the thread
+ */
+ protected ClassLoader oldClassLoader = null;
+
+ /**
+ * Any transaction we started
+ */
+ protected Transaction transaction = null;
+
+ /**
+ * Any suspended transaction
+ */
+ protected Transaction suspended = null;
+
+ protected ClassLoader loader;
+
+ private XAResource resource;
+ private MessageEndpointFactory messageEndpointFactory;
+ private EndpointContainer container;
+
+
+ public void setContainer(EndpointContainer container)
+ {
+ this.container = container;
+ }
+
+ public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
+ {
+ this.messageEndpointFactory = messageEndpointFactory;
+ }
+
+ public void setXaResource(XAResource resource)
+ {
+ this.resource = resource;
+ }
+
+
+ public void setLoader(ClassLoader loader)
+ {
+ this.loader = loader;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable
+ {
+ // Are we still useable?
+ if (released.get())
+ throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " has been released");
+
+ // Concurrent invocation?
+ Thread currentThread = Thread.currentThread();
+ if (inUseThread != null && inUseThread.equals(currentThread) == false)
+ throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " is already in use by another thread " + inUseThread);
+ inUseThread = currentThread;
+
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " in use by " + method + " " + inUseThread);
+
+ // Which operation?
+ if (method.getName().equals("release"))
+ {
+ release(proxy);
+ return null;
+ }
+ else if (method.getName().equals("beforeDelivery"))
+ {
+ before(proxy, method, args);
+ return null;
+ }
+ else if (method.getName().equals("afterDelivery"))
+ {
+ after(proxy);
+ return null;
+ }
+ else
+ return delivery(proxy, method, args);
+ }
+
+ // -----------------------------------------------------------
+
+ protected void release(Object proxy) throws Throwable
+ {
+ // We are now released
+ released.set(true);
+
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
+
+ // Tidyup any outstanding delivery
+ if (oldClassLoader != null)
+ {
+ try
+ {
+ finish("release", proxy, false);
+ }
+ catch (Throwable t)
+ {
+ log.warn("Error in release ", t);
+ }
+ }
+ }
+
+ protected void before(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ // Called out of sequence
+ if (oldClassLoader != null)
+ throw new IllegalStateException("Missing afterDelivery from the previous beforeDelivery for message endpoint " + getProxyString(proxy));
+
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
+
+ // Set the classloader
+ oldClassLoader = inUseThread.getContextClassLoader();
+ inUseThread.setContextClassLoader(loader);
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " set context classloader to " + loader);
+
+ // start any transaction
+ try
+ {
+ // Is the delivery transacted?
+ Method beforeMethod = (Method) args[0];
+ boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(beforeMethod);
+
+ startTransaction("beforeDelivery", proxy, method, args, isTransacted);
+ }
+ catch (Throwable t)
+ {
+ resetContextClassLoader(proxy);
+ throw new ResourceException(t);
+ }
+ }
+
+ protected void after(Object proxy) throws Throwable
+ {
+ // Called out of sequence
+ if (oldClassLoader == null)
+ throw new IllegalStateException("afterDelivery without a previous beforeDelivery for message endpoint " + getProxyString(proxy));
+
+ // Finish this delivery committing if we can
+ try
+ {
+ finish("afterDelivery", proxy, true);
+ }
+ catch (Throwable t)
+ {
+ throw new ResourceException(t);
+ }
+ }
+
+ protected Object delivery(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ // Have we already delivered a message?
+ if (delivered)
+ throw new IllegalStateException("Multiple message delivery between before and after delivery is not allowed for message endpoint " + getProxyString(proxy));
+
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " delivering");
+
+ // Mark delivery if beforeDelivery was invoked
+ if (oldClassLoader != null)
+ delivered = true;
+
+ boolean commit = true;
+ try
+ {
+ // Check for starting a transaction
+ if (oldClassLoader == null)
+ {
+ boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(method);
+ startTransaction("delivery", proxy, method, args, isTransacted);
+ }
+ return container.invoke(method, args);
+ }
+ catch (Throwable t)
+ {
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " delivery error", t);
+ if (t instanceof Error || t instanceof RuntimeException)
+ {
+ if (transaction != null)
+ transaction.setRollbackOnly();
+ commit = false;
+ }
+ throw t;
+ }
+ finally
+ {
+ // No before/after delivery, end any transaction and release the lock
+ if (oldClassLoader == null)
+ {
+ try
+ {
+ // Finish any transaction we started
+ endTransaction(proxy, commit);
+ }
+ finally
+ {
+ releaseThreadLock(proxy);
+ }
+ }
+ }
+ }
+
+ protected void finish(String context, Object proxy, boolean commit) throws Throwable
+ {
+ try
+ {
+ endTransaction(proxy, commit);
+ }
+ finally
+ {
+ // Reset delivered flag
+ delivered = false;
+ // Change back to the original context classloader
+ resetContextClassLoader(proxy);
+ // We no longer hold the lock
+ releaseThreadLock(proxy);
+ }
+ }
+
+ protected void startTransaction(String context, Object proxy, Method m, Object[] args, boolean isTransacted) throws Throwable
+ {
+ Method method;
+
+ // Normal delivery
+ if ("delivery".equals(context))
+ method = m;
+ // Before delivery
+ else
+ method = (Method) args[0];
+
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " method=" + method + " xaResource=" + resource + " transacted=" + isTransacted);
+
+ // Get the transaction status
+ TransactionManager tm = TransactionManagerLocator.getInstance().locate();
+ suspended = tm.suspend();
+
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " currentTx=" + suspended);
+
+ // Delivery is transacted
+ if (isTransacted)
+ {
+ // No transaction means we start a new transaction and enlist the resource
+ if (suspended == null)
+ {
+ tm.begin();
+ transaction = tm.getTransaction();
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " started transaction=" + transaction);
+
+ // Enlist the XAResource in the transaction
+ if (resource != null)
+ {
+ transaction.enlistResource(resource);
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " enlisted=" + resource);
+ }
+ }
+ else
+ {
+ // If there is already a transaction we ignore the XAResource (by spec 12.5.9)
+ try
+ {
+ tm.resume(suspended);
+ }
+ finally
+ {
+ suspended = null;
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " transaction=" + suspended + " already active, IGNORED=" + resource);
+ }
+ }
+ }
+ }
+
+ protected void endTransaction(Object proxy, boolean commit) throws Throwable
+ {
+ TransactionManager tm = null;
+ Transaction currentTx = null;
+ try
+ {
+ // If we started the transaction, commit it
+ if (transaction != null)
+ {
+ tm = TransactionManagerLocator.getInstance().locate();
+ currentTx = tm.getTransaction();
+
+ // Suspend any bad transaction - there is bug somewhere, but we will try to tidy things up
+ if (currentTx != null && currentTx.equals(transaction) == false)
+ {
+ log.warn("Current transaction " + currentTx + " is not the expected transaction.");
+ tm.suspend();
+ tm.resume(transaction);
+ }
+ else
+ {
+ // We have the correct transaction
+ currentTx = null;
+ }
+
+ // Commit or rollback depending on the status
+ if (commit == false || transaction.getStatus() == Status.STATUS_MARKED_ROLLBACK)
+ {
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " rollback");
+ tm.rollback();
+ }
+ else
+ {
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " commit");
+ tm.commit();
+ }
+ }
+
+ // If we suspended the incoming transaction, resume it
+ if (suspended != null)
+ {
+ try
+ {
+ tm = TransactionManagerLocator.getInstance().locate();
+ tm.resume(suspended);
+ }
+ finally
+ {
+ suspended = null;
+ }
+ }
+ }
+ finally
+ {
+ // Resume any suspended transaction
+ if (currentTx != null)
+ {
+ try
+ {
+ tm.resume(currentTx);
+ }
+ catch (Throwable t)
+ {
+ log.warn("MessageEndpoint " + getProxyString(proxy) + " failed to resume old transaction " + currentTx);
+
+ }
+ }
+ }
+ }
+
+ protected void resetContextClassLoader(Object proxy)
+ {
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " reset classloader " + oldClassLoader);
+ inUseThread.setContextClassLoader(oldClassLoader);
+ oldClassLoader = null;
+ }
+
+ protected void releaseThreadLock(Object proxy)
+ {
+ if (trace)
+ log.trace("MessageEndpoint " + getProxyString(proxy) + " no longer in use by " + inUseThread);
+ inUseThread = null;
+ }
+
+ protected String getProxyString(Object proxy)
+ {
+ return container.getDescription();
+ }
+
+}
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,38 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import org.jboss.soa.esb.listeners.ServiceInvoker;
-
-/**
- * Required interface for JCA ESB Gateways
- * <p/>
- * The injected ServiceInvoker should be used by the user object to invoke on target ESB service after, of course,
- * it transforms the incoming gateway message into a generic ESB message
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface InflowGateway
-{
- public void setServiceInvoker(ServiceInvoker invoker);
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,38 @@
+/*
+* 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.jca;
+
+import org.jboss.soa.esb.listeners.ServiceInvoker;
+
+/**
+ * Required interface for JCA ESB Gateways
+ * <p/>
+ * The injected ServiceInvoker should be used by the user object to invoke on target ESB service after, of course,
+ * it transforms the incoming gateway message into a generic ESB message
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface InflowGateway
+{
+ public void setServiceInvoker(ServiceInvoker invoker);
+}
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,165 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import org.apache.log4j.Logger;
-import org.jboss.metadata.ActivationConfigPropertyMetaData;
-import org.jboss.mx.util.JMXExceptionDecoder;
-import org.jboss.mx.util.MBeanServerLocator;
-
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.resource.spi.ActivationSpec;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * interfaces with JCA to activate an endpoint
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JBoss42ActivationBridge implements ActivationBridge
-{
- private static Logger logger = Logger.getLogger(JBoss42ActivationBridge.class);
-
- /**
- * The signature for createActivationSpec
- */
- protected static final String[] createActivationSpecSig = new String[]
- {
- Class.class.getName(),
- Collection.class.getName()
- };
-
- /**
- * The signature for activate/deactivateEndpint
- */
- protected static final String[] activationSig = new String[]
- {
- MessageEndpointFactory.class.getName(),
- ActivationSpec.class.getName()
- };
-
- private String adapter;
- private Class messagingTypeClass;
- private MessageEndpointFactory messageEndpointFactory;
- private Map<String, String> activationProperties;
-
-
- private ActivationSpec activationSpec;
- private MBeanServer mbeanServer;
- private ObjectName resourceAdapterObjectName;
-
-
- public void setAdapter(String adapter)
- {
- this.adapter = adapter;
- }
-
- public void setMessagingTypeClass(Class messagingTypeClass)
- {
- this.messagingTypeClass = messagingTypeClass;
- }
-
- public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
- {
- this.messageEndpointFactory = messageEndpointFactory;
- }
-
- public void setActivationProperties(Map<String, String> activationProperties)
- {
- this.activationProperties = activationProperties;
- }
-
- public void activate()
- {
- mbeanServer = MBeanServerLocator.locateJBoss();
- try
- {
- resourceAdapterObjectName = new ObjectName("jboss.jca:service=RARDeployment,name='" + adapter + "'");
- }
- catch (MalformedObjectNameException e)
- {
- throw new RuntimeException("Unable to create JMX ObjectName to register adapter: " + adapter, e);
- }
-
- ArrayList<ActivationConfigPropertyMetaData> metaData = new ArrayList<ActivationConfigPropertyMetaData>();
- for (String key : activationProperties.keySet())
- {
- String value = activationProperties.get(key);
- metaData.add(new ActivationConfigPropertyMetaData(key, value));
- }
-
- Object[] params = new Object[]
- {
- messagingTypeClass,
- metaData
- };
- try
- {
- activationSpec = (ActivationSpec) mbeanServer.invoke(resourceAdapterObjectName, "createActivationSpec", params, createActivationSpecSig);
- }
- catch (Throwable t)
- {
- t = JMXExceptionDecoder.decode(t);
- throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
- " activationSpec=" + activationSpec, t);
- }
-
- params = new Object[]{messageEndpointFactory, activationSpec};
- try
- {
- mbeanServer.invoke(resourceAdapterObjectName, "endpointActivation", params, activationSig);
- }
- catch (Throwable t)
- {
- t = JMXExceptionDecoder.decode(t);
- throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
- " activationSpec=" + activationSpec, t);
- }
-
-
- }
-
- /**
- * Deactivate
- */
- public void deactivate()
- {
- Object[] params = new Object[]{messageEndpointFactory, activationSpec};
- try
- {
- mbeanServer.invoke(resourceAdapterObjectName, "endpointDeactivation", params, activationSig);
- }
- catch (Throwable t)
- {
- t = JMXExceptionDecoder.decode(t);
- logger.warn("Endpoint activation failed ra=" + resourceAdapterObjectName +
- " activationSpec=" + activationSpec, t);
- }
- }
-
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,165 @@
+/*
+* 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.jca;
+
+import org.apache.log4j.Logger;
+import org.jboss.metadata.ActivationConfigPropertyMetaData;
+import org.jboss.mx.util.JMXExceptionDecoder;
+import org.jboss.mx.util.MBeanServerLocator;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * interfaces with JCA to activate an endpoint
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBoss42ActivationBridge implements ActivationBridge
+{
+ private static Logger logger = Logger.getLogger(JBoss42ActivationBridge.class);
+
+ /**
+ * The signature for createActivationSpec
+ */
+ protected static final String[] createActivationSpecSig = new String[]
+ {
+ Class.class.getName(),
+ Collection.class.getName()
+ };
+
+ /**
+ * The signature for activate/deactivateEndpint
+ */
+ protected static final String[] activationSig = new String[]
+ {
+ MessageEndpointFactory.class.getName(),
+ ActivationSpec.class.getName()
+ };
+
+ private String adapter;
+ private Class messagingTypeClass;
+ private MessageEndpointFactory messageEndpointFactory;
+ private Map<String, String> activationProperties;
+
+
+ private ActivationSpec activationSpec;
+ private MBeanServer mbeanServer;
+ private ObjectName resourceAdapterObjectName;
+
+
+ public void setAdapter(String adapter)
+ {
+ this.adapter = adapter;
+ }
+
+ public void setMessagingTypeClass(Class messagingTypeClass)
+ {
+ this.messagingTypeClass = messagingTypeClass;
+ }
+
+ public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
+ {
+ this.messageEndpointFactory = messageEndpointFactory;
+ }
+
+ public void setActivationProperties(Map<String, String> activationProperties)
+ {
+ this.activationProperties = activationProperties;
+ }
+
+ public void activate()
+ {
+ mbeanServer = MBeanServerLocator.locateJBoss();
+ try
+ {
+ resourceAdapterObjectName = new ObjectName("jboss.jca:service=RARDeployment,name='" + adapter + "'");
+ }
+ catch (MalformedObjectNameException e)
+ {
+ throw new RuntimeException("Unable to create JMX ObjectName to register adapter: " + adapter, e);
+ }
+
+ ArrayList<ActivationConfigPropertyMetaData> metaData = new ArrayList<ActivationConfigPropertyMetaData>();
+ for (String key : activationProperties.keySet())
+ {
+ String value = activationProperties.get(key);
+ metaData.add(new ActivationConfigPropertyMetaData(key, value));
+ }
+
+ Object[] params = new Object[]
+ {
+ messagingTypeClass,
+ metaData
+ };
+ try
+ {
+ activationSpec = (ActivationSpec) mbeanServer.invoke(resourceAdapterObjectName, "createActivationSpec", params, createActivationSpecSig);
+ }
+ catch (Throwable t)
+ {
+ t = JMXExceptionDecoder.decode(t);
+ throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
+ " activationSpec=" + activationSpec, t);
+ }
+
+ params = new Object[]{messageEndpointFactory, activationSpec};
+ try
+ {
+ mbeanServer.invoke(resourceAdapterObjectName, "endpointActivation", params, activationSig);
+ }
+ catch (Throwable t)
+ {
+ t = JMXExceptionDecoder.decode(t);
+ throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
+ " activationSpec=" + activationSpec, t);
+ }
+
+
+ }
+
+ /**
+ * Deactivate
+ */
+ public void deactivate()
+ {
+ Object[] params = new Object[]{messageEndpointFactory, activationSpec};
+ try
+ {
+ mbeanServer.invoke(resourceAdapterObjectName, "endpointDeactivation", params, activationSig);
+ }
+ catch (Throwable t)
+ {
+ t = JMXExceptionDecoder.decode(t);
+ logger.warn("Endpoint activation failed ra=" + resourceAdapterObjectName +
+ " activationSpec=" + activationSpec, t);
+ }
+ }
+
+}
Deleted: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java 2007-05-17 08:07:31 UTC (rev 11903)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -1,241 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.soa.esb.listeners.jca;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ServiceInvoker;
-
-import java.util.HashMap;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JcaInflowGateway extends AbstractThreadedManagedLifecycle
-{
- private static final long serialVersionUID = 1L;
- private static Logger logger = Logger.getLogger(JcaInflowGateway.class);
- private HashMap<String, String> activationSpec = new HashMap<String, String>();
- private ClassLoader classLoader;
- private Class beanClass;
- private Class messagingType;
- private ActivationBridge bridge;
- private String adapter;
- private String serviceName;
- private String serviceCategory;
- private boolean isTransacted = true;
- private InflowGateway bean;
-
- public JcaInflowGateway(ConfigTree config) throws ConfigurationException
- {
- super(config);
- //System.out.println("CONFIG: " + config);
-
- serviceCategory = ListenerUtil.obtainAtt(config,
- ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
- serviceName = ListenerUtil.obtainAtt(config,
- ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
-
- ConfigTree spec = config.getFirstChild("activation-config");
- for (ConfigTree configProperty : spec.getChildren("activation-config-property"))
- {
- String name = configProperty.getFirstTextChild("activation-config-property-name").trim();
- String value = configProperty.getFirstTextChild("activation-config-property-value").trim();
- activationSpec.put(name, value);
- }
-
- this.classLoader = Thread.currentThread().getContextClassLoader();
- adapter = config.getAttribute("adapter");
-
- String bc = config.getAttribute("endpointClass");
- if (bc == null) throw new ConfigurationException("endpointClass attribute is required for Jca Gateway");
- try
- {
- beanClass = classLoader.loadClass(bc);
- }
- catch (ClassNotFoundException e)
- {
- throw new ConfigurationException("Unable to load Jca Gateway endpointClass: " + bc, e);
- }
- if (!InflowGateway.class.isAssignableFrom(beanClass))
- throw new ConfigurationException("endpointClass must implement InflowGateway interface");
- String mt = config.getAttribute("messagingType");
- if (mt != null)
- {
- try
- {
- messagingType = classLoader.loadClass(mt);
- }
- catch (ClassNotFoundException e)
- {
- throw new ConfigurationException("Unable to load Jca Gateway messagingType: " + mt, e);
- }
- }
- else
- {
- messagingType = findMessagingType(beanClass);
- }
-
- String brdg = config.getAttribute("jcaBridge");
- if (brdg != null)
- {
- try
- {
- bridge = (ActivationBridge) classLoader.loadClass(mt).newInstance();
- }
- catch (Exception e)
- {
- throw new ConfigurationException("Unable to load jcaBridge: " + brdg, e);
- }
- }
- else
- {
- bridge = new JBoss42ActivationBridge();
- }
- String transacted = config.getAttribute("transacted");
- if (transacted != null) isTransacted = Boolean.parseBoolean(transacted.trim());
-
- }
-
- public static Class findMessagingType(Class clazz)
- throws ConfigurationException
- {
- if (clazz.equals(Object.class)) return null;
-
- Class[] interfaces = clazz.getInterfaces();
- Class type = null;
- for (Class intf : interfaces)
- {
- if (intf.equals(InflowGateway.class)) continue;
- if (type != null)
- {
- throw new ConfigurationException("Unable to guess messagingType interface from endpointClass as the base class implements too many interfaces, specify this explicity");
- }
- type = intf;
- }
- if (type == null) return findMessagingType(clazz.getSuperclass());
- return type;
- }
-
-
- protected void doInitialise() throws ManagedLifecycleException
- {
- try
- {
- Constructor beanClassConstructor = beanClass.getConstructor(ConfigTree.class);
- try
- {
- bean = (InflowGateway)beanClassConstructor.newInstance(getConfig());
- }
- catch (InstantiationException e)
- {
- throw new RuntimeException("Unable to create endpoint bean", e);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException("Unable to create endpoint bean", e);
- }
- catch (InvocationTargetException e)
- {
- throw new RuntimeException("Unable to create endpoint bean", e.getTargetException());
- }
- }
- catch (NoSuchMethodException e)
- {
- try
- {
- bean = (InflowGateway)beanClass.newInstance();
- }
- catch (Exception e1)
- {
- throw new RuntimeException("Unable to create endpoint bean", e1);
- }
- }
- final Object theBean = bean;
- EndpointContainer container = new EndpointContainer()
- {
-
- public String getDescription()
- {
- return "category: " + serviceCategory + " service: " + serviceName + " jca adapter: " + adapter;
- }
-
- public Object invoke(Method method, Object[] args) throws Throwable
- {
- try
- {
- return method.invoke(theBean, args);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException(e);
- }
- catch (InvocationTargetException e)
- {
- throw e.getTargetException();
- }
- }
-
- public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
- {
- return isTransacted;
- }
- };
-
-
- EndpointFactory mef = new EndpointFactory();
- mef.setContainer(container);
- mef.setLoader(classLoader);
- mef.setMessagingType(messagingType);
- mef.start();
- bridge.setActivationProperties(activationSpec);
- bridge.setAdapter(adapter);
- bridge.setMessageEndpointFactory(mef);
- bridge.setMessagingTypeClass(messagingType);
- }
-
- protected void doRun()
- {
- ServiceInvoker invoker = new ServiceInvoker();
- invoker.setCategory(this.serviceCategory);
- invoker.setName(this.serviceName);
- invoker.start();
- bean.setServiceInvoker(invoker);
- bridge.activate();
-
- }
-
-
- protected void doStop() throws ManagedLifecycleException
- {
- bridge.deactivate();
- }
-}
Copied: labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java (from rev 11903, labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java)
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java (rev 0)
+++ labs/jbossesb/workspace/dbevenius/product/core/listeners/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -0,0 +1,241 @@
+/*
+* 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.jca;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ServiceInvoker;
+
+import java.util.HashMap;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JcaInflowGateway extends AbstractThreadedManagedLifecycle
+{
+ private static final long serialVersionUID = 1L;
+ private static Logger logger = Logger.getLogger(JcaInflowGateway.class);
+ private HashMap<String, String> activationSpec = new HashMap<String, String>();
+ private ClassLoader classLoader;
+ private Class beanClass;
+ private Class messagingType;
+ private ActivationBridge bridge;
+ private String adapter;
+ private String serviceName;
+ private String serviceCategory;
+ private boolean isTransacted = true;
+ private InflowGateway bean;
+
+ public JcaInflowGateway(ConfigTree config) throws ConfigurationException
+ {
+ super(config);
+ //System.out.println("CONFIG: " + config);
+
+ serviceCategory = ListenerUtil.obtainAtt(config,
+ ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+ serviceName = ListenerUtil.obtainAtt(config,
+ ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+
+ ConfigTree spec = config.getFirstChild("activation-config");
+ for (ConfigTree configProperty : spec.getChildren("activation-config-property"))
+ {
+ String name = configProperty.getFirstTextChild("activation-config-property-name").trim();
+ String value = configProperty.getFirstTextChild("activation-config-property-value").trim();
+ activationSpec.put(name, value);
+ }
+
+ this.classLoader = Thread.currentThread().getContextClassLoader();
+ adapter = config.getAttribute("adapter");
+
+ String bc = config.getAttribute("endpointClass");
+ if (bc == null) throw new ConfigurationException("endpointClass attribute is required for Jca Gateway");
+ try
+ {
+ beanClass = classLoader.loadClass(bc);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ConfigurationException("Unable to load Jca Gateway endpointClass: " + bc, e);
+ }
+ if (!InflowGateway.class.isAssignableFrom(beanClass))
+ throw new ConfigurationException("endpointClass must implement InflowGateway interface");
+ String mt = config.getAttribute("messagingType");
+ if (mt != null)
+ {
+ try
+ {
+ messagingType = classLoader.loadClass(mt);
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new ConfigurationException("Unable to load Jca Gateway messagingType: " + mt, e);
+ }
+ }
+ else
+ {
+ messagingType = findMessagingType(beanClass);
+ }
+
+ String brdg = config.getAttribute("jcaBridge");
+ if (brdg != null)
+ {
+ try
+ {
+ bridge = (ActivationBridge) classLoader.loadClass(mt).newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new ConfigurationException("Unable to load jcaBridge: " + brdg, e);
+ }
+ }
+ else
+ {
+ bridge = new JBoss42ActivationBridge();
+ }
+ String transacted = config.getAttribute("transacted");
+ if (transacted != null) isTransacted = Boolean.parseBoolean(transacted.trim());
+
+ }
+
+ public static Class findMessagingType(Class clazz)
+ throws ConfigurationException
+ {
+ if (clazz.equals(Object.class)) return null;
+
+ Class[] interfaces = clazz.getInterfaces();
+ Class type = null;
+ for (Class intf : interfaces)
+ {
+ if (intf.equals(InflowGateway.class)) continue;
+ if (type != null)
+ {
+ throw new ConfigurationException("Unable to guess messagingType interface from endpointClass as the base class implements too many interfaces, specify this explicity");
+ }
+ type = intf;
+ }
+ if (type == null) return findMessagingType(clazz.getSuperclass());
+ return type;
+ }
+
+
+ protected void doInitialise() throws ManagedLifecycleException
+ {
+ try
+ {
+ Constructor beanClassConstructor = beanClass.getConstructor(ConfigTree.class);
+ try
+ {
+ bean = (InflowGateway)beanClassConstructor.newInstance(getConfig());
+ }
+ catch (InstantiationException e)
+ {
+ throw new RuntimeException("Unable to create endpoint bean", e);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException("Unable to create endpoint bean", e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw new RuntimeException("Unable to create endpoint bean", e.getTargetException());
+ }
+ }
+ catch (NoSuchMethodException e)
+ {
+ try
+ {
+ bean = (InflowGateway)beanClass.newInstance();
+ }
+ catch (Exception e1)
+ {
+ throw new RuntimeException("Unable to create endpoint bean", e1);
+ }
+ }
+ final Object theBean = bean;
+ EndpointContainer container = new EndpointContainer()
+ {
+
+ public String getDescription()
+ {
+ return "category: " + serviceCategory + " service: " + serviceName + " jca adapter: " + adapter;
+ }
+
+ public Object invoke(Method method, Object[] args) throws Throwable
+ {
+ try
+ {
+ return method.invoke(theBean, args);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new RuntimeException(e);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw e.getTargetException();
+ }
+ }
+
+ public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
+ {
+ return isTransacted;
+ }
+ };
+
+
+ EndpointFactory mef = new EndpointFactory();
+ mef.setContainer(container);
+ mef.setLoader(classLoader);
+ mef.setMessagingType(messagingType);
+ mef.start();
+ bridge.setActivationProperties(activationSpec);
+ bridge.setAdapter(adapter);
+ bridge.setMessageEndpointFactory(mef);
+ bridge.setMessagingTypeClass(messagingType);
+ }
+
+ protected void doRun()
+ {
+ ServiceInvoker invoker = new ServiceInvoker();
+ invoker.setCategory(this.serviceCategory);
+ invoker.setName(this.serviceName);
+ invoker.start();
+ bean.setServiceInvoker(invoker);
+ bridge.activate();
+
+ }
+
+
+ protected void doStop() throws ManagedLifecycleException
+ {
+ bridge.deactivate();
+ }
+}
Modified: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/build.xml 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/build.xml 2007-05-17 08:44:28 UTC (rev 11906)
@@ -16,7 +16,7 @@
<echo>Insert row data into sql table polled by gateway</echo>
<exec executable="mysql" input="populate.sql" >
<arg value="--user=root" />
- <arg value="--password=root" />
+ <arg value="--password=" />
<arg value="--database=test_sql_gateway" />
</exec>
</target>
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/lib (from rev 11903, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/lib)
Deleted: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar
===================================================================
(Binary files differ)
Copied: labs/jbossesb/workspace/dbevenius/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar (from rev 11903, labs/jbossesb/trunk/product/samples/quickstarts/helloworld_sql_action/lib/mysql-connector-java-3.1.12-bin.jar)
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/META-INF/MANIFEST.MF
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/META-INF/MANIFEST.MF 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/META-INF/MANIFEST.MF 2007-05-17 08:44:28 UTC (rev 11906)
@@ -21,4 +21,4 @@
org.apache.commons.io.output,
org.jboss.soa.eclipse.wizards,
org.jboss.soa.esb.eclipse.template
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
Modified: labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/src/org/jboss/soa/eclipse/wizards/ESBNewWizard.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/src/org/jboss/soa/eclipse/wizards/ESBNewWizard.java 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/src/org/jboss/soa/eclipse/wizards/ESBNewWizard.java 2007-05-17 08:44:28 UTC (rev 11906)
@@ -102,6 +102,7 @@
throws CoreException, InterruptedException {
try {
createProject(monitor);
+ selectAndReveal(m_project, m_workbench.getActiveWorkbenchWindow());
} catch (IOException e) {
e.printStackTrace();
} finally {
@@ -128,12 +129,12 @@
private void selectAndReveal(IResource resource,
IWorkbenchWindow window) {
if (!inputValid(resource, window)) return;
- Iterator<IWorkbenchPart> itr = getParts(window.getActivePage()).iterator();
+ Iterator itr = getParts(window.getActivePage()).iterator();
while (itr.hasNext()) {
selectAndRevealTarget(
window,
new StructuredSelection(resource),
- getTarget(itr.next()));
+ getTarget((IWorkbenchPart)itr.next()));
}
}
@@ -185,8 +186,8 @@
* @param page
* @return list of parts
*/
- private List<IWorkbenchPart> getParts(IWorkbenchPage page) {
- ArrayList<IWorkbenchPart> result = new ArrayList<IWorkbenchPart>();
+ private List getParts(IWorkbenchPage page) {
+ ArrayList result = new ArrayList();
addParts(result, page.getViewReferences());
addParts(result, page.getEditorReferences());
return result;
@@ -197,7 +198,7 @@
* @param parts list of parts
* @param refs workbench part references
*/
- private void addParts(ArrayList<IWorkbenchPart> parts, IWorkbenchPartReference[] refs) {
+ private void addParts(ArrayList parts, IWorkbenchPartReference[] refs) {
for (int i = 0; i < refs.length; i++) {
IWorkbenchPart part = refs[i].getPart(false);
if (part != null) {
Modified: labs/jbossesb/workspace/dbevenius/product/tools/esbwizard/template.jar
===================================================================
(Binary files differ)
Modified: labs/jbossesb/workspace/dbevenius/product/tools/updatesite/features/org.jboss.soa.esb.template_1.0.0/feature.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/product/tools/updatesite/features/org.jboss.soa.esb.template_1.0.0/feature.xml 2007-05-17 08:32:58 UTC (rev 11905)
+++ labs/jbossesb/workspace/dbevenius/product/tools/updatesite/features/org.jboss.soa.esb.template_1.0.0/feature.xml 2007-05-17 08:44:28 UTC (rev 11906)
@@ -13,7 +13,7 @@
Copyright 2007 JBoss Inc.
</copyright>
- <license url="http://www.example.com/license">
+ <license>
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.
Modified: labs/jbossesb/workspace/dbevenius/product/tools/updatesite/plugins/org.jboss.soa.esb.eclipse.template_1.0.0.jar
===================================================================
(Binary files differ)
More information about the jboss-svn-commits
mailing list