commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket SocketCustomStreamFactoryHelper.java SocketObjectStreamFactoryHelper.java
Date Wed, 06 Mar 2002 16:11:02 GMT
hammant     02/03/06 08:11:02

  Modified:    altrmi/src/java/org/apache/commons/altrmi/client/impl
                        DefaultInterfaceLookupFactory.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl/socket
                        SocketObjectStreamFactoryHelper.java
  Added:       altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi
                        RmiFactoryHelper.java
               altrmi/src/java/org/apache/commons/altrmi/client/impl/socket
                        SocketCustomStreamFactoryHelper.java
  Log:
  More Factory helpers
  
  Revision  Changes    Path
  1.2       +5 -1      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultInterfaceLookupFactory.java
  
  Index: DefaultInterfaceLookupFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/DefaultInterfaceLookupFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultInterfaceLookupFactory.java	5 Mar 2002 16:30:17 -0000	1.1
  +++ DefaultInterfaceLookupFactory.java	6 Mar 2002 16:11:02 -0000	1.2
  @@ -11,6 +11,8 @@
   
   
   import org.apache.commons.altrmi.client.impl.socket.SocketObjectStreamFactoryHelper;
  +import org.apache.commons.altrmi.client.impl.socket.SocketCustomStreamFactoryHelper;
  +import org.apache.commons.altrmi.client.impl.rmi.RmiFactoryHelper;
   
   
   /**
  @@ -18,7 +20,7 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class DefaultInterfaceLookupFactory extends AbstractInterfaceLookupFactory {
   
  @@ -30,6 +32,8 @@
       public DefaultInterfaceLookupFactory() {
   
           addFactory("SocketObjectStream:", new SocketObjectStreamFactoryHelper());
  +        addFactory("SocketCustomStream:", new SocketCustomStreamFactoryHelper());
  +        addFactory("RMI:", new RmiFactoryHelper());
   
           // TODO - add the rest.
       }
  
  
  
  1.1                  jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/rmi/RmiFactoryHelper.java
  
  Index: RmiFactoryHelper.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.client.impl.rmi;
  
  
  
  import org.apache.commons.altrmi.client.impl.AbstractFactoryHelper;
  import org.apache.commons.altrmi.client.AltrmiInterfaceLookup;
  import org.apache.commons.altrmi.client.AltrmiHostContext;
  import org.apache.commons.altrmi.client.AltrmiFactory;
  import org.apache.commons.altrmi.common.AltrmiConnectionException;
  
  import java.io.IOException;
  
  
  /**
   * Class RmiFactoryHelper
   *
   *   "RMI:abcde.com:1234"
   *            0         :  1      : 2
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class RmiFactoryHelper extends AbstractFactoryHelper {
  
      /**
       * Method getAltrmiInterfaceLookup
       *
       *
       * @param factoryString
       *
       * @return
       *
       */
      public AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString)
              throws AltrmiConnectionException {
  
          // TODO maybe we should cache these.  Or the abstract parent class should.
  
          String[] terms = processFactoryString(factoryString);
          AltrmiHostContext hc = new RmiHostContext(terms[1], Integer.parseInt(terms[2]));
          AltrmiFactory af = createAltrmiFactory(terms[3], terms[4].equalsIgnoreCase("bo"));
  
          try {
              af.setHostContext(hc);
          } catch (IOException e) {
              throw new AltrmiConnectionException("IO Exception during connection: "
                                                  + e.getMessage());
          }
  
          return af;
      }
  }
  
  
  
  1.2       +2 -2      jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/SocketObjectStreamFactoryHelper.java
  
  Index: SocketObjectStreamFactoryHelper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/SocketObjectStreamFactoryHelper.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SocketObjectStreamFactoryHelper.java	5 Mar 2002 16:30:17 -0000	1.1
  +++ SocketObjectStreamFactoryHelper.java	6 Mar 2002 16:11:02 -0000	1.2
  @@ -27,12 +27,12 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class SocketObjectStreamFactoryHelper extends AbstractFactoryHelper {
   
       /**
  -     * Method getFactory
  +     * Method getAltrmiInterfaceLookup
        *
        *
        * @param factoryString
  
  
  
  1.1                  jakarta-commons-sandbox/altrmi/src/java/org/apache/commons/altrmi/client/impl/socket/SocketCustomStreamFactoryHelper.java
  
  Index: SocketCustomStreamFactoryHelper.java
  ===================================================================
  
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.commons.altrmi.client.impl.socket;
  
  
  
  import org.apache.commons.altrmi.client.impl.AbstractFactoryHelper;
  import org.apache.commons.altrmi.client.AltrmiInterfaceLookup;
  import org.apache.commons.altrmi.client.AltrmiHostContext;
  import org.apache.commons.altrmi.client.AltrmiFactory;
  import org.apache.commons.altrmi.common.AltrmiConnectionException;
  
  import java.io.IOException;
  
  
  /**
   * Class SocketCustomStreamFactoryHelper
   *
   *   "SocketCustomStream:abcde.com:1234"
   *            0         :  1      : 2
   *
   *
   * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
   * @version $Revision: 1.1 $
   */
  public class SocketCustomStreamFactoryHelper extends AbstractFactoryHelper {
  
      /**
       * Method getAltrmiInterfaceLookup
       *
       *
       * @param factoryString
       *
       * @return
       *
       */
      public AltrmiInterfaceLookup getAltrmiInterfaceLookup(String factoryString)
              throws AltrmiConnectionException {
  
          // TODO maybe we should cache these.  Or the abstract parent class should.
  
          String[] terms = processFactoryString(factoryString);
          AltrmiHostContext hc = new SocketCustomStreamHostContext(terms[1],
                                                                   Integer.parseInt(terms[2]));
          AltrmiFactory af = createAltrmiFactory(terms[3], terms[4].equalsIgnoreCase("bo"));
  
          try {
              af.setHostContext(hc);
          } catch (IOException e) {
              throw new AltrmiConnectionException("IO Exception during connection: "
                                                  + e.getMessage());
          }
  
          return af;
      }
  }
  
  
  

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


Mime
View raw message