avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-apps/infomover/src/java/org/apache/infomover/manipulator Normalizer.java
Date Wed, 08 Jan 2003 03:30:05 GMT
bloritsch    2003/01/07 19:30:04

  Modified:    infomover build.xml
               infomover/src/conf infomover-assembly.xml
                        infomover-config.xml
               infomover/src/java/org/apache/infomover/connection
                        ConnectionDescriptor.java ConnectionManager.java
               infomover/src/java/org/apache/infomover/connection/impl
                        ConnectionManagerHandlerFactory.java
                        ConnectionManagerImpl.java
               infomover/src/java/org/apache/infomover/manipulator
                        Normalizer.java
  Log:
  Fix compile errors
  
  Revision  Changes    Path
  1.7       +13 -17    jakarta-avalon-apps/infomover/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/build.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- build.xml	2 Oct 2002 21:08:34 -0000	1.6
  +++ build.xml	8 Jan 2003 03:30:04 -0000	1.7
  @@ -23,7 +23,7 @@
     <!-- Set the properties for intermediate directory -->
     <property name="build.dir" value="build"/>
     <property name="build.lib" value="${build.dir}/lib"/>
  -  <property name="build.xdoclet" value="${build.dir}/xdoclet"/>
  +  <property name="build.metagenerate" value="${build.dir}/xdoclet"/>
     <property name="build.src" value="${build.dir}/src"/>
     <property name="build.classes" value="${build.dir}/classes"/>
     <property name="build.javadocs" value="${build.dir}/javadocs"/>
  @@ -121,34 +121,30 @@
     </target>
   
     <!-- Make .xinfo and manifest automatically for blocks -->
  -  <target name="phoenix-xdoclet" depends="compile">
  +  <target name="phoenix-metagenerate" depends="compile">
   
  -    <mkdir dir="${build.xdoclet}"/>
  +    <taskdef name="generatemeta" classname="org.apache.avalon.phoenix.tools.metagenerate.MetaGenerateTask">
  +      <classpath refid="project.class.path" />
  +    </taskdef>
   
  -    <taskdef name="phoenix-blocks"
  -             classname="org.apache.avalon.phoenix.tools.xdoclet.PhoenixXDoclet"
  -             classpathref="project.class.path"/>
  +    <mkdir dir="${build.metagenerate}"/>
   
  -    <phoenix-blocks
  -        destdir="${build.xdoclet}"
  -        classpathref="project.class.path">
  +    <generatemeta dest="${build.metagenerate}">
         <fileset dir="${java.dir}">
  -        <include name="**/*.java" />
  +        <include name="org/apache/infomover/connection/impl/ConnectionManagerImpl.java"
