Package com.arjuna.common.util.propertyservice

Examples of com.arjuna.common.util.propertyservice.PropertyManager


                throw new IllegalStateException("Cannot set socketProcessIdPort once the MBean has configured");
            }
        }
        else
        {
            PropertyManager pm = arjPropertyManager.getPropertyManager();
            pm.setProperty(com.arjuna.ats.arjuna.common.Environment.SOCKET_PROCESS_ID_PORT, ""+port);
        }
    }
View Full Code Here


public class IOTest
{
  public static void main(String[] args)
  {
    PropertyManager arjunaPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "Arjuna" );

    try
    {
      arjunaPM.load(XMLFilePlugin.class.getName(), "test-product.xml");
    }
    catch (Exception e)
    {
      e.printStackTrace()//To change body of catch statement use Options | File Templates.
    }

    arjunaPM.setProperty("com.arjuna.ats.arjuna.Test","SavedProperty");

    try
    {
      arjunaPM.save(XMLFilePlugin.class.getName(), null);
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
View Full Code Here

            StringTokenizer strtok = new StringTokenizer(depends,",");

            while (strtok.hasMoreElements())
            {
              String dependantName = strtok.nextToken().trim();
              PropertyManager dependant = (PropertyManager)pms.get(dependantName);

                            if ( dependant == null )
                            {
                                throw new LoadPropertiesException("Dependency not found - property file invalid");
                            }
View Full Code Here

  return _mode;
    }

    public static InetAddress getRecoveryManagerHost() throws UnknownHostException
    {
        PropertyManager pm = PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "recoverymanager");

        if ( pm == null )
            return InetAddress.getLocalHost();

        String hostPropName = com.arjuna.ats.arjuna.common.Environment.RECOVERY_MANAGER_ADDRESS;
        String host = pm.getProperty(hostPropName);

        return Utility.hostNameToInetAddress(host, "com.arjuna.ats.arjuna.recovery.RecoveryManager_2");
    }
View Full Code Here

        return Utility.hostNameToInetAddress(host, "com.arjuna.ats.arjuna.recovery.RecoveryManager_2");
    }

    public static int getRecoveryManagerPort()
    {
        PropertyManager pm = PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "recoverymanager");

        if (pm == null)
            return 0;

        String portPropName = com.arjuna.ats.arjuna.common.Environment.RECOVERY_MANAGER_PORT;
        Integer port = Utility.lookupBoundedIntegerProperty(pm, portPropName, null,
                    "com.arjuna.ats.arjuna.recovery.RecoveryManager_1",
                    0, Utility.MAX_PORT);

        if (port == null)
        {
            String portStr = pm.getProperty(portPropName);

           /*
            * if the property files specified a value for the port which is invalid throw a fatal error. An empty value or no value
            * corresponds to any port
            */
 
View Full Code Here

    {
        // has the port already been bound
        if (_port > 0)
            return _port;

        PropertyManager pm = PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "recoverymanager");
        //pm = arjPropertyManager.propertyManager;

        String portStr = pm.getProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_STATUS_MANAGER_PORT);

        if ( portStr == null || portStr.length() == 0)
        {
            return DEFAULT_TMS_PORT;
        }
View Full Code Here

    }

    private String getListenerHostName()
    {
        PropertyManager pm = PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "recoverymanager");
        //pm = arjPropertyManager.propertyManager;

        return pm.getProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_STATUS_MANAGER_ADDRESS);
    }
View Full Code Here

            StringTokenizer strtok = new StringTokenizer(depends,",");

            while (strtok.hasMoreElements())
            {
              String dependantName = strtok.nextToken().trim();
              PropertyManager dependant = (PropertyManager)pms.get(dependantName);

                            if ( dependant == null )
                            {
                                throw new LoadPropertiesException("Dependency not found - property file invalid");
                            }
View Full Code Here

public class SetPropertyTest
{
  public static void main(String[] args)
  {
    PropertyManager arjunaPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "Arjuna" );
    PropertyManager txojPM = PropertyManagerFactory.getPropertyManager( "test-property-manager", "TXOJ" );

    try
    {
      arjunaPM.load(XMLFilePlugin.class.getName(), "test-product.xml");
    }
    catch (Exception e)
    {
      e.printStackTrace()//To change body of catch statement use Options | File Templates.
    }

    boolean passed = true;
    int count = 0;

    String value = arjunaPM.getProperty("com.arjuna.ats.arjuna.Test");
    System.out.println("Value["+(++count)+"] :"+value);
    passed &= value.equals("Test");

    arjunaPM.setProperty("com.arjuna.ats.arjuna.Test", "OverriddenInCode");

    value = txojPM.getProperty("com.arjuna.ats.arjuna.Test");
    System.out.println("Value["+(++count)+"] :"+value);
    passed &= value.equals("Overridden");

    value = arjunaPM.getProperty("com.arjuna.ats.arjuna.Test");
    System.out.println("Value["+(++count)+"] :"+value);
View Full Code Here

    }

    private boolean isRecoveryManagerRunning() throws Exception
    {
        boolean active = false;
        PropertyManager pm = PropertyManagerFactory.getPropertyManager("com.arjuna.ats.propertymanager", "recoverymanager");

        if ( pm != null )
        {
            BufferedReader in = null;
            PrintStream out = null;
View Full Code Here

TOP

Related Classes of com.arjuna.common.util.propertyservice.PropertyManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.