Package org.apache.synapse.commons

Examples of org.apache.synapse.commons.SynapseCommonsException


            }

            return new InitialContext(jndiEnv);

        } catch (NamingException e) {
            throw new SynapseCommonsException("Error creating a InitialContext" +
                    " with JNDI env jndiProperties : " + jndiEnv, log);
        }
    }
View Full Code Here


    private void assertInitialized() {
        if (!initialized) {
            String msg = "Data source repository holder has not been initialized";
            log.error(msg);
            throw new SynapseCommonsException(msg);
        }
    }
View Full Code Here

     * @return DataSource if found , otherwise null
     */
    public DataSource find(String name) {
        assertInitialized();
        if (name == null || "".equals(name)) {
            throw new SynapseCommonsException("DataSource name cannot be found.", log);
        }
        return dataSourceRepositoryManager.getDataSource(name);
    }
View Full Code Here

        return dataSourceRepositoryManager.getDataSource(name);
    }

    private void assertInitialized() {
        if (!initialized) {
            throw new SynapseCommonsException("RepositoryBasedDataSourceFinder has not been " +
                    "initialized with a 'DataSourceRepositoryManager' instance ", log);
        }
    }
View Full Code Here

     * @see DataSourceRepository#register(DataSourceInformation)
     */
    public void register(DataSourceInformation dataSourceInformation) {

        if (dataSourceInformation == null) {
            throw new SynapseCommonsException("DataSourceInformation cannot be found.", log);
        }

        DataSource dataSource = DataSourceFactory.createDataSource(dataSourceInformation);

        if (dataSource == null) {
View Full Code Here

    }

    public void unRegister(String name) {

        if (name == null || "".equals(name)) {
            throw new SynapseCommonsException("Name of the datasource to be removed is empty or " +
                    "null", log);
        }

        dataSources.remove(name);
        REPOSITORY.removeMBean(name);
View Full Code Here

     * @see DataSourceRepository#lookUp(String)
     */
    public DataSource lookUp(String name) {

        if (name == null || "".equals(name)) {
            throw new SynapseCommonsException("Name of the datasource to be looked up is empty or" +
                    "null", log);
        }

        return dataSources.get(name);
    }
View Full Code Here

     * @param dataSourceInformation <code>DataSourceInformation</code> instance
     */
    public void addDataSourceInformation(DataSourceInformation dataSourceInformation) {

        if (dataSourceInformation == null) {
            throw new SynapseCommonsException("DataSource information is null", log);
        }

        // Sets the global secret resolver
        SecretInformation secretInformation = dataSourceInformation.getSecretInformation();
        if (secretInformation != null) {
View Full Code Here

     *         , returns null
     */
    public DataSourceInformation getDataSourceInformation(String name) {

        if (name == null || "".equals(name)) {
            throw new SynapseCommonsException("Name of the datasource information instance to be " +
                    "returned is null", log);
        }

        return dataSourceInformationMap.get(name);
    }
View Full Code Here

     * @return removed DataSourceInformation instance
     */
    public DataSourceInformation removeDataSourceInformation(String name) {

        if (name == null || "".equals(name)) {
            throw new SynapseCommonsException("Name of the datasource information instance to be" +
                    " removed is null", log);

        }

        DataSourceInformation information = dataSourceInformationMap.remove(name);

        if (information == null) {
            throw new SynapseCommonsException("There is no datasource information instance" +
                    " for given name :" + name, log);

        }

        if (assertListerNotNull()) {
View Full Code Here

TOP

Related Classes of org.apache.synapse.commons.SynapseCommonsException

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.