commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger DefaultMessenger.java
Date Tue, 04 Mar 2003 13:19:01 GMT
jstrachan    2003/03/04 05:19:01

  Modified:    messenger project.properties project.xml maven.xml
               messenger/src/java/org/apache/commons/messenger
                        DefaultMessenger.java
  Added:       messenger .classpath
  Log:
  updated the Maven build and added a patch to synchronize on the JMS connection being closed
  
  Revision  Changes    Path
  1.2       +11 -0     jakarta-commons-sandbox/messenger/project.properties
  
  Index: project.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/project.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.properties	22 May 2002 14:49:16 -0000	1.1
  +++ project.properties	4 Mar 2003 13:19:01 -0000	1.2
  @@ -2,6 +2,17 @@
   # P R O J E C T  P R O P E R T I E S
   # -------------------------------------------------------------------
   
  +# -------------------------------------------------------------------
  +# JMS provider details 
  +# -------------------------------------------------------------------
  +messenger.xml=src/conf/Messenger.xml
  +jms.lib.dir=jms/lib
  +jms.classes.dir=jms/classes
  +
  +# -------------------------------------------------------------------
  +# General Maven stuff
  +# -------------------------------------------------------------------
  +
   compile.debug = on
   compile.optimize = off
   compile.deprecation = off
  
  
  
  1.13      +8 -8      jakarta-commons-sandbox/messenger/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/project.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- project.xml	12 Nov 2002 12:38:06 -0000	1.12
  +++ project.xml	4 Mar 2003 13:19:01 -0000	1.13
  @@ -4,7 +4,7 @@
     <pomVersion>3</pomVersion>
     <name>commons-messenger</name>
     <id>commons-messenger</id>
  -  <currentVersion>1.0-dev-10</currentVersion>
  +  <currentVersion>1.0-dev-11</currentVersion>
     <organization>
   	  <name>Apache Software Foundation</name>
   	  <url>http://www.apache.org</url>
  @@ -72,22 +72,22 @@
       
       <dependency>
         <id>commons-logging</id>
  -      <version>1.0</version>
  +      <version>1.0.1</version>
       </dependency>
   
       <dependency>
         <id>commons-beanutils</id>
  -      <version>1.3</version>
  +      <version>1.6.1</version>
       </dependency>
   
       <dependency>
         <id>commons-collections</id>
  -      <version>2.0</version>
  +      <version>2.1</version>
       </dependency>
   
       <dependency>
         <id>commons-digester</id>
  -      <version>1.2</version>
  +      <version>1.4.1</version>
       </dependency>
   
       <dependency>
  @@ -107,12 +107,12 @@
   
       <dependency>
         <id>xml-apis</id>
  -      <version>2.0.0</version>
  +      <version>1.0.b2</version>
       </dependency>
   
       <dependency>
         <id>ant</id>
  -      <version>1.4.1</version>
  +      <version>1.5.1</version>
       </dependency>
   
   <!-- runtime dependencies only required for testing and sample programs -->
  @@ -130,7 +130,7 @@
       <!-- for unit testing -->
       <dependency>
         <id>junit</id>
  -      <version>3.7</version>
  +      <version>3.8.1</version>
       </dependency>
       
     </dependencies>
  
  
  
  1.5       +102 -2    jakarta-commons-sandbox/messenger/maven.xml
  
  Index: maven.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/maven.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- maven.xml	21 Oct 2002 20:31:28 -0000	1.4
  +++ maven.xml	4 Mar 2003 13:19:01 -0000	1.5
  @@ -1,4 +1,4 @@
  -<project default="java:jar" xmlns:j="jelly:core">
  +<project default="java:jar" xmlns:j="jelly:core" xmlns:util="jelly:util">
   
     <goal name="set.classpath" prereqs="java:compile, test:compile">
   
  @@ -47,5 +47,105 @@
         <sysproperty key="org.apache.commons.messenger" value="${messenger.xml}"/>
       </java>
     </goal>
  -	
  +
  +
  +<!--
  +
  +  <target name="webapp" depends="maven:jar"
  +    description="Builds the sample web application">
  +    <mkdir dir="${build.webapp}"/>
  +    <mkdir dir="${build.webapp}/classes"/>
  +    <mkdir dir="${build.webapp}/lib"/>
  +
  +
  +    <javac destdir="${build.webapp}/classes"
  +           srcdir="${webapp.dir}/src"
  +           debug="false"
  +           deprecation="true"
  +           optimize="true"
  +           fork="true">
  +      <classpath refid="compile.classpath"/>
  +    </javac>
  +
  +    <copy toDir="${build.webapp}">
  +      <fileset dir="${webapp.dir}/conf" includes="*.tld, *.xml"/>
  +    </copy>
  +
  +    <copy tofile="${build.webapp}/Messenger.xml" file="${messenger.xml}"/>
  +
  +    <copy todir="${build.webapp}/lib" file="${dist.home}/commons-${component.name}.jar"/>
  +    <copy todir="${build.webapp}/lib" file="${commons-digester.jar}"/>
  +    <copy todir="${build.webapp}/lib" file="${commons-collections.jar}"/>
  +    <copy todir="${build.webapp}/lib" file="${commons-beanutils.jar}"/>
  +    <copy todir="${build.webapp}/lib" file="${commons-logging.jar}"/>
  +
  +  </target>
  +-->	
  +
  +
  +  <goal name="war" prereqs="war:build-war" 
  +  	description="Creates a WAR">
  +  </goal>
  +
  +  <goal name="war:build-war" prereqs="java:jar,war:webapp">
  +  	
  +  	<j:set var="maven.war.file" value="target/messenger.war"/>
  +  	<j:set var="maven.war.webxml" value="src/webapp/WEB-INF/web.xml"/>
  +  	
  +  	<echo>Creating war at: ${maven.war.file} from files: ${webapp.build}</echo>
  +  	<echo>Using web.xml: ${maven.war.webxml}</echo>
  +
  +    <war warfile="${maven.war.file}"
  +			webxml="${maven.war.webxml}">
  +			
  +      <fileset dir="${webapp.build}" excludes="WEB-INF/web.xml"/>
  +    </war>
  +  </goal>
  +
  +  <postGoal name="war:webapp">
  +		<util:tokenize var="ignoreIDs" delim=",">
  +			servletapi,ant,junit
  +		</util:tokenize>        	
  +		
  +		<echo>Copying JMS provider jars from ${jms.lib.dir}</echo>
  +
  +    <mkdir dir="${jms.classes.dir}"/>
  +    <mkdir dir="${jms.lib.dir}"/>
  +
  +    <copy toDir="${webapp.build}/WEB-INF/classes">
  +      <fileset dir="${jms.classes.dir}"/>
  +    </copy>
  +
  +    <copy toDir="${webapp.build}/WEB-INF/lib">
  +      <fileset dir="${jms.lib.dir}"/>
  +    </copy>
  +
  +		<echo>Copying dependent jars to ${webapp.build.lib} but excluding ${ignoreIDs}</echo>
  +		
  +    <j:forEach var="dep" items="${pom.dependencies}">
  +    	<j:if test="${! ignoreIDs.contains(dep.id)}">
  +          
  +        <!-- jars not needed for summary server -->
  +        <echo>Copying: ${dep.id}</echo>
  +        	
  +	      <copy todir="${webapp.build.lib}"
  +	        file="${maven.repo.local}/${dep.getProjectId()}/jars/${dep.getArtifact()}"/>
  +			</j:if>
  +
  +    </j:forEach>
  +
  +		<echo>Copying our messenger jar</echo>
  +		
  +		<copy todir="${webapp.build.lib}"
  +			file="${maven.build.dir}/${maven.final.name}.jar"/>
  +		
  +
  +    <echo>Copying config files</echo>
  +    
  +    <copy tofile="${webapp.build}/WEB-INF/Messenger.xml" file="${messenger.xml}"/>
  +    <copy tofile="${webapp.build}/WEB-INF/Messenger.xml" file="src/conf/messenger.dtd"/>
  +    
  +  </postGoal>
  +  
  +
   </project>
  
  
  
  1.1                  jakarta-commons-sandbox/messenger/.classpath
  
  Index: .classpath
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  
  <classpath>
    <classpathentry kind="src" path="src/java">
    </classpathentry>
    <classpathentry kind="src" path="src/test">
    </classpathentry>
    <classpathentry kind="var" rootpath="JRE_SRCROOT" path="JRE_LIB" sourcepath="JRE_SRC">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/commons-beanutils/jars/commons-beanutils-1.3.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-2.0.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/commons-digester/jars/commons-digester-1.2.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/jms/jars/jms-1.0.2b.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/jta/jars/jta-1.0.1.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/xml-apis/jars/xml-apis-2.0.0.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/ant/jars/ant-1.4.1.jar">
    </classpathentry>
    <classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.7.jar">
    </classpathentry>
    <classpathentry kind="output" path="target\classes">
    </classpathentry>
  </classpath>
  
  
  1.15      +7 -10     jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/DefaultMessenger.java
  
  Index: DefaultMessenger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/messenger/src/java/org/apache/commons/messenger/DefaultMessenger.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- DefaultMessenger.java	4 Mar 2003 10:20:59 -0000	1.14
  +++ DefaultMessenger.java	4 Mar 2003 13:19:01 -0000	1.15
  @@ -73,13 +73,10 @@
       }
       
       public synchronized void close() throws JMSException {
  -        try {
  -            getSessionFactory().close();
  -        }
  -        finally {
  -            // clear all the pools...
  -            messengerSessionPool = new ThreadLocal();
  -        }
  +        // clear all the pools...
  +        messengerSessionPool = new ThreadLocal();
  +        
  +        getSessionFactory().close();
       }
   
       public Session getSession() throws JMSException {
  @@ -121,7 +118,7 @@
       /**
        * @return the current thread's MessengerSession
        */    
  -    protected MessengerSession getMessengerSession() throws JMSException {
  +    protected synchronized MessengerSession getMessengerSession() throws JMSException {
           MessengerSession answer = (MessengerSession) messengerSessionPool.get();
           if (answer == null) {
               answer = createMessengerSession();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message