Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2009, 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) 2009,
  * @author JBoss, a division of Red Hat.
  */
 package com.arjuna.ats.arjuna.common;
 
 import java.util.List;
 
A JavaBean containing configuration properties for the recovery system.

Author(s):
Jonathan Halliday (jonathan.halliday@redhat.com)
 
 @PropertyPrefix(prefix = "com.arjuna.ats.arjuna.recovery.")
 {
     private volatile int recoveryBackoffPeriod = .;
     private volatile boolean recoveryListener = false;
     private volatile int recoveryPort = 0;
     private volatile String recoveryAddress = "localhost";
     private volatile int transactionStatusManagerPort = 0;
     private volatile String transactionStatusManagerAddress = "localhost";
 
     private volatile int expiryScanInterval = 12; // hours
     private volatile int transactionStatusManagerExpiryTime = 12; // hours
 
     @ConcatenationPrefix(prefix = "com.arjuna.ats.arjuna.recovery.expiryScanner")
     private volatile List<StringexpiryScannerClassNames = new ArrayList<String>();
     private volatile List<ExpiryScannerexpiryScanners = null;
 
     @ConcatenationPrefix(prefix = "com.arjuna.ats.arjuna.recovery.recoveryExtension")
     private volatile List<StringrecoveryModuleClassNames = new ArrayList<String>();
     private volatile List<RecoveryModulerecoveryModules = null;
 
     @ConcatenationPrefix(prefix = "com.arjuna.ats.arjuna.recovery.recoveryActivator")
     private volatile List<StringrecoveryActivatorClassNames = new ArrayList<String>();
     private volatile List<RecoveryActivatorrecoveryActivators = null;
 
     @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.recovery.listener.timeoutsocket")
     private volatile boolean timeoutSocket = false;

    
Returns the interval between recovery scans, in seconds. Default: 120 seconds Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod

Returns:
the recovery scan period, in seconds.
 
     public int getPeriodicRecoveryPeriod()
     {
         return ;
     }

    
Sets the interval between recovery scans, in seconds.

Parameters:
periodicRecoveryPeriod the recovery scan period, in seconds.
 
     public void setPeriodicRecoveryPeriod(int periodicRecoveryPeriod)
     {
         this. = periodicRecoveryPeriod;
     }

    
Returns the interval between recovery phases within a recovery scan, in seconds. Default: 10 seconds Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod

Returns:
the interval between recovery phases, in seconds.
    public int getRecoveryBackoffPeriod()
    {
        return ;
    }

    
Sets the interval between recovery phases, in seconds.

Parameters:
recoveryBackoffPeriod the interval between recovery scan phases, in seconds.
    public void setRecoveryBackoffPeriod(int recoveryBackoffPeriod)
    {
        this. = recoveryBackoffPeriod;
    }

    
Returns true if the recovery system should listen on a network socket. Default: true Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryListener

Returns:
true for network recovery, false for local JVM only use.
    public boolean isRecoveryListener()
    {
        return ;
    }

    
Sets if the recovery system should listen on a network socket or not.

Parameters:
recoveryListener true for network use, false for local JVM only.
    public void setRecoveryListener(boolean recoveryListener)
    {
        this. = recoveryListener;
    }

    
Returns the network port number on which the recovery listener should bind. Default: 0 Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryPort

Returns:
the port number for recovery listener.
    public int getRecoveryPort()
    {
        return ;
    }

    
Sets the network port number on which the recovery listener should bind.

Parameters:
recoveryPort the port number for the recovery listener.
    public void setRecoveryPort(int recoveryPort)
    {
        Utility.validatePortRange(recoveryPort);
        this. = recoveryPort;
    }

    
Returns the hostname on which the recovery listener should bind. Default: "localhost" Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.recoveryAddress

Returns:
the hostname on which the recovery system will listen.
    public String getRecoveryAddress()
    {
        return ;
    }

    
Sets the hostname on which the recovery listener should bind.

Parameters:
recoveryAddress the hostname on which the recovery system will listen.
    public void setRecoveryAddress(String recoveryAddress)
    {
        this. = recoveryAddress;
    }

    
Sets the InetAddress on which the recovery listener should bind. Mainly intended for use by strongly typed bean injection systems, this is a wrapper around the String form of the method.

Parameters:
inetAddress the address on which to bind the recovery listener.
    public void setRecoveryInetAddress(InetAddress inetAddress) {
        setRecoveryAddress(inetAddress.getHostAddress());
    }

    
Returns the network port number on which the transaction status manager should bind. Default: 0 Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort

Returns:
the port number for the transaction status manager listener.
    public int getTransactionStatusManagerPort()
    {
        return ;
    }

    
Sets the network port number on which the transaction status manager should bind.

Parameters:
transactionStatusManagerPort the port number for the transaction status manager listener.
    public void setTransactionStatusManagerPort(int transactionStatusManagerPort)
    {
        Utility.validatePortRange(transactionStatusManagerPort);
        this. = transactionStatusManagerPort;
    }

    
Returns the hostname on which the transaction status manager should bind. Default: "localhost" Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress

Returns:
the hostname on which the transaction status manager will listen.
    {
        return ;
    }

    
Sets the hostname on which the transaction status manager should bind.

Parameters:
transactionStatusManagerAddress the hostname on which the transaction status manager will listen.
    public void setTransactionStatusManagerAddress(String transactionStatusManagerAddress)
    {
        this. = transactionStatusManagerAddress;
    }

    
Sets the InetAddress on which the transaction status manager should bind. Mainly intended for use by strongly typed bean injection systems, this is a wrapper around the String form of the method.

Parameters:
inetAddress the address on which to bind the transaction status manager.
    public void setTransactionStatusManagerInetAddress(InetAddress inetAddress) {
    }

    
Returns the interval on which the ObjectStore will be scanned for expired items, in hours. Default: 12 hours Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.expiryScanInterval

Returns:
the interval between ObjectStore expiry checks, in hours.
    public int getExpiryScanInterval()
    {
        return ;
    }

    
Sets the interval on which the ObjectStore will be scanned for expired items, in hours.

Parameters:
expiryScanInterval the interval between ObjectStore expiry checks, in hours.
    public void setExpiryScanInterval(int expiryScanInterval)
    {
        this. = expiryScanInterval;
    }

    
Returns the time period after which items will be considered to have expired, in hours. Default: 12 hours Equivalent deprecated property: com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime

Returns:
the expiry timeout, in hours.
    {
        return ;
    }

    
Sets the time period after which items will be considered to have expired, in hours.

Parameters:
transactionStatusManagerExpiryTime the expiry timeout, in hours.
    public void setTransactionStatusManagerExpiryTime(int transactionStatusManagerExpiryTime)
    {
        this. = transactionStatusManagerExpiryTime;
    }

    
Returns a list of names of classes that implement ExpiryScanner. The returned list is a copy. May return an empty list, will not return null. Default: empty list. Equivalent deprecated property prefix: com.arjuna.ats.arjuna.recovery.expiryScanner

Returns:
a list of ExpiryScanner implementation class names.
    {
        synchronized(this)
        {
            return new ArrayList<String>();
        }
    }

    
Sets the expiry scanners. List elements should be names of classes that implement ExpiryScanner. The provided list will be copied, not retained.

Parameters:
expiryScannerClassNames a list of ExpiryScanner implementation class names.
    public void setExpiryScannerClassNames(List<StringexpiryScannerClassNames)
    {
        synchronized(this)
        {
            if(expiryScannerClassNames == null)
            {
                this. = new ArrayList<ExpiryScanner>();
                this. = new ArrayList<String>();
            }
            else if(!expiryScannerClassNames.equals(this.))
            {
                this. = null;
                this. = new ArrayList<String>(expiryScannerClassNames);
            }
        }
    }

    
Returns the set of ExpiryScanner instances. The returned list is a copy. May return an empty list, will not return null. If there is no pre-instantiated instance set and classloading or instantiation of one or more elements fails, this method will log an appropriate warning and return a non-null set with fewer elements.

Returns:
the set of ExpiryScanner instances.
    {
        synchronized(this)
        {
            if( == null) {
                List<ExpiryScannerinstances = ClassloadingUtility.loadAndInstantiateClasses(ExpiryScanner.class);
                 = instances;
            }
            return new ArrayList<ExpiryScanner>();
        }
    }

    
Sets the instances of ExpiryScanner. The provided list will be copied, not retained.

Parameters:
expiryScanners the set of ExpiryScanner instances.
    public void setExpiryScanners(List<ExpiryScannerexpiryScanners)
    {
        synchronized(this)
        {
            if(expiryScanners == null)
            {
                this. = new ArrayList<ExpiryScanner>();
                this. = new ArrayList<String>();
            }
            else
            {
                this. = new ArrayList<ExpiryScanner>(expiryScanners);
                List<Stringnames = ClassloadingUtility.getNamesForClasses(this.);
                this. = names;
            }
        }
    }

    
Returns a list of names of classes that implement RecoveryModule. The returned list is a copy. May return an empty list, will not return null. Default: empty list. Equivalent deprecated property prefix:

Returns:
a list of RecoveryModule implementation class names.
    {
        synchronized(this) {
            return new ArrayList<String>();
        }
    }

    
Sets the recovery modules. List elements should be names of classes that implement RecoveryModule. The provided list will be copied, not retained.

Parameters:
recoveryModuleClassNames a list of RecoveryModule implementation class names.
    public void setRecoveryModuleClassNames(List<StringrecoveryModuleClassNames)
    {
        synchronized(this)
        {
            if(recoveryModuleClassNames == null)
            {
                this. = new ArrayList<RecoveryModule>();
                this. = new ArrayList<String>();
            }
            else if(!recoveryModuleClassNames.equals(this.))
            {
                this. = null;
                this. = new ArrayList<String>(recoveryModuleClassNames);
            }
        }
    }

    
Returns the set of RecoveryModule instances. The returned list is a copy. May return an empty list, will not return null. If there is no pre-instantiated instance set and classloading or instantiation of one or more elements fails, this method will log an appropriate warning and return a non-null set with fewer elements.

Returns:
the set of RecoveryModule instances.
    {
        synchronized(this)
        {
            if( == null) {
                List<RecoveryModuleinstances = ClassloadingUtility.loadAndInstantiateClassesWithInit(RecoveryModule.class);
                 = instances;
            }
            return new ArrayList<RecoveryModule>();
        }
    }

    
Sets the instances of RecoveryModule. The provided list will be copied, not retained.

Parameters:
recoveryModules the set of RecoveryModule instances.
    public void setRecoveryModules(List<RecoveryModulerecoveryModules)
    {
        synchronized(this)
        {
            if(recoveryModules == null)
            {
                this. = new ArrayList<RecoveryModule>();
                this. = new ArrayList<String>();
            }
            else
            {
                this. = new ArrayList<RecoveryModule>(recoveryModules);
                List<Stringnames = ClassloadingUtility.getNamesForClasses(this.);
                this. = names;
            }
        }
    }
    

    
Returns a list of names of classes that implement RecoveryActivator. The returned list is a copy. May return an empty list, will not return null. Default: empty list. Equivalent deprecated property prefix:

Returns:
a list of RecoveryActivator implementation class names.
    {
        synchronized(this) {
            return new ArrayList<String>();
        }
    }

    
Sets the recovery activators. List elements should be names of classes that implement RecoveryActivator. The provided list will be copied, not retained.

Parameters:
recoveryActivatorClassNames a list of RecoveryActivator implementation class names.
    public void setRecoveryActivatorClassNames(List<StringrecoveryActivatorClassNames)
    {
        synchronized(this)
        {
            if(recoveryActivatorClassNames == null)
            {
                this. = new ArrayList<RecoveryActivator>();
                this. = new ArrayList<String>();
            }
            else if(!recoveryActivatorClassNames.equals(this.))
            {
                this. = null;
                this. = new ArrayList<String>(recoveryActivatorClassNames);
            }
        }
    }

    
Returns the set of RecoveryActivator instances. The returned list is a copy. May return an empty list, will not return null. If there is no pre-instantiated instance set and classloading or instantiation of one or more elements fails, this method will log an appropriate warning and return a non-null set with fewer elements.

Returns:
the set of RecoveryActivator instances.
    {
        synchronized(this)
        {
            if( == null) {
                List<RecoveryActivatorinstances = ClassloadingUtility.loadAndInstantiateClassesWithInit(RecoveryActivator.class);
                 = instances;
            }
            return new ArrayList<RecoveryActivator>();
        }
    }

    
Sets the instances of RecoveryActivator. The provided list will be copied, not retained.

Parameters:
recoveryActivators the set of RecoveryActivator instances.
    public void setRecoveryActivators(List<RecoveryActivatorrecoveryActivators)
    {
        synchronized(this)
        {
            if(recoveryActivators == null)
            {
                this. = new ArrayList<RecoveryActivator>();
                this. = new ArrayList<String>();
            }
            else
            {
                this. = new ArrayList<RecoveryActivator>(recoveryActivators);
                List<Stringnames = ClassloadingUtility.getNamesForClasses(this.);
                this. = names;
            }
        }
    }

    
Returns true if SO_TIMEOUT should be set on Listener socket instances. Default: false Equivalent deprecated property: com.arjuna.ats.internal.arjuna.recovery.listener.timeoutsocket

Returns:
true if SO_TIMEOUT should be used, false if not.
    public boolean isTimeoutSocket()
    {
        return ;
    }

    
Sets the socket timeout behaviour of the Listener instances.

Parameters:
timeoutSocket true to enable timeouts, false to disable.
    public void setTimeoutSocket(boolean timeoutSocket)
    {
        this. = timeoutSocket;
    }
New to GrepCode? Check out our FAQ X