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-excalibur/src/scratchpad/org/apache/avalon/excalibur/util ComponentStateValidator.java
Date Mon, 03 Dec 2001 21:11:57 GMT
bloritsch    01/12/03 13:11:57

  Modified:    src/scratchpad/org/apache/avalon/excalibur/util
                        ComponentStateValidator.java
  Log:
  Fix ComponentValidator code that got skrewed during the unauthorized move to excalibur
  
  Revision  Changes    Path
  1.3       +19 -17    jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/util/ComponentStateValidator.java
  
  Index: ComponentStateValidator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/util/ComponentStateValidator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ComponentStateValidator.java	2001/12/02 15:16:22	1.2
  +++ ComponentStateValidator.java	2001/12/03 21:11:57	1.3
  @@ -24,7 +24,7 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:mike@hihat.net">Michael McKibben</a>
  - * @version CVS $Revision: 1.2 $ $Date: 2001/12/02 15:16:22 $
  + * @version CVS $Revision: 1.3 $ $Date: 2001/12/03 21:11:57 $
    */
   public final class ComponentStateValidator
   {
  @@ -34,15 +34,15 @@
       private static final long CONFIGURED     = 0x00000008;
       private static final long COMPOSED       = 0x00000010;
       private static final long ACTIVE         = 0x10000000;
  -    private static final long INITIALIZED    = 0x00000012;
  -    private static final long STARTED        = 0x00000014;
  +    private static final long INITIALIZED    = 0x00000020;
  +    private static final long STARTED        = 0x00000040;
       private static final long SUSPENDED      = 0x01000000;
  -    private static final long STOPPED        = 0x00000018;
  -    private static final long DISPOSED       = 0x00000020;
  -    private static final long INIT_MASK      = LOG_ENABLED | CONTEXTUALIZED | 
  +    private static final long STOPPED        = 0x00000080;
  +    private static final long DISPOSED       = 0x00000100;
  +    private static final long INIT_MASK      = LOG_ENABLED | CONTEXTUALIZED |
           PARAMETERIZED | CONFIGURED | COMPOSED | INITIALIZED | STARTED;
   
  -    private long m_mask;
  +    private final long m_mask;
       private long m_state;
   
       /**
  @@ -51,53 +51,55 @@
        */
       public ComponentStateValidator( final Object object )
       {
  +        int mask = 0;
  +
           if ( object instanceof LogEnabled ||
                object instanceof Loggable )
           {
  -            m_mask |= LOG_ENABLED;
  +            mask |= LOG_ENABLED;
           }
   
           if ( object instanceof Contextualizable )
           {
  -            m_mask |= CONTEXTUALIZED;
  +            mask |= CONTEXTUALIZED;
           }
   
           if ( object instanceof Parameterizable )
           {
  -            m_mask |= PARAMETERIZED;
  +            mask |= PARAMETERIZED;
           }
   
           if ( object instanceof Configurable )
           {
  -            m_mask |= CONFIGURED;
  +            mask |= CONFIGURED;
           }
   
           if ( object instanceof Composable )
           {
  -            m_mask |= COMPOSED;
  +            mask |= COMPOSED;
           }
   
           if ( object instanceof Initializable )
           {
  -            m_mask |= INITIALIZED;
  +            mask |= INITIALIZED;
           }
   
           if ( object instanceof Disposable )
           {
  -            m_mask |= DISPOSED;
  +            mask |= DISPOSED;
           }
   
           if ( object instanceof Startable )
           {
  -            m_mask |= STARTED | STOPPED;
  +            mask |= STARTED | STOPPED;
           }
   
           if ( object instanceof Suspendable )
           {
  -            m_mask |= SUSPENDED;
  +            mask |= SUSPENDED;
           }
   
  -        m_state = m_mask & ~ACTIVE;
  +        m_mask = mask & ~ACTIVE;
       }
   
       /**
  
  
  

--
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