Package org.apache.pluto.portalImpl.util

Examples of org.apache.pluto.portalImpl.util.Properties


            context = aConfig.getServletContext ();

        if (context != null)
            context.log ("ServiceManager: Loading services...");

        Properties props = new Properties ();

        try
        {
            props.load (context.getResourceAsStream (aServiceConfigFile));
        }
        catch (IOException exc)
        {
            if (context != null)
                context.log ("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
            throw new Exception("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
        }

        int numAll = 0;
        int numSuccessful = 0;

        for (Iterator iter = props.names (); iter.hasNext (); )
        {
            String serviceBaseName = (String) iter.next ();

            numAll++;

            // ty to get hold of the base service

            Class serviceBase;

            try
            {
                serviceBase = Class.forName (serviceBaseName);
            }
            catch (ClassNotFoundException exc)
            {
                if (context != null)
                    context.log ("ServiceManager: A service with name " + serviceBaseName + " cannot be found.");

                continue;
            }

            String serviceImplName = props.getString (serviceBaseName);

            Class serviceImpl = null;

            Service service = null;

            try
            {
                serviceImpl = Class.forName (serviceImplName);

                service = (Service) serviceImpl.newInstance ();

                Properties serviceProps = new Properties ();

                try
                {
                    InputStream is = null;

                    is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceImpl) + ".properties");

                    if (is == null)
                        is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceBase) + ".properties");

                    if (is != null)
                        serviceProps.load (is);
                }
                catch (IOException exc)
                {
                    // ignore -- we go without properties then
                }
View Full Code Here


            context = aConfig.getServletContext ();

        if (context != null)
            context.log ("ServiceManager: Loading services...");

        Properties props = new Properties ();

        try
        {
            props.load (context.getResourceAsStream (aServiceConfigFile));
        }
        catch (IOException exc)
        {
            if (context != null)
                context.log ("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
            throw new Exception("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
        }

        int numAll = 0;
        int numSuccessful = 0;

        for (Iterator iter = props.names (); iter.hasNext (); )
        {
            String serviceBaseName = (String) iter.next ();

            numAll++;

            // ty to get hold of the base service

            Class serviceBase;

            try
            {
                serviceBase = Class.forName (serviceBaseName);
            }
            catch (ClassNotFoundException exc)
            {
                if (context != null)
                    context.log ("ServiceManager: A service with name " + serviceBaseName + " cannot be found.");

                continue;
            }

            String serviceImplName = props.getString (serviceBaseName);

            Class serviceImpl = null;

            Service service = null;

            try
            {
                serviceImpl = Class.forName (serviceImplName);

                service = (Service) serviceImpl.newInstance ();

                Properties serviceProps = new Properties ();

                try
                {
                    InputStream is = null;

                    is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceImpl) + ".properties");

                    if (is == null)
                        is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceBase) + ".properties");

                    if (is != null)
                        serviceProps.load (is);
                }
                catch (IOException exc)
                {
                    // ignore -- we go without properties then
                }
View Full Code Here

            context = aConfig.getServletContext ();

        if (context != null)
            context.log ("ServiceManager: Loading services...");

        Properties props = new Properties ();

        try
        {
            props.load (context.getResourceAsStream (aServiceConfigFile));
        }
        catch (IOException exc)
        {
            if (context != null)
                context.log ("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
            throw new Exception("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
        }

        int numAll = 0;
        int numSuccessful = 0;

        for (Iterator iter = props.names (); iter.hasNext (); )
        {
            String serviceBaseName = (String) iter.next ();

            numAll++;

            // ty to get hold of the base service

            Class serviceBase;

            try
            {
                serviceBase = Class.forName (serviceBaseName);
            }
            catch (ClassNotFoundException exc)
            {
                if (context != null)
                    context.log ("ServiceManager: A service with name " + serviceBaseName + " cannot be found.");

                continue;
            }

            String serviceImplName = props.getString (serviceBaseName);

            Class serviceImpl = null;

            Service service = null;

            try
            {
                serviceImpl = Class.forName (serviceImplName);

                service = (Service) serviceImpl.newInstance ();

                Properties serviceProps = new Properties ();

                try
                {
                    InputStream is = null;

                    is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceImpl) + ".properties");

                    if (is == null)
                        is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceBase) + ".properties");

                    if (is != null)
                        serviceProps.load (is);
                }
                catch (IOException exc)
                {
                    // ignore -- we go without properties then
                }
