Class JTransaction

    • Field Detail

      • startTime

        protected long startTime
        Deprecated.
      • commitCount

        private int commitCount
        Deprecated.
        Number of commit operation since starting up.
      • EMPTY_STRING

        public static final String EMPTY_STRING
        Deprecated.
      • LogThresholdOperation

        static int LogThresholdOperation
        Deprecated.
        Number of pooled operation, by default 100. This value can be adjusted for a particular server by setting LogThresholdOperation specific property.

        These property can be fixed either from java launching command, or in a3servers.xml configuration file.

      • dir

        private File dir
        Deprecated.
      • phase

        protected int phase
        Deprecated.
    • Constructor Detail

      • JTransaction

        public JTransaction()
        Deprecated.
    • Method Detail

      • getStartTime

        public long getStartTime()
        Deprecated.
        Returns the starting time.
        Specified by:
        getStartTime in interface TransactionMBean
        Returns:
        The starting time.
      • getCommitCount

        public final int getCommitCount()
        Deprecated.
        Returns the number of commit operation since starting up.
        Specified by:
        getCommitCount in interface Transaction
        Specified by:
        getCommitCount in interface TransactionMBean
        Returns:
        The number of commit operation.
      • init

        public void init​(String path)
                  throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Initializes the atomic storage component.
        Specified by:
        init in interface Transaction
        Parameters:
        path - the path of storage directory.
        Throws:
        IOException - an error occurs.
      • getDir

        public File getDir()
        Deprecated.
      • getPersistenceDir

        public String getPersistenceDir()
        Deprecated.
        Returns the path of persistence directory.
        Returns:
        The path of persistence directory.
      • begin

        public final void begin()
                         throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Start a transaction validation, the validation phase needs 3 phases: begin, commit and release. The begin ensure the mutual exclusion of the current transaction.
        Specified by:
        begin in interface Transaction
        Throws:
        IOException - an error occurs.
      • getList

        public String[] getList​(String prefix)
        Deprecated.
        Description copied from interface: Transaction
        Returns an array of strings naming the objects in the component started by this prefix.
        Specified by:
        getList in interface Transaction
        Parameters:
        prefix - the prefix of searched objects.
        Returns:
        an array of strings naming the objects in the component started by this prefix.
      • create

        public final void create​(Serializable obj,
                                 String name)
                          throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register the state of a newly created object in the current transaction.
        Specified by:
        create in interface Transaction
        Parameters:
        obj - the object to store.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • create

        public final void create​(Serializable obj,
                                 String dirName,
                                 String name)
                          throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register the state of a newly created object in the current transaction.
        Specified by:
        create in interface Transaction
        Parameters:
        obj - the object to store.
        dirName - the directory name of the object.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • save

        public final void save​(Serializable obj,
                               String name)
                        throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register the modified state of an object in the current transaction.
        Specified by:
        save in interface Transaction
        Parameters:
        obj - the object to store.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • save

        public final void save​(Serializable obj,
                               String dirName,
                               String name)
                        throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register the modified state of an object in the current transaction.
        Specified by:
        save in interface Transaction
        Parameters:
        obj - the object to store.
        dirName - the directory name of the object.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • save

        public void save​(Serializable obj,
                         String dirName,
                         String name,
                         boolean first)
                  throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register the state of an object in the current transaction.
        Specified by:
        save in interface Transaction
        Parameters:
        obj - the object to store.
        dirName - the directory name of the object.
        name - the name of the object.
        first - the object is a new one.
        Throws:
        IOException - an error occurs.
      • createByteArray

        public final void createByteArray​(byte[] buf,
                                          String name)
                                   throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register a new byte array in the current transaction.
        Specified by:
        createByteArray in interface Transaction
        Parameters:
        buf - the byte array to store.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • createByteArray

        public final void createByteArray​(byte[] buf,
                                          String dirName,
                                          String name)
                                   throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register a new byte array in the current transaction.
        Specified by:
        createByteArray in interface Transaction
        Parameters:
        buf - the byte array to store.
        dirName - the directory name of the object.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • saveByteArray

        public final void saveByteArray​(byte[] buf,
                                        String name)
                                 throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register a modified byte array in the current transaction.
        Specified by:
        saveByteArray in interface Transaction
        Parameters:
        buf - the byte array to store.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • saveByteArray

        public final void saveByteArray​(byte[] buf,
                                        String dirName,
                                        String name)
                                 throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register a modified byte array in the current transaction.
        Specified by:
        saveByteArray in interface Transaction
        Parameters:
        buf - the byte array to store.
        dirName - the directory name of the object.
        name - the name of the object.
        Throws:
        IOException - an error occurs.
      • saveByteArray

        public void saveByteArray​(byte[] buf,
                                  String dirName,
                                  String name,
                                  boolean copy,
                                  boolean first)
                           throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Register a modified byte array in the current transaction.
        Specified by:
        saveByteArray in interface Transaction
        Parameters:
        buf - the byte array to store.
        dirName - the directory name of the object.
        name - the name of the object.
        copy - the byte array can be modified, copy it.
        first - the object is a new one.
        Throws:
        IOException - an error occurs.
      • useLoadAll

        public boolean useLoadAll()
        Deprecated.
        Returns false, this Transaction implementation does not implement an optimized loadAll method.
        Specified by:
        useLoadAll in interface Transaction
        Specified by:
        useLoadAll in interface TransactionMBean
        Returns:
        false.
      • loadAll

        public void loadAll​(String prefix,
                            Map map)
        Deprecated.
        Fills the map with all objects of the component whose name begins with the prefix.
        Specified by:
        loadAll in interface Transaction
        Parameters:
        prefix - The prefix of searched objects.
        map - The map of corresponding objects.
      • loadByteArray

        public final byte[] loadByteArray​(String name)
                                   throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Load the specified byte array.
        Specified by:
        loadByteArray in interface Transaction
        Parameters:
        name - the name of the object.
        Returns:
        the loaded byte array.
        Throws:
        IOException - an error occurs.
      • loadByteArray

        public byte[] loadByteArray​(String dirName,
                                    String name)
                             throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Load the specified byte array.
        Specified by:
        loadByteArray in interface Transaction
        Parameters:
        dirName - the directory name of the object.
        name - the name of the object.
        Returns:
        the loaded byte array.
        Throws:
        IOException - an error occurs.
      • delete

        public final void delete​(String name)
        Deprecated.
        Description copied from interface: Transaction
        Deletes the specified object.
        Specified by:
        delete in interface Transaction
        Parameters:
        name - the name of the object.
      • delete

        public void delete​(String dirName,
                           String name)
        Deprecated.
        Description copied from interface: Transaction
        Deletes the specified object.
        Specified by:
        delete in interface Transaction
        Parameters:
        dirName - the directory name of the object.
        name - the name of the object.
      • deleteDir

        private void deleteDir​(File dir)
        Deprecated.
        Delete the specified directory if it is empty. Also recursively delete the parent directories if they are empty.
        Parameters:
        dir - the directory to delete.
      • commit

        public void commit​(boolean release)
                    throws IOException
        Deprecated.
        Description copied from interface: Transaction
        Commit the current transaction.
        Specified by:
        commit in interface Transaction
        Parameters:
        release - if true releases the transaction at the end of the commit.
        Throws:
        IOException - an error occurs.
      • stop

        public void stop()
        Deprecated.
        Stops the transaction module. It waits all transactions termination, then the module is kept in a FREE 'ready to use' state.
        Specified by:
        stop in interface Transaction
      • close

        public void close()
        Deprecated.
        Close the transaction module. It waits all transactions termination, the module will be initialized anew before reusing it.
        Specified by:
        close in interface Transaction
      • containsOperations

        public boolean containsOperations()
        Deprecated.
        Indicates whether some operations have been done in this transaction.
        Specified by:
        containsOperations in interface Transaction
        Returns:
        true if some operations are waiting for commit in this transaction.
      • getOperationCount

        public int getOperationCount()
        Deprecated.
        Returns the number of operations to be committed.
        Specified by:
        getOperationCount in interface Transaction
        Returns:
        the number of operations to be committed.
      • backup

        public String backup​(String path)
                      throws Exception
        Deprecated.
        Backups the content of Transaction module. Produces a generic Backup/Restore file containing all living objects. Currently not implemented, throws an UnsupportedOperationException.
        Specified by:
        backup in interface Transaction
        Specified by:
        backup in interface TransactionMBean
        Parameters:
        path - Directory path to store the backup.
        Returns:
        the name of created backup file.
        Throws:
        Exception - An error occurs during backup.