[jboss-svn-commits] JBL Code SVN: r25014 - in labs/jbossesb/workspace/mlittle/legstar: product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jan 30 08:18:03 EST 2009


Author: mark.little at jboss.com
Date: 2009-01-30 08:18:03 -0500 (Fri, 30 Jan 2009)
New Revision: 25014

Added:
   labs/jbossesb/workspace/mlittle/legstar/JBossEULA.txt
Removed:
   labs/jbossesb/workspace/mlittle/legstar/JBossORG-EULA.txt
Modified:
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java
Log:


Added: labs/jbossesb/workspace/mlittle/legstar/JBossEULA.txt
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/JBossEULA.txt	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/JBossEULA.txt	2009-01-30 13:18:03 UTC (rev 25014)
@@ -0,0 +1,127 @@
+END USER LICENSE AGREEMENT
+JBOSS(r) ENTERPRISE MIDDLEWARE(TM)
+
+This end user license agreement ("EULA") governs the use of the various
+software modules that collectively comprise the JBoss Enterprise Middleware
+and any related updates, source code, appearance, structure and organization
+(the "Programs"), regardless of the delivery mechanism.
+
+1. License Grant. Subject to the following terms, Red Hat, Inc. ("Red Hat")
+grants to you ("User") a license to the Programs pursuant to the GNU Lesser
+General Public License v. 2.1 except for the following Programs: (a) JBoss
+Portal Forums and JBoss Transactions, each of which is licensed pursuant to
+the GNU General Public License v.2; (b) JBoss Rules, which is licensed
+pursuant to the Apache License v.2.0; (c) an optional download for JBoss Cache
+for the Berkeley DB for Java database, which is licensed under the (open
+source) Sleepycat License (if User wishes to obtain a commercial license for
+this database, it may purchase a license from Sleepycat Software); and (d) the
+BPEL extension for JBoss jBPM, which is licensed under the Common Public
+License v.1, and, pursuant to the OASIS BPEL4WS standard, requires parties
+wishing to redistribute to enter various royalty-free patent licenses. Each of
+the foregoing licenses is available at
+www.opensource.org/licenses/alphabetical. The Programs are comprised of
+hundreds of software components. With the exception of certain image files
+identified in Section 2 below, the license agreement for each software
+component is located in the software component's source code and permits User
+to run, copy, modify, and redistribute (subject to certain obligations in some
+cases) the software component, in both source code and binary code forms. This
+agreement does not limit User's rights under, or grant User rights that
+supersede, the license terms of any particular component.
+
+2. Intellectual Property Rights. The Programs and each of their components are
+owned by Red Hat and others and are protected under copyright law and under
+other laws as applicable. Title to the Programs and any component, or to any
+copy, modification, or merged portion shall remain with the aforementioned,
+subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark,
+the individual Program trademarks, and the "Shadowman" logo are registered
+trademarks of Red Hat and its affiliates in the U.S. and other countries. This
+EULA does not permit User to distribute the Programs using Red Hat's
+trademarks, regardless of whether they have been modified. User should read
+the information found at http://www.redhat.com/about/corporate/trademark/
+before distributing a copy of the Programs. User may make a commercial
+redistribution of the Programs only if (a) a separate agreement with Red Hat
+authorizing such commercial redistribution is executed or other written
+permission is granted by Red Hat or (b) User must replace all Red Hat
+trademarks as well as the logos identified at
+http://www.jboss.com/company/logos. Merely deleting the files containing the
+Red Hat trademarks and logos may corrupt the Programs.
+
+3. Limited Warranty. Except as specifically stated in this Section 3, a
+separate agreement with Red Hat, or a license for a particular component, to
+the maximum extent permitted under applicable law, the Programs and the
+components are provided and licensed "as is" without warranty of any kind,
+expressed or implied, including the implied warranties of merchantability,
+non-infringement or fitness for a particular purpose. Red Hat warrants that
+the media on which Programs and the components are furnished will be free from
+defects in materials and manufacture under normal use for a period of 30 days
+from the date of delivery to User. Red Hat does not warrant that the functions
+contained in the Programs will meet User's requirements or that the operation
+of the Programs will be entirely error free, appear precisely as described in
+the accompanying documentation, or comply with regulatory requirements. This
+warranty extends only to the party that purchases services pertaining to the
+Programs from Red Hat or a Red Hat authorized distributor.
+
+4. Limitation of Remedies and Liability. To the maximum extent permitted by
+applicable law, User's exclusive remedy under this EULA is to return any
+defective media within 30 days of delivery along with a copy of User's payment
+receipt and Red Hat, at its option, will replace it or refund the money paid
+by User for the media. To the maximum extent permitted under applicable law,
+neither Red Hat, any Red Hat authorized distributor, nor the licensor of any
+component provided to User under this EULA will be liable to User for any
+incidental or consequential damages, including lost profits or lost savings
+arising out of the use or inability to use the Programs or any component, even
+if Red Hat, such authorized distributor, or licensor has been advised of the
+possibility of such damages. In no event shall Red Hat's liability, an
+authorized distributor's liability or the liability of the licensor of a
+component provided to User under this EULA exceed the amount that User paid to
+Red Hat under this EULA during the twelve months preceding the action.
+
+5. Export Control. As required by the laws of the United States and other
+countries, User represents and warrants that it: (a) understands that the
+Programs and their components are subject to export controls under the U.S.
+Commerce Department's Export Administration Regulations ("EAR"); (b) is not
+located in a prohibited destination country under the EAR or U.S. sanctions
+regulations (currently Cuba, Iran, Iraq, North Korea, Sudan and Syria, subject
+to change as posted by the United States government); (c) will not export,
+re-export, or transfer the Programs to any prohibited destination or entities
+on the U.S. Bureau of Industry and Security Denied Parties List or Entity
+List, or the U.S. Office of Foreign Assets Control list of Specially
+Designated Nationals and Blocked Persons, or any similar lists maintained by
+other countries, without the necessary export license(s) or authorizations(s);
+(d) will not use or transfer the Programs for use in connection with any
+nuclear, chemical or biological weapons, missile technology, or military
+end-uses where prohibited by an applicable arms embargo, unless authorized by
+the relevant government agency individual without the necessary export
+license(s) or authorizations(s) from the U.S. Government; (e) understands and
+agrees that if it is in the United States and exports or transfers the
+Programs to eligible end users, it will, to the extent required by EAR Section
+740.17(e), submit semi-annual reports to the Commerce Department's Bureau of
+Industry and Security, which include the name and address (including country)
+of each transferee; and (f) understands that countries including the United
+States may restrict the import, use, or export of encryption products (which
+may include the Programs and the components) and agrees that it shall be
+solely responsible for compliance with any such import, use, or export
+restrictions.
+
+6. Third Party Programs. Red Hat may distribute third party software programs
+with the Programs that are not part of the Programs. These third party
+software programs are not required to run the Programs, are provided as a
+convenience to User, and are subject to their own license terms. The license
+terms either accompany the third party software programs or can be viewed at
+http://www.redhat.com/licenses/thirdparty/eula.html. If User does not agree to
+abide by the applicable license terms for the third party software programs,
+then User may not install them. If User wishes to install the third party
+software programs on more than one system or transfer the programs to another
+party, then User must contact the licensor of the applicable third party
+software programs.
+
+7. General. If any provision of this agreement is held to be unenforceable,
+that shall not affect the enforceability of the remaining provisions. This
+License Agreement shall be governed by the laws of the State of New York and
+of the United States, without regard to any conflict of laws provisions. The
+rights and obligations of the parties to this EULA shall not be governed by
+the United Nations Convention on the International Sale of Goods.
+
+Copyright (c) 2007 Red Hat, Inc. All rights reserved. "JBoss" and the JBoss logo
+are registered trademarks of Red Hat, Inc. All other trademarks are the
+property of their respective owners.