/>
  +        <include name="org/apache/infomover/jobmanager/impl/JobImpl.java"/>
  +        <include name="org/apache/infomover/jobmanager/impl/JobManagerImpl.java"/>
         </fileset>
  -      <blockinfo/>
  -      <mxinfo/>
  -      <manifest manifestFile="manifest.mf" />
  -    </phoenix-blocks>
  +    </generatemeta>
   
     </target>
   
     <!-- Jars up project -->
  -  <target name="jars" depends="phoenix-xdoclet">
  +  <target name="jars" depends="phoenix-metagenerate">
   
       <mkdir dir="${build.lib}"/>
   
  -    <jar jarfile="${build.lib}/${name}.jar"
  -         manifest="${build.xdoclet}/manifest.mf">
  +    <jar jarfile="${build.lib}/${name}.jar">
         <fileset dir="${build.classes}">
           <include name="org/apache/infomover/**"/>
         </fileset>
  
  
  
  1.2       +20 -19    jakarta-avalon-apps/infomover/src/conf/infomover-assembly.xml
  
  Index: infomover-assembly.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/conf/infomover-assembly.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- infomover-assembly.xml	13 Aug 2002 15:41:57 -0000	1.1
  +++ infomover-assembly.xml	8 Jan 2003 03:30:04 -0000	1.2
  @@ -1,28 +1,21 @@
   <?xml version="1.0"?>
  -<!DOCTYPE assembly PUBLIC "-//PHOENIX/Assembly DTD Version 1.0//EN" 
  +<!DOCTYPE assembly PUBLIC "-//PHOENIX/Assembly DTD Version 1.0//EN"
                     "http://jakarta.apache.org/phoenix/assembly_1_0.dtd">
   
   <assembly>
   
     <!-- The Storage block -->
  -  <block class="org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager"

  +  <block class="org.apache.avalon.cornerstone.blocks.masterstore.RepositoryManager"
            name="objectstorage" />
  -   
  -  <!-- The Packet Manager block -->
  -  <block class="org.apache.avalon.cornerstone.blocks.packet.DefaultPacketManager" 
  -         name="packet-manager">
  -    <provide name="thread-manager" 
  -             role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
  -  </block>
  - 
  +
     <!-- The ThreadManager block -->
  -  <block class="org.apache.avalon.cornerstone.blocks.threads.DefaultThreadManager" 
  +  <block class="org.apache.avalon.cornerstone.blocks.threads.DefaultThreadManager"
            name="thread-manager" />
  - 
  +
     <!-- The Connection Manager block -->
  -  <block class="org.apache.avalon.cornerstone.blocks.connection.DefaultConnectionManager"

  +  <block class="org.apache.avalon.cornerstone.blocks.connection.DefaultConnectionManager"
            name="connections">
  -    <provide name="thread-manager" 
  +    <provide name="thread-manager"
                role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
     </block>
   
  @@ -31,7 +24,7 @@
   
     <!-- The TimeScheduler block -->
     <block class="org.apache.avalon.cornerstone.blocks.scheduler.DefaultTimeScheduler"
name="scheduler">
  -    <provide name="thread-manager" 
  +    <provide name="thread-manager"
                role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
     </block>
   
  @@ -39,11 +32,19 @@
     <!-- Below this section are the demo blocks -->
     <!--                                        -->
   
  -  <block class="org.apache.avalon.apps.demos.helloworldserver.HelloWorldServerImpl"

  +  <block class="org.apache.infomover.connection.impl.ConnectionManagerImpl.java"
  +         name="connection-manager">
  +     <provide name="connections"
  +              role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"/>
  +     <provide name="sockets"
  +              role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
  +  </block>
  +
  +  <block class="org.apache.infomover.jobmanager.impl.JobManagerImpl"
            name="helloworldserver" >
  -    <provide name="sockets" role="org.apache.avalon.cornerstone.services.sockets.SocketManager"/>
  -    <provide name="connections" 
  -             role="org.apache.avalon.cornerstone.services.connection.ConnectionManager"
/>
  +    <provide name="connection-manager" role="org.apache.infomover.connection.ConnectionManager"/>
  +    <provide name="scheduler"
  +             role="org.apache.avalon.cornerstone.services.scheduler.TimeScheduler" />
     </block>
   
   </assembly>
  
  
  
  1.2       +7 -3      jakarta-avalon-apps/infomover/src/conf/infomover-config.xml
  
  Index: infomover-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/conf/infomover-config.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- infomover-config.xml	13 Aug 2002 15:41:57 -0000	1.1
  +++ infomover-config.xml	8 Jan 2003 03:30:04 -0000	1.2
  @@ -12,7 +12,7 @@
           <name>default</name>
   
           <!-- normal priority == 5, max-priority = 10 -->
  -        <priority>5</priority> 
  +        <priority>5</priority>
   
           <!-- are threads deamon threads ? -->
           <is-daemon>false</is-daemon>
  @@ -55,16 +55,20 @@
           </repository>
         </repositories>
     </objectstorage>
  -   
  +
     <sockets>
         <server-sockets>
           <factory name="plain"
                    class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"
/>
  +        <factory name="secure"
  +                 class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory"/>
         </server-sockets>
   
         <client-sockets>
  -        <factory name="plain" 
  +        <factory name="plain"
                    class="org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketFactory"