View Full Code Here

            context = aConfig.getServletContext ();

        if (context != null)
            context.log ("ServiceManager: Loading services...");

        Properties props = new Properties ();

        try
        {
            props.load (context.getResourceAsStream (aServiceConfigFile));
        }
        catch (IOException exc)
        {
            if (context != null)
                context.log ("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
            throw new Exception("ServiceManager: File \"" + aServiceConfigFile + "\" cannot be found or read.");
        }

        int numAll = 0;
        int numSuccessful = 0;

        for (Iterator iter = props.names (); iter.hasNext (); )
        {
            String serviceBaseName = (String) iter.next ();

            numAll++;

            // ty to get hold of the base service

            Class serviceBase;

            try
            {
                serviceBase = Class.forName (serviceBaseName);
            }
            catch (ClassNotFoundException exc)
            {
                if (context != null)
                    context.log ("ServiceManager: A service with name " + serviceBaseName + " cannot be found.");

                continue;
            }

            String serviceImplName = props.getString (serviceBaseName);

            Class serviceImpl = null;

            Service service = null;

            try
            {
                serviceImpl = Class.forName (serviceImplName);

                service = (Service) serviceImpl.newInstance ();

                Properties serviceProps = new Properties ();

                try
                {
                    InputStream is = null;

                    is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceImpl) + ".properties");

                    if (is == null)
                        is = context.getResourceAsStream (aServiceConfigDir + StringUtils.nameOf (serviceBase) + ".properties");

                    if (is != null)
                        serviceProps.load (is);
                }
                catch (IOException exc)
                {
                    // ignore -- we go without properties then
                }
View Full Code Here

        context = aConfig.getServletContext();
       if (context != null)
         context.log("ServiceManager: HOTHOT Loading service: "+theService);
       Properties props = new Properties();
       try {
        props.load(context.getResourceAsStream(aServiceConfigFile));
       } catch (IOException exc) {
         if (context != null)
           context.log("ServiceManager: File \"" + aServiceConfigFile
               + "\" cannot be found or read.");
         throw new Exception("ServiceManager: File \"" + aServiceConfigFile
             + "\" cannot be found or read.");
       }
       int numAll = 0;
       int numSuccessful = 0;
      for (Iterator iter = props.names(); iter.hasNext();) {
         String serviceBaseName = (String) iter.next();
         if (serviceBaseName.equals(theService)) {
           context.log("ServiceManager: Service "+theService+" FOUND!!");
           numAll++;
           // ty to get hold of the base service
           Class serviceBase;
           try {
             serviceBase = Class.forName(serviceBaseName);
           } catch (ClassNotFoundException exc) {
             if (context != null)
              context.log("ServiceManager: A service with name "
              + serviceBaseName + " cannot be found.");
             continue;
           }
           String serviceImplName = props.getString(serviceBaseName);
           Class serviceImpl = null;
           Service service = null;
           try {
             serviceImpl = Class.forName(serviceImplName);
             service = (Service) serviceImpl.newInstance();
             Properties serviceProps = new Properties();
             try {
               InputStream is = null;
               is = context.getResourceAsStream(aServiceConfigDir
              + StringUtils.nameOf(serviceImpl)
              + ".properties");
               if (is == null)
                 is = context.getResourceAsStream(aServiceConfigDir
              + StringUtils.nameOf(serviceBase)
              + ".properties");
               if (is != null)
                serviceProps.load(is);
             } catch (IOException exc) {
               // ignore -- we go without properties then
             }
             if (context != null)
              context.log(StringUtils.nameOf(serviceBase)
View Full Code Here

TOP

Related Classes of org.apache.pluto.portalImpl.util.Properties

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.