jakarta-jcs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asm...@apache.org
Subject cvs commit: jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/javagroups LateralJGReceiverConnection.java LateralJGReceiver.java
Date Fri, 20 May 2005 19:22:42 GMT
asmuts      2005/05/20 12:22:42

  Modified:    src/java/org/apache/jcs/auxiliary/lateral/javagroups
                        LateralJGReceiverConnection.java
                        LateralJGReceiver.java
  Log:
  make sure the item is not null before trying to process
  
  Revision  Changes    Path
  1.6       +29 -35    jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java
  
  Index: LateralJGReceiverConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiverConnection.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LateralJGReceiverConnection.java	12 Jun 2004 02:34:12 -0000	1.5
  +++ LateralJGReceiverConnection.java	20 May 2005 19:22:42 -0000	1.6
  @@ -24,7 +24,6 @@
   import org.apache.jcs.auxiliary.lateral.LateralCacheInfo;
   import org.apache.jcs.auxiliary.lateral.LateralElementDescriptor;
   import org.apache.jcs.auxiliary.lateral.javagroups.behavior.ILateralCacheJGListener;
  -import org.jgroups.Channel;
   import org.jgroups.Message;
   
   /**
  @@ -39,16 +38,15 @@
       private final static Log log =
           LogFactory.getLog( LateralJGReceiverConnection.class );
   
  -    private Channel javagroups;
  +    //private Channel javagroups;
       private Message mes;
   
  -
       private ILateralCacheJGListener ilcl;
   
   
       /**
        * Constructor for the LateralJGReceiverConnection object
  -     *
  +     * @param mes The JGroups message
        * @param ilcl
        */
       public LateralJGReceiverConnection( Message mes, ILateralCacheJGListener ilcl )
  @@ -58,7 +56,6 @@
        }
   
   
  -
       /**
        * Main processing method for the LateralJGReceiverConnection object
        *
  @@ -67,45 +64,45 @@
        */
       public void run( )
       {
  -        //Serializable obj = null;
           try
           {
  -
                   LateralElementDescriptor led = ( LateralElementDescriptor ) mes.getObject();
                   if ( led == null )
                   {
  -                    log.debug( "LateralElementDescriptor is null" );
  -                    //continue;
  -                }
  -                if ( led.requesterId == LateralCacheInfo.listenerId )
  -                {
  -                    log.debug( "from self" );
  +                    log.warn( "LateralElementDescriptor is null! Can't do anything." );
                   }
                   else
                   {
  -                    if ( log.isDebugEnabled() )
  -                    {
  -                        log.debug( "receiving LateralElementDescriptor from another, led
= "
  -                             + ", led = " + led
  -                             + ", led.command = " + led.command
  -                             + ", led.ce = " + led.ce
  -                             + ", ilcl = " + ilcl );
  -                    }
  -                    if ( led.command == LateralElementDescriptor.UPDATE )
  +                    if ( led.requesterId == LateralCacheInfo.listenerId )
                       {
  -                        ilcl.handlePut( led.ce );
  +                        log.debug( "from self" );
                       }
                       else
  -                        if ( led.command == LateralElementDescriptor.REMOVE )
                       {
  -                        ilcl.handleRemove( led.ce.getCacheName(), led.ce.getKey() );
  -                    }
  -                    else
  -                        if ( led.command == LateralElementDescriptor.GET )
  -                    {
  -                        /*Serializable obj =*/ getAndRespond( led.ce.getCacheName(), led.ce.getKey()
);
  +                        if ( log.isDebugEnabled() )
  +                        {
  +                            log.debug( "receiving LateralElementDescriptor from another,
led = "
  +                                 + ", led = " + led
  +                                 + ", led.command = " + led.command
  +                                 + ", led.ce = " + led.ce
  +                                 + ", ilcl = " + ilcl );
  +                        }
  +                        if ( led.command == LateralElementDescriptor.UPDATE )
  +                        {
  +                            ilcl.handlePut( led.ce );
  +                        }
  +                        else
  +                            if ( led.command == LateralElementDescriptor.REMOVE )
  +                        {
  +                            ilcl.handleRemove( led.ce.getCacheName(), led.ce.getKey() );
  +                        }
  +                        else
  +                            if ( led.command == LateralElementDescriptor.GET )
  +                        {
  +                            /*Serializable obj =*/ getAndRespond( led.ce.getCacheName(),
led.ce.getKey() );
   
  -                    }
  +                        }
  +                    }                    
                   }
   
           }
  @@ -119,13 +116,10 @@
           }
           catch ( Exception e )
           {
  -            log.error( "Unexpected exception. Closing conneciton", e );
  +            log.error( "Unexpected exception.", e );
           }
  -
  -
       }
   
  -
       /**
        * Send back the object if found.
        *
  
  
  
  1.6       +2 -2      jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiver.java
  
  Index: LateralJGReceiver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-jcs/src/java/org/apache/jcs/auxiliary/lateral/javagroups/LateralJGReceiver.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LateralJGReceiver.java	12 Jun 2004 02:34:12 -0000	1.5
  +++ LateralJGReceiver.java	20 May 2005 19:22:42 -0000	1.6
  @@ -95,7 +95,7 @@
                   }
                   catch ( ChannelNotConnectedException cnce )
                   {
  -                    if ( conProbCnt % 5 == 0 )
  +                    if ( conProbCnt % 20 == 0 )
                       {
                         log.warn(cnce);
                       }
  
  
  

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


Mime
View raw message