/>
  +        <factory name="secure"
  +                 class="org.apache.avalon.cornerstone.blocks.sockets.TLSSocketFactory"/>
         </client-sockets>
     </sockets>
   
  
  
  
  1.3       +8 -3      jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionDescriptor.java
  
  Index: ConnectionDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionDescriptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionDescriptor.java	22 Aug 2002 00:25:34 -0000	1.2
  +++ ConnectionDescriptor.java	8 Jan 2003 03:30:04 -0000	1.3
  @@ -71,14 +71,19 @@
           this( isSecure, port, 0, factory );
       }
   
  +    public ConnectionDescriptor( boolean isSecure, InetAddress connect, int port )
  +    {
  +        this( isSecure, port, 0, connect, null );
  +    }
  +
       public ConnectionDescriptor( boolean isSecure, int port, int backlog, ConnectionListenerFactory
factory )
       {
           this( isSecure, port, backlog, null, factory );
       }
   
  -    public ConnectionDescriptor( boolean isSecture, int port, int backlog, InetAddress
bind, ConnectionListenerFactory factory )
  +    public ConnectionDescriptor( boolean isSecure, int port, int backlog, InetAddress bind,
ConnectionListenerFactory factory )
       {
  -        m_isSecure = isSecture;
  +        m_isSecure = isSecure;
           m_port = port;
           m_backlog = backlog;
           m_bind = bind;
  @@ -105,7 +110,7 @@
           return m_bind;
       }
   
  -    public ConnectionListenerFactory getListener()
  +    public ConnectionListenerFactory getListenerFactory()
       {
           return m_factory;
       }
  
  
  
  1.4       +12 -4     jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionManager.java
  
  Index: ConnectionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/ConnectionManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ConnectionManager.java	22 Aug 2002 00:32:59 -0000	1.3
  +++ ConnectionManager.java	8 Jan 2003 03:30:04 -0000	1.4
  @@ -49,6 +49,9 @@
   */
   package org.apache.infomover.connection;
   
  +
  +import java.net.Socket;
  +
   /**
    * The <code>ConnectionManager</code> interface exposes how we control the
    * ConnectionManager externally.
  @@ -61,17 +64,22 @@
       String ROLE = ConnectionManager.class.getName();
   
       /**
  -     * Registers a connection with a name.
  +     * Registers a connection to listen for with a name.
  +     */
  +    void listen( String name, ConnectionDescriptor descriptor ) throws Exception;
  +
  +    /**
  +     * Directly connect to the described connection.
        */
  -    void connect( String name, ConnectionDescriptor descriptor ) throws Exception;
  +    Socket connect( ConnectionDescriptor descriptor ) throws Exception;
   
       /**
        * Unregisters a connection associated with the name.
        */
  -    void disconnect( String name ) throws Exception;
  +    void unlisten( String name ) throws Exception;
   
       /**
        * Unregisters a connection associated with the name.
        */
  -    void disconnect( String name, boolean force ) throws Exception;
  +    void unlisten( String name, boolean force ) throws Exception;
   }
  
  
  
  1.2       +2 -2      jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/impl/ConnectionManagerHandlerFactory.java
  
  Index: ConnectionManagerHandlerFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/impl/ConnectionManagerHandlerFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConnectionManagerHandlerFactory.java	22 Aug 2002 13:30:35 -0000	1.1
  +++ ConnectionManagerHandlerFactory.java	8 Jan 2003 03:30:04 -0000	1.2
  @@ -77,13 +77,13 @@
       public ConnectionHandler createConnectionHandler()
           throws java.lang.Exception
       {
  -        return new Handler( m_descriptor.getListener().createConnectionListener() );
  +        return new Handler( m_descriptor.getListenerFactory().createConnectionListener()
);
       }
   
       public void releaseConnectionHandler(ConnectionHandler connectionHandler)
       {
           ConnectionListener listener = ((Handler) connectionHandler).getListener();
  -        m_descriptor.getListener().releaseConnectionListener(listener);
  +        m_descriptor.getListenerFactory().releaseConnectionListener(listener);
       }
   
       private static final class Handler implements ConnectionHandler
  
  
  
  1.3       +21 -7     jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/impl/ConnectionManagerImpl.java
  
  Index: ConnectionManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/connection/impl/ConnectionManagerImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionManagerImpl.java	22 Aug 2002 13:30:35 -0000	1.2
  +++ ConnectionManagerImpl.java	8 Jan 2003 03:30:04 -0000	1.3
  @@ -56,6 +56,7 @@
   import org.apache.avalon.excalibur.collections.BucketMap;
   
   import java.net.ServerSocket;
  +import java.net.Socket;
   
   /**
    * The <code>ConnectionManagerImpl</code> class exposes how we control the
  @@ -74,8 +75,6 @@
       private SocketManager m_sockets = null;
       private org.apache.avalon.cornerstone.services.connection.ConnectionManager m_connections
= null;
       private final BucketMap m_descriptors;
  -    private final String m_secureFactoryName = "org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory";
  -    private final String m_defaultFactoryName = "org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory";
   
       public ConnectionManagerImpl()
       {
  @@ -101,11 +100,11 @@
       /**
        * Registers a connection with a name.
        */
  -    public void connect( String name, ConnectionDescriptor descriptor ) throws Exception
  +    public void listen( String name, ConnectionDescriptor descriptor ) throws Exception
       {
           m_descriptors.put( name, descriptor );
           ServerSocket socket = m_sockets
  -            .getServerSocketFactory( (descriptor.isSecure()) ? m_secureFactoryName : m_defaultFactoryName
)
  +            .getServerSocketFactory( (descriptor.isSecure()) ? "secure" : "plain" )
               .createServerSocket(
                   descriptor.getPort(),
                   descriptor.getBacklog(),
  @@ -116,18 +115,33 @@
       }
   
       /**
  +     * Directly connect to the described connection.
  +     */
  +    public Socket connect( ConnectionDescriptor descriptor ) throws Exception
  +    {
  +        Socket socket = m_sockets
  +            .getSocketFactory( (descriptor.isSecure()) ? "secure" : "plain" )
  +            .createSocket(
  +                descriptor.getBindAddress(),
  +                descriptor.getPort()
  +            );
  +
  +        return socket;
  +    }
  +
  +    /**
        * Unregisters a connection associated with the name.
        */
  -    public void disconnect( String name )
  +    public void unlisten( String name )
           throws Exception
       {
  -        disconnect( name, false );
  +        unlisten( name, false );
       }
   
       /**
        * Unregisters a connection associated with the name.
        */
  -    public void disconnect( String name, boolean force )
  +    public void unlisten( String name, boolean force )
           throws Exception
       {
           m_descriptors.remove( name );
  
  
  
  1.2       +6 -5      jakarta-avalon-apps/infomover/src/java/org/apache/infomover/manipulator/Normalizer.java
  
  Index: Normalizer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/infomover/src/java/org/apache/infomover/manipulator/Normalizer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Normalizer.java	24 Oct 2002 21:47:55 -0000	1.1
  +++ Normalizer.java	8 Jan 2003 03:30:04 -0000	1.2
  @@ -63,7 +63,7 @@
   /**
    * Normalizer does ....
    *.
  - * @author <a href="bloritsch@apache.org>Berin Loritsch</a>
  + * @author <a href="bloritsch@apache.org">Berin Loritsch</a>
    * @version CVS $Revision$ $Date$
    */
   public class Normalizer
  @@ -147,7 +147,8 @@
           Iterator it = recordSet.iterator();
           while ( it.hasNext() )
           {
  -            processRecord( trans, (Record) it.next() );
  +            Record rec = (Record) it.next();
  +            processRecord( trans, rec );
               trans.removeRecord( rec );
           }
   
  @@ -167,8 +168,8 @@
               List fields = createFields( rec, entryField );
               boolean add = rec.getField( fieldName ).getValue().equals( Boolean.TRUE );
   
  -            Record rec = new Record( m_destTable, (add) ? Record.ADD : Record.DELETE );
  -            trans.addRecord( rec );
  +            Record newRec = new Record( m_destTable, (add) ? Record.ADD : Record.DELETE
);
  +            trans.addRecord( newRec );
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message