Deleted: labs/jbossesb/workspace/mlittle/legstar/JBossORG-EULA.txt
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/JBossORG-EULA.txt	2009-01-30 12:02:35 UTC (rev 25013)
+++ labs/jbossesb/workspace/mlittle/legstar/JBossORG-EULA.txt	2009-01-30 13:18:03 UTC (rev 25014)
@@ -1,107 +0,0 @@
-LICENSE AGREEMENT
-JBOSS(r)
-
-This License Agreement governs the use of the Software Packages and any updates to the Software 
-Packages, regardless of the delivery mechanism.  Each Software Package is a collective work 
-under U.S. Copyright Law.  Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to 
-the user ("Client") a license to the applicable collective work(s) pursuant to the 
-GNU Lesser General Public License v. 2.1 except for the following Software Packages: 
-(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the 
-GNU General Public License v.2; 
-
-(b) JBoss Rules, which is licensed pursuant to the Apache  License v.2.0;
-
-(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the 
-(open source) Sleepycat License (if Client does not wish to use the open source version of this database, 
-it may purchase a license from Sleepycat Software); 
-
-and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1, 
-and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various 
-royalty-free patent licenses.  
-
-Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php.
-
-1.  The Software.  "Software Packages" refer to the various software modules that are created and made available 
-for distribution by the JBoss.org open source community at http://www.jboss.org.   Each of the Software Packages 
-may be comprised of hundreds of software components.  The end user license agreement for each component is located in 
-the component's source code.  With the exception of certain image files identified in Section 2 below, 
-the license terms for the components permit Client to copy, modify, and redistribute the component, 
-in both source code and binary code forms.  This agreement does not limit Client's rights under, 
-or grant Client rights that supersede, the license terms of any particular component.
-
-2.  Intellectual Property Rights.  The Software Packages are owned by Red Hat and others and are protected under copyright 
-and other laws.  Title to the Software Packages and any component, or to any copy, modification, or merged portion shall 
-remain with the aforementioned, subject to the applicable license.  The "JBoss" trademark, "Red Hat" trademark, the 
-individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates 
-in the U.S. and other countries.  This agreement permits Client to distribute unmodified copies of the Software Packages 
-using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's 
-trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/.  Client must abide by 
-these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified. 
-If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at 
-http://www.jboss.com/company/logos, unless a separate agreement with Red Hat is executed or other permission granted.  
-Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages.  
-
-3.  Limited Warranty.  Except as specifically stated in this Paragraph 3 or a license for a particular 
-component, to the maximum extent permitted under applicable law, the Software Packages and the 
-components are provided and licensed "as is" without warranty of any kind, expressed or implied, 
-including the implied warranties of merchantability, non-infringement or fitness for a particular purpose.  
-Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in 
-materials and manufacture under normal use for a period of 30 days from the date of delivery to Client.  
-Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements 
-or that the operation of the Software Packages will be entirely error free or appear precisely as described 
-in the accompanying documentation. This warranty extends only to the party that purchases the Services 
-pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor. 
-
-4.  Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies 
-described below are accepted by Client as its only remedies.  Red Hat's entire liability, and Client's 
-exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of 
-delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or 
-refund the money paid by Client for the Software.  To the maximum extent permitted by applicable law, 
-Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential 
-damages, including lost profits or lost savings arising out of the use or inability to use the Software, 
-even if Red Hat or such dealer has been advised of the possibility of such damages.  In no event shall 
-Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this 
-Agreement during the twelve months preceding the action.
-
-5.  Export Control.  As required by U.S. law, Client represents and warrants that it: 
-(a) understands that the Software Packages are subject to export controls under the 
-U.S. Commerce Department's Export Administration Regulations ("EAR"); 
-
-(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations 
-(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria); 
-
-(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity, 
-or individual without the necessary export license(s) or authorizations(s) from the U.S. Government; 
-
-(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or 
-biological weapons, or missile technology end-uses unless authorized by the U.S. Government by 
-regulation or specific license; 
-
-(e) understands and agrees that if it is in the United States and exports or transfers the Software 
-Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual 
-reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and 
-address (including country) of each transferee; 
-
-and (f) understands that countries other than the United States may restrict the import, use, or 
-export of encryption products and that it shall be solely responsible for compliance with any such 
-import, use, or export restrictions.
-
-6.  Third Party Programs. Red Hat may distribute third party software programs with the Software Packages 
-that are not part of the Software Packages and which Client must install separately.  These third party 
-programs are subject to their own license terms.  The license terms either accompany the programs or 
-can be viewed at http://www.redhat.com/licenses/.  If Client does not agree to abide by the applicable 
-license terms for such programs, then Client may not install them.  If Client wishes to install the programs 
-on more than one system or transfer the programs to another party, then Client must contact the licensor 
-of the programs.
-
-7.  General.  If any provision of this agreement is held to be unenforceable, that shall not affect the 
-enforceability of the remaining provisions.  This License Agreement shall be governed by the laws of the 
-State of North Carolina and of the United States, without regard to any conflict of laws provisions, 
-except that the United Nations Convention on the International Sale of Goods shall not apply.
-
-Copyright 2006 Red Hat, Inc.  All rights reserved.  
-"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.  
-All other trademarks are the property of their respective owners. 
-
-	Page 1 of 1	18 October 2006
-

Modified: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2009-01-30 12:02:35 UTC (rev 25013)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2009-01-30 13:18:03 UTC (rev 25014)
@@ -149,6 +149,37 @@
 		}
 	}
 
+	/**
+	 * All ESB-aware EPRs are of derived types and not the base type.
+	 * 
+	 * @param epr the epr to check.
+	 * @return <code>true</code> if the EPR is for a gateway, <code>false</code>
+	 * otherwise.
+	 */
+	
+	public static final boolean gatewayEPR (EPR epr)
+	{
+	    try
+	    {
+        	    if (epr.getClass().getMethod("type", (Class) null) == null)
+        	    {
+        	        /*
+        	         * Only derived types have the type method. So if
+        	         * the method isn't present, this is a vanilla EPR
+        	         * so a gateway.
+        	         */
+        	        
+        	        return true;
+        	    }
+        	    else
+        	        return false;
+	    }
+	    catch (final Exception ex)
+	    {
+	        return false;
+	    }
+	}
+	
 	private final static void setSpecificEPR(EPR epr)
 	{
 		String eprType = null;

Modified: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2009-01-30 12:02:35 UTC (rev 25013)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/client/ServiceInvoker.java	2009-01-30 13:18:03 UTC (rev 25014)
@@ -336,73 +336,85 @@
             EPR epr;
             // Iterate over all the EPRs in the list until delivered
             while ((epr = loadBalancer.chooseEPR(serviceClusterInfo)) != null) {
-            	try
-            	{
-            	    final Subject subject = Subject.getSubject(AccessController.getContext());
-            	    if (subject != null)
-            	    {
-            	        logger.info("Subject in ServiceInvoker " + subject);
-                        try
-                        {
-                			byte[] encrypted = PrivateCryptoUtil.INSTANCE.encrypt(new SecurityContext(subject));
-                    	    message.getContext().setContext(SecurityService.CONTEXT, encrypted);
-                        }
-                        catch (final SecurityServiceException e)
-                        {
-                            logger.error("Could not encrypt the security conext. Will not be added to the outgoing message", e);
-                        }
-            	    }
-
-	                replyMessage = eprInvoker.attemptDelivery(message, epr);
-	                if (replyMessage != null) {
-                        if(eprInvoker.synchronous) {
-                            // remove the security context so that it is not exposed to the action pipeline.
-                            replyMessage.getContext().removeContext(SecurityService.CONTEXT);
-
-                            if (Type.isFaultMessage(replyMessage)) {
-                                Factory.createExceptionFromFault(replyMessage) ;
+                if (!EPRHelper.gatewayEPR(epr))
+                {
+                	try
+                	{
+                	    final Subject subject = Subject.getSubject(AccessController.getContext());
+                	    if (subject != null)
+                	    {
+                	        logger.info("Subject in ServiceInvoker " + subject);
+                            try
+                            {
+                    			byte[] encrypted = PrivateCryptoUtil.INSTANCE.encrypt(new SecurityContext(subject));
+                        	    message.getContext().setContext(SecurityService.CONTEXT, encrypted);
                             }
-
-                            // We've delivered it, we're done!
-                            return replyMessage;
+                            catch (final SecurityServiceException e)
+                            {
+                                logger.error("Could not encrypt the security conext. Will not be added to the outgoing message", e);
+                            }
+                	    }
+    
+    	                replyMessage = eprInvoker.attemptDelivery(message, epr);
+    	                if (replyMessage != null) {
+                            if(eprInvoker.synchronous) {
+                                // remove the security context so that it is not exposed to the action pipeline.
+                                replyMessage.getContext().removeContext(SecurityService.CONTEXT);
+    
+                                if (Type.isFaultMessage(replyMessage)) {
+                                    Factory.createExceptionFromFault(replyMessage) ;
+                                }
+    
+                                // We've delivered it, we're done!
+                                return replyMessage;
+                            } else {
+                                // It was an async delivery.  The replyMessage was just an indicator that
+                                // the delivery succeeded.  Return null...
+                                return null;
+                            }
                         } else {
-                            // It was an async delivery.  The replyMessage was just an indicator that
-                            // the delivery succeeded.  Return null...
-                            return null;
-                        }
-                    } else {
-	                    logger.info("Unresponsive EPR: " + epr+" for message: "+message.getHeader());
+    	                    logger.info("Unresponsive EPR: " + epr+" for message: "+message.getHeader());
+    
+    	                    serviceClusterInfo.removeDeadEPR(epr);
+    
+    	                    /*
+    	                     * So far we've only removed the EPR from the cache. Should we
+    	                     * also remove it from the registry?
+    	                     */
+    
+    	                    if (removeDeadEprs)
+    	                    	RegistryUtil.unregister(service.getCategory(), service.getName(), epr);
+    
+    	                    /*
+    	                     * If the message property is set to fail immediately, or the global property is set,
+    	                     * then don't do retries even if there are other EPRs in the list.
+    	                     */
+    
+    	                    if (("true".equals(message.getProperties().getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false")) || exceptionOnDeliveryFailure))
+    	                	throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "].  Told not to retry.");
+    	                }
+                	}
+                	catch (MalformedEPRException ex)  // so we can differentiate failure modes, since returning null is limiting
+                	{
+                		logger.debug("Invalid EPR for service (probably ESB-unaware): ignoring for message: "+message.getHeader());
+    
+                		serviceClusterInfo.removeDeadEPR(epr);
+    
+                		/*
+                		 * DO NOT remove from the registry - it is not dead!!
+                		 */
+                	}
+                }
+                else
+                {
+                    logger.debug("Bad EPR for service (probably ESB-unaware): ignoring for message: "+message.getHeader());
+                    
+                    serviceClusterInfo.removeDeadEPR(epr);
 
-	                    serviceClusterInfo.removeDeadEPR(epr);
-
-	                    /*
-	                     * So far we've only removed the EPR from the cache. Should we
-	                     * also remove it from the registry?
-	                     */
-
-	                    if (removeDeadEprs)
-	                    	RegistryUtil.unregister(service.getCategory(), service.getName(), epr);
-
-	                    /*
-	                     * If the message property is set to fail immediately, or the global property is set,
-	                     * then don't do retries even if there are other EPRs in the list.
-	                     */
-
-	                    if (("true".equals(message.getProperties().getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false")) || exceptionOnDeliveryFailure))
-	                	throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "].  Told not to retry.");
-	                }
-            	}
-            	catch (MalformedEPRException ex)  // so we can differentiate failure modes, since returning null is limiting
-            	{
-            		logger.debug("Invalid EPR for service (probably ESB-unaware): ignoring for message: "+message.getHeader());
-
-            		serviceClusterInfo.removeDeadEPR(epr);
-
-            		/*
-            		 * DO NOT remove from the registry - it is not dead!!
-            		 */
-            	}
-
+                    /*
+                     * DO NOT remove from the registry - it is not dead!!
+                     */
+                }
             }
         }
 

Modified: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java	2009-01-30 12:02:35 UTC (rev 25013)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java	2009-01-30 13:18:03 UTC (rev 25014)
@@ -341,7 +341,7 @@
      */
     private void registerEndpoint() throws ConfigurationException, RegistryException {
     	try {
-			endpointReference = new HTTPEpr(new URI(protocol + "://"+ host + ":" + port + this.httpContext));
+			endpointReference = new EPR(new URI(protocol + "://"+ host + ":" + port + this.httpContext));
 		} catch (Exception e) {
 			throw new RegistryException("Tomcat gateway listener registration failed", e);
 		}




More information about the jboss-svn-commits mailing list