Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
   * as indicated by the @author tags. 
   * See the copyright.txt in the distribution for a
   * full listing of individual contributors. 
   * This copyrighted material is made available to anyone wishing to use,
   * modify, copy, or redistribute it subject to the terms and conditions
   * of the GNU Lesser General Public License, v. 2.1.
  * This program is distributed in the hope that it will be useful, but WITHOUT A 
  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
  * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
  * You should have received a copy of the GNU Lesser General Public License,
  * v.2.1 along with this distribution; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
  * MA  02110-1301, USA.
  * 
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
 /*
  * Copyright (C) 1998, 1999, 2000,
  *
  * Arjuna Solutions Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
  * UK.  
  *
  * $Id: RecordType.java 2342 2006-03-30 13:06:17Z  $
  */
 
 package com.arjuna.ats.arjuna.coordinator;
 
 
The following enumerated type defines the types of record that are derived from AbstractRecord. The type also defines the order in which these types may be held by an AtomicAction if a record refers to the same object (as defined by the AbstractRecord operator== operation). Since records are processed sequentially during an AtomicAction operation the ordering below also defines the order in which each operation is invoked. Hence a LOCK type record will always have operations invoked before an RPCTERMINATE type record. This ordering is important otherwise some records may negate the effects of other record, e.g. during the top_level_commit operation a RPCTERMINATE record terminates a server - this should not occur before the server record has sent the final Commit rpc.

Author(s):
Mark Little (mark@arjuna.com)
Version:
$Id: RecordType.java 2342 2006-03-30 13:06:17Z $
Since:
JTS 1.0.
 
 
 public class RecordType
 {
    
The following values are provided for user-defined records that should have operations invoked BEFORE the system records.
 
 
     public static final int USER_DEF_FIRST0 = 1;
 
     public static final int USER_DEF_FIRST1 = 2;
 
     public static final int USER_DEF_FIRST2 = 3;
 
     public static final int USER_DEF_FIRST3 = 4;
 
     public static final int USER_DEF_FIRST4 = 5;
 
     public static final int USER_DEF_FIRST5 = 6;
 
     public static final int USER_DEF_FIRST6 = 7;
 
     public static final int USER_DEF_FIRST7 = 8;
 
     public static final int USER_DEF_FIRST8 = 9;
 
     public static final int USER_DEF_FIRST9 = 10;

    
The values are used by the system records.
 
 
     public static final int RECOVERY = 101;
 
     public static final int PERSISTENCE = 111;
 
     public static final int TXLOG_PERSISTENCE = 112;
 
    public static final int LOCK = 121;
    public static final int ACTIVATION = 131;
    public static final int OTS_RECORD = 141;
    public static final int OTS_ABSTRACTRECORD = 151;
    public static final int XTS_WSAT_RECORD = 161;
    public static final int XTS_WSBA_RECORD = 162;
    public static final int JTA_RECORD = 171;
    public static final int JTAX_RECORD = 172;
    public static final int REPLICATION = 181;
    public static final int NAMING = 191;
    public static final int CADAVER = 201;
    public static final int DISPOSE = 211;
    public static final int RPCCALL = 221;
    public static final int RPCINITIATE = 231;

    
The following values are provided for user-defined records that should have operations invoked AFTER the system records.
    public static final int USER_DEF_LAST0 = 242;
    public static final int USER_DEF_LAST1 = 252;
    public static final int USER_DEF_LAST2 = 262;
    public static final int USER_DEF_LAST3 = 272;
    public static final int USER_DEF_LAST4 = 282;
    public static final int USER_DEF_LAST5 = 292;
    public static final int USER_DEF_LAST6 = 302;
    public static final int USER_DEF_LAST7 = 312;
    public static final int USER_DEF_LAST8 = 322;
    public static final int USER_DEF_LAST9 = 332;

    
Note that RPCTERMINATE is deliberately late in the list otherwise the server would be terminated BEFORE the user records were processed.
    public static final int RPCTERMINATE = 433;
    public static final int RPCCADAVER = 443;
    public static final int UNTYPED = 453;
    public static final int NONE_RECORD = 463;

    
The following is for a one-phase aware resource that we enlist in a two-phase commit transaction using the last resource commit optimization. It's prepare must go off after all other records.
    public static final int LASTRESOURCE = .;

    

Returns:
the Class representing this type.
    @SuppressWarnings("unchecked")
    public static Class typeToClass (int rt)
    {
        switch (rt)
        {
        case .:
            return LastResourceRecord.class;
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecoveryRecord.class;
        case .:
            return PersistenceRecord.class;
        case .:
            return TxLogWritePersistenceRecord.class;
        case .:
            return CadaverRecord.class;
        case .:
            return DisposeRecord.class;
        case .:
            return ActivationRecord.class;
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager()
                    .getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(.);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return RecordTypeManager.manager().getClass(
                    .);
        case .:
            return AbstractRecord.class;
        case .:
            return null;
        default:
            return null;
        }
    }

    

Returns:
the int value representing this Class.
    @SuppressWarnings("unchecked")
    public static int classToType (Class cn)
    {
        if (LastResourceRecord.class.equals(cn))
            return ;
        else if (RecoveryRecord.class.equals(cn))
            return ;
        else if (PersistenceRecord.class.equals(cn))
            return ;
        else if (TxLogWritePersistenceRecord.class.equals(cn))
            return ;
        else if (CadaverRecord.class.equals(cn))
            return ;
        else if (DisposeRecord.class.equals(cn))
            return ;
        
        else
            return RecordTypeManager.manager().getType(cn);
    }

    
Print a human-readable version of the lock type.
    public static void print (PrintWriter strmint rt)
    {
        strm.print(typeToClass(rt));
        strm.flush();
    }
New to GrepCode? Check out our FAQ X