Package org.apache.synapse.registry

Examples of org.apache.synapse.registry.Registry


    private void saveDynamicEndpointTemplate(String key, OMElement endpointTempalteEl) throws AxisFault {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synConfig = getSynapseConfiguration();
            Registry registry = synConfig.getRegistry();
            if (registry != null) {
                if (registry.getRegistryEntry(key).getType() == null) {
                    handleException("Unable to save the template. No resource is available " +
                            "by the key '" + key + "'");
                }
                registry.updateResource(key, endpointTempalteEl);
            } else {
                handleException("Unable to access the registry instance for the ESB");
            }
        } finally {
            lock.unlock();
View Full Code Here


        }
    }

    public void deleteDynamicSequence(String key) throws SequenceEditorException {
        SynapseConfiguration synConfig = getSynapseConfiguration();
        Registry registry = synConfig.getRegistry();
        if (registry != null) {
            if (registry.getRegistryEntry(key).getType() == null) {
                handleException("The key '" + key +
                        "' cannot be found within the configuration");
            } else {
                registry.delete(key);
            }
        } else {
            handleException("Unable to access the registry instance for the ESB");
        }
    }
View Full Code Here

    public OMElement getDynamicSequence(String key) throws SequenceEditorException {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synConfig = getSynapseConfiguration();
            Registry registry = synConfig.getRegistry();
            if (registry != null) {
                if (registry.getRegistryEntry(key).getType() == null) {
                    handleException("No resource is available by the key '" + key + "'");
                }
                return (OMElement) registry.getResource(new Entry(key),
                        getSynapseConfiguration().getProperties());
            } else {
                handleException("Unable to access the registry instance for the ESB");
            }
        } finally {
View Full Code Here

    public void saveDynamicSequence(String key, OMElement sequence) throws SequenceEditorException {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synConfig = getSynapseConfiguration();
            Registry registry = synConfig.getRegistry();
            if (registry != null) {
                if (registry.getRegistryEntry(key).getType() == null) {
                    handleException("Unable to save the sequence. No resource is available " +
                            "by the key '" + key + "'");
                }
                registry.updateResource(key, sequence);
            } else {
                handleException("Unable to access the registry instance for the ESB");
            }
        } finally {
            lock.unlock();
View Full Code Here

    public static Registry defineRegistry(SynapseConfiguration config, OMElement elem,
                                          Properties properties) {
        if (config.getRegistry() != null) {
            handleException("Only one remote registry can be defined within a configuration");
        }
        Registry registry = RegistryFactory.createRegistry(elem, properties);
        config.setRegistry(registry);
        return registry;
    }
View Full Code Here

        SequenceMediator faultSequence = (SequenceMediator)
                newSynapseConfiguration.getFaultSequence();
        faultSequence.setFileName(faultSequence.getName());

        // set the governance registry
        Registry registry = new WSO2Registry();       
        newSynapseConfiguration.setRegistry(registry);

        newSynapseConfiguration.setProperty(
                MultiXMLConfigurationBuilder.SEPARATE_REGISTRY_DEFINITION, "true");
        return newSynapseConfiguration;
View Full Code Here

        }
    }

    public void deleteDynamicTemplate(String key) throws AxisFault {
        SynapseConfiguration synConfig = getSynapseConfiguration();
        Registry registry = synConfig.getRegistry();
        if (registry != null) {
            if (registry.getRegistryEntry(key).getType() == null) {
                handleException("The key '" + key +
                        "' cannot be found within the configuration");
            } else {
                registry.delete(key);
            }
        } else {
            handleException("Unable to access the registry instance for the ESB");
        }
    }
View Full Code Here

    public OMElement getDynamicTemplate(String key) throws AxisFault {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synConfig = getSynapseConfiguration();
            Registry registry = synConfig.getRegistry();
            if (registry != null) {
                if (registry.getRegistryEntry(key).getType() == null) {
                    handleException("No resource is available by the key '" + key + "'");
                }
                return (OMElement) registry.getResource(new Entry(key),
                        getSynapseConfiguration().getProperties());
            } else {
                handleException("Unable to access the registry instance for the ESB");
            }
        } finally {
View Full Code Here

    public void saveDynamicTemplate(String key, OMElement sequence) throws AxisFault {
        final Lock lock = getLock();
        try {
            lock.lock();
            SynapseConfiguration synConfig = getSynapseConfiguration();
            Registry registry = synConfig.getRegistry();
            if (registry != null) {
                if (registry.getRegistryEntry(key).getType() == null) {
                    handleException("Unable to save the template. No resource is available " +
                            "by the key '" + key + "'");
                }
                registry.updateResource(key, sequence);
            } else {
                handleException("Unable to access the registry instance for the ESB");
            }
        } finally {
            lock.unlock();
View Full Code Here

        if (name == null) {
            log.warn("Name of the configuration item is not given");
            return;
        }

        Registry registry = getObjectToPersist(name, config);
        if (registry == null) {
            log.warn("Unable to find the Synapse registry for persistence");
            return;
        }
View Full Code Here

TOP

Related Classes of org.apache.synapse.registry.Registry

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.