Examples of ProxoolException


Examples of org.logicalcobwebs.proxool.ProxoolException

    public static void configure(String filename) throws ProxoolException {
        Properties properties = new Properties();
        try {
            properties.load(new FileInputStream(filename));
        } catch (IOException e) {
            throw new ProxoolException("Couldn't load property file " + filename);
        }
        configure(properties);
    }
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

            String value = properties.getProperty(key);

            if (key.startsWith(PREFIX)) {
                int a = key.indexOf(DOT);
                if (a == -1) {
                    throw new ProxoolException("Property " + key + " must be of the format " + EXAMPLE_FORMAT);
                }
                final String tag = key.substring(0, a);
                final String name = key.substring(a + 1);
                proxoolProperties = (Properties) propertiesMap.get(tag);
                if (proxoolProperties == null) {
                    proxoolProperties = new Properties();
                    propertiesMap.put(tag, proxoolProperties);
                }
                proxoolProperties.put(name, value);
            }
        }

        final Iterator tags = propertiesMap.keySet().iterator();
        while (tags.hasNext()) {
            proxoolProperties = (Properties) propertiesMap.get(tags.next());
            // make sure that required propeties are defined
            // and build the url
            // Check that we have defined the minimum information
            final String driverClass = proxoolProperties.getProperty(ProxoolConstants.DRIVER_CLASS_PROPERTY);
            final String driverUrl = proxoolProperties.getProperty(ProxoolConstants.DRIVER_URL_PROPERTY);
            if (driverClass == null || driverUrl == null) {
                throw new ProxoolException("You must define the " + ProxoolConstants.DRIVER_CLASS_PROPERTY + " and the "
                    + ProxoolConstants.DRIVER_URL_PROPERTY + ".");
            }
            final String alias = proxoolProperties.getProperty(ProxoolConstants.ALIAS_PROPERTY);

            // Build the URL; optionally defining a name
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

            if (LOG.isDebugEnabled()) {
                LOG.debug("Configuring from xml file: " + xmlFileName);
            }
            configure(new InputSource(new FileReader(xmlFileName)), validate);
        } catch (FileNotFoundException e) {
            throw new ProxoolException(e);
        }
    }
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

            xmlReader.setErrorHandler(xmlConfigurator);
            setSAXFeature(xmlReader, "http://xml.org/sax/features/namespaces", NAMESPACE_AWARE);
            setSAXFeature(xmlReader, "http://xml.org/sax/features/namespace-prefixes", !NAMESPACE_AWARE);
            saxParser.parse(inputSource, xmlConfigurator);
        } catch (ParserConfigurationException pce) {
            throw new ProxoolException("Parser configuration failed", pce);
        } catch (SAXException se) {
            throw new ProxoolException("Parsing failed.", se);
        } catch (IOException ioe) {
            throw new ProxoolException("Parsing failed.", ioe);
        }
    }
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

    /**
     * @see javax.management.MBeanRegistration#preRegister(javax.management.MBeanServer, javax.management.ObjectName)
     */
    public ObjectName preRegister(MBeanServer mBeanServer, ObjectName objectName) throws Exception {
        if (objectName == null) {
            throw new ProxoolException("objectName was null, but we can not construct an MBean instance without knowing"
                    + " the pool alias.");
        }
        return objectName;
    }
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

            nextRollDate.clear(Calendar.HOUR_OF_DAY);
            nextRollDate.clear(Calendar.MINUTE);
            nextRollDate.clear(Calendar.SECOND);
            nextRollDate.clear(Calendar.MILLISECOND);
        } else {
            throw new ProxoolException("Unrecognised suffix in statistics: " + token);
        }

        period = Integer.parseInt(token.substring(0, token.length() - 1));

        // Now roll forward until you get one step into the future
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

        jndiProperties.remove(ProxoolConstants.JNDI_NAME);
        try {
            InitialContext initalContext = new InitialContext(jndiProperties);
            initalContext.rebind(jndiName, dataSource);
        } catch (NamingException e) {
            throw new ProxoolException("JNDI binding of DataSource for alias " + alias
                + " failed.", e);
        }
    }
View Full Code Here

Examples of org.logicalcobwebs.proxool.ProxoolException

                    }
                }
            }
            // Success?
            if (concreteMethod == null) {
                throw new ProxoolException("Couldn't match injectable method " + injectableMethod + " with any of those " +
                        "found in " + concreteClass.getName());
            }
            // Remember it
            cachedConcreteMethods.put(injectableMethod, concreteMethod);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.