User: hiram   
  Date: 01/02/26 19:02:46

  Modified:    src/main/org/jbossmq/distributed/server
                        ConnectionReceiverOIL.java
                        ConnectionReceiverOILClient.java
                        DistributedJMSServerOIL.java
                        DistributedJMSServerOILClient.java
                        DistributedJMSServerRMI.java
                        DistributedJMSServerRMIImpl.java
                        DistributedJMSServerUILClient.java
  Log:
  BUG FIX: Redepolyment of MDBs were failing.  This was due to the fact that the
  JNDI was returning the ConnectionFactorys by reference (When inside the app server).
  
  Revision  Changes    Path
  1.3       +18 -5     
jbossmq/src/main/org/jbossmq/distributed/server/ConnectionReceiverOIL.java
  
  Index: ConnectionReceiverOIL.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/ConnectionReceiverOIL.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConnectionReceiverOIL.java        2001/02/14 00:42:52     1.2
  +++ ConnectionReceiverOIL.java        2001/02/27 03:02:42     1.3
  @@ -53,7 +53,7 @@
    *   @author Norbert Lataille ([EMAIL PROTECTED])
    *   @author Hiram Chirino ([EMAIL PROTECTED])
    * 
  - *   @version $Revision: 1.2 $
  + *   @version $Revision: 1.3 $
    */
   public class ConnectionReceiverOIL implements Runnable, 
org.jbossmq.distributed.interfaces.ConnectionReceiverSetup {
        // Attributes ----------------------------------------------------
  @@ -171,8 +171,7 @@
                        return;
                }
        }
  -
  -     void failure(String st, Exception e) {
  +void failure(String st, Exception e) {
            try {
                connection.failureHandler(e, st);
            } catch (JMSException ex) {
  @@ -185,7 +184,21 @@
        }
   
        public ConnectionReceiver createClient() throws Exception {
  -             return new ConnectionReceiverOILClient(InetAddress.getLocalHost(), 
serverSocket.getLocalPort());
  +             InetAddress address = InetAddress.getLocalHost();
  +             // We might get the loopback address.. this is not good..
  +             // We have to try to find a better address.
  +             if( address.getHostAddress().equals("127.0.0.1") ) {
  +                     Log.notice("Looking for a better localhost address.");
  +                     InetAddress addresses[] = 
InetAddress.getAllByName("localhost");
  +                     for( int i=0; i < addresses.length; i++ ) {
  +                             if( !addresses[i].getHostAddress().equals("127.0.0.1") 
) {
  +                                     address = addresses[i];
  +                                     break;
  +                             }
  +                     }
  +             }
  +             Log.notice("ConnectionReceiverOIL created client with 
address="+address.getHostAddress());
  +             return new ConnectionReceiverOILClient(address, 
serverSocket.getLocalPort());
        }
   
        public void close() throws Exception {
  @@ -193,4 +206,4 @@
        }
   
   
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +3 -2      
jbossmq/src/main/org/jbossmq/distributed/server/ConnectionReceiverOILClient.java
  
  Index: ConnectionReceiverOILClient.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/ConnectionReceiverOILClient.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConnectionReceiverOILClient.java  2001/01/26 00:43:41     1.1
  +++ ConnectionReceiverOILClient.java  2001/02/27 03:02:42     1.2
  @@ -39,7 +39,7 @@
    *   @author Norbert Lataille ([EMAIL PROTECTED])
    *   @author Hiram Chirino ([EMAIL PROTECTED])
    * 
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public class ConnectionReceiverOILClient
        implements ConnectionReceiver, Serializable
  @@ -65,6 +65,7 @@
        protected void createConnection() throws RemoteException
        {
                try {                   
  +                     Log.notice("ConnectionReceiverOILClient is connecting to: 
"+addr.getHostAddress()+":"+port);
                        socket=new Socket(addr,port);
                        out=new ObjectOutputStream(new 
BufferedOutputStream(socket.getOutputStream()));
                        out.flush();
  @@ -126,4 +127,4 @@
                out.writeObject(messages);
                waitAnswer();
        }
  -}
  \ No newline at end of file
  +}
  
  
  
  1.2       +4 -3      
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerOIL.java
  
  Index: DistributedJMSServerOIL.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerOIL.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DistributedJMSServerOIL.java      2001/01/26 00:43:42     1.1
  +++ DistributedJMSServerOIL.java      2001/02/27 03:02:42     1.2
  @@ -49,7 +49,7 @@
    *   @author Norbert Lataille ([EMAIL PROTECTED])
    *   @author Hiram Chirino ([EMAIL PROTECTED])
    * 
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public class DistributedJMSServerOIL extends DistributedJMSServerUIL
        implements DistributedJMSServerOILMBean
  @@ -81,7 +81,8 @@
                        failure("Initialisation",e);
                        return;
                }
  -             
  +                             
  +             Log.log("New Client Connection accepted.  Current 
Thread="+Thread.currentThread());
                while (!closed) {
   
                        try {
  @@ -90,7 +91,6 @@
                                if( closed )
                                        break;
                                        
  -                             Log.notice("Command read");
                                Log.notice(e);
                                break;
                        }
  @@ -103,6 +103,7 @@
                                {
                                        case m_setSpyDistributedConnection: 
                                                spyDistributedConnection = 
(SpyDistributedConnection)in.readObject();
  +                                             Log.log("Client Connection set 
spyDistributedConnection, ClientID="+spyDistributedConnection.getClientID()+".  
Current Thread="+Thread.currentThread());
                                                break;
                                        case m_acknowledge:
                                                
server.acknowledge(spyDistributedConnection, (AcknowledgementRequest)in.readObject());
  
  
  
  1.2       +9 -2      
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerOILClient.java
  
  Index: DistributedJMSServerOILClient.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerOILClient.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DistributedJMSServerOILClient.java        2001/01/26 00:43:42     1.1
  +++ DistributedJMSServerOILClient.java        2001/02/27 03:02:42     1.2
  @@ -46,10 +46,10 @@
    *@author Norbert Lataille ([EMAIL PROTECTED])
    *@author Hiram Chirino ([EMAIL PROTECTED])
    * 
  - *@version $Revision: 1.1 $
  + *@version $Revision: 1.2 $
    */
   public class DistributedJMSServerOILClient   extends DistributedJMSServerUILClient
  -     implements DistributedJMSServer, Serializable {
  +     implements DistributedJMSServer, Serializable, Cloneable {
        
        transient Socket socket;
        
  @@ -76,4 +76,11 @@
                        createConnection();
        }
   
  +     public Object clone() throws CloneNotSupportedException {
  +             return super.clone();
  +     }
  +
  +     public DistributedJMSServer internalClone() throws CloneNotSupportedException {
  +             return (DistributedJMSServer)clone();
  +     }
   }
  
  
  
  1.2       +4 -2      
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerRMI.java
  
  Index: DistributedJMSServerRMI.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerRMI.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DistributedJMSServerRMI.java      2001/01/26 00:43:42     1.1
  +++ DistributedJMSServerRMI.java      2001/02/27 03:02:42     1.2
  @@ -34,7 +34,7 @@
    *   @author Norbert Lataille ([EMAIL PROTECTED])
    *   @author Hiram Chirino ([EMAIL PROTECTED])
    * 
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public interface DistributedJMSServerRMI extends java.rmi.Remote, 
org.jbossmq.distributed.interfaces.DistributedJMSServer {
        // Public --------------------------------------------------------
  @@ -83,4 +83,6 @@
    * @exception java.rmi.RemoteException The exception description.
    */
   void transact(org.jbossmq.SpyDistributedConnection dc, 
org.jbossmq.TransactionRequest t) throws java.lang.Exception, java.rmi.RemoteException;
  -}
  \ No newline at end of file
  +
  +     public DistributedJMSServer internalClone() throws RemoteException;
  +     }
  \ No newline at end of file
  
  
  
  1.2       +5 -1      
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerRMIImpl.java
  
  Index: DistributedJMSServerRMIImpl.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerRMIImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DistributedJMSServerRMIImpl.java  2001/01/26 00:43:42     1.1
  +++ DistributedJMSServerRMIImpl.java  2001/02/27 03:02:43     1.2
  @@ -42,7 +42,7 @@
    *   @author Norbert Lataille ([EMAIL PROTECTED])
    *   @author Hiram Chirino ([EMAIL PROTECTED])
    * 
  - *   @version $Revision: 1.1 $
  + *   @version $Revision: 1.2 $
    */
   public class DistributedJMSServerRMIImpl extends 
java.rmi.server.UnicastRemoteObject implements 
org.jbossmq.distributed.interfaces.DistributedJMSServerSetup, DistributedJMSServerRMI, 
DistributedJMSServerRMIImplMBean {
        // Attributes ----------------------------------------------------
  @@ -158,5 +158,9 @@
   
        public void transact(org.jbossmq.SpyDistributedConnection dc, 
TransactionRequest t) throws JMSException {
                server.transact(dc,t);
  +     }
  +
  +     public DistributedJMSServer internalClone() {
  +             return this;
        }
   }
  
  
  
  1.2       +11 -2     
jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerUILClient.java
  
  Index: DistributedJMSServerUILClient.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbossmq/src/main/org/jbossmq/distributed/server/DistributedJMSServerUILClient.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DistributedJMSServerUILClient.java        2001/01/26 00:43:43     1.1
  +++ DistributedJMSServerUILClient.java        2001/02/27 03:02:43     1.2
  @@ -50,9 +50,10 @@
    *@author Norbert Lataille ([EMAIL PROTECTED])
    *@author Hiram Chirino ([EMAIL PROTECTED])
    *
  - *@version $Revision: 1.1 $
  + *@version $Revision: 1.2 $
    */
  -public class DistributedJMSServerUILClient implements java.io.Serializable, 
org.jbossmq.distributed.interfaces.DistributedJMSServer {
  +public class DistributedJMSServerUILClient 
  +     implements java.io.Serializable, DistributedJMSServer, Cloneable {
        static final int m_acknowledge = 1;
        static final int m_addMessage = 2;
        static final int m_browse = 3;
  @@ -343,5 +344,13 @@
                        failure(e);
                }
                waitAnswer();
  +     }
  +
  +     public Object clone() throws CloneNotSupportedException {
  +             return super.clone();
  +     }
  +
  +     public DistributedJMSServer internalClone() throws CloneNotSupportedException {
  +             return (DistributedJMSServer)clone();
        }
   }
  
  
  

Reply via email to