Package org.apache.synapse.config

Examples of org.apache.synapse.config.Entry


        boolean reLoad = false;
        boolean needBind = false;
        XQResultSequence resultSequence;

        Entry dp = synCtx.getConfiguration().getEntryDefinition(queryKey);
        // if the queryKey refers to a dynamic resource
        if (dp != null && dp.isDynamic()) {
            if (!dp.isCached() || dp.isExpired()) {
                reLoad = true;
            }
        }

        try {
View Full Code Here


            }
            return;
        }

        // build transformer - if necessary
        Entry dp = synCtx.getConfiguration().getEntryDefinition(xsltKey);

        // if the xsltKey refers to a dynamic resource
        if (dp != null && dp.isDynamic()) {
            if (!dp.isCached() || dp.isExpired()) {
                reCreate = true;
            }
        }

        synchronized (transformerLock) {
View Full Code Here

        SynapseConfiguration synCfg = se.getSynapseConfiguration();

        //always do reloading at init
        boolean reLoad = (realEndpoint == null);
        if (!reLoad) {
            Entry entry = synCfg.getEntryDefinition(template);
            if (entry != null && entry.isDynamic()) {
                if (!entry.isCached() || entry.isExpired()) {
                    reLoad = true;
                }
            } else {
                // this endpoint is static -->
                // since template-endpoint is static, should ONLY be loaded at initialization to prevent
View Full Code Here

            SynapseEnvironment synapseEnvironment = (SynapseEnvironment) synEnvParameter.getValue();

            boolean reLoad = (realEndpoint == null);
            if (!reLoad) {

                Entry entry = synCfg.getEntryDefinition(key);
                if (entry != null && entry.isDynamic()) {

                    if (!entry.isCached() || entry.isExpired()) {
                        reLoad = true;
                    }
                } else {
                    // If the endpoint is static we should reload it from the Synapse config
                    reLoad = true;
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("LocalEntry Deployment from file : " + fileName + " : Started");
        }

        try {
            Entry e = EntryFactory.createEntry(artifactConfig, properties);
            if (e != null) {
                e.setFileName((new File(fileName)).getName());
                if (log.isDebugEnabled()) {
                    log.debug("LocalEntry with key '" + e.getKey()
                            + "' has been built from the file " + fileName);
                }
                getSynapseConfiguration().addEntry(e.getKey(), e);
                if (log.isDebugEnabled()) {
                    log.debug("LocalEntry Deployment from file : " + fileName + " : Completed");
                }
                log.info("LocalEntry named '" + e.getKey()
                        + "' has been deployed from file : " + fileName);
                return e.getKey();
            } else {
                handleSynapseArtifactDeploymentError("LocalEntry Deployment Failed. The artifact " +
                        "described in the file " + fileName + " is not a LocalEntry");
            }
        } catch (Exception e) {
View Full Code Here

                propName = regParam[1];
            } else if (regParam.length == 1) {
                regPath = regParam[0];
            }

            Entry propEntry = synCtx.getConfiguration().getEntryDefinition(regPath);
            if (propEntry == null) {
                propEntry = new Entry();
                propEntry.setType(Entry.REMOTE_ENTRY);
                propEntry.setKey(key);
            }
            Registry registry = synCtx.getConfiguration().getRegistry();
            if (registry != null) {
                registry.getResource(propEntry, new Properties());
                if (propName != null) {
                    Properties reqProperties = propEntry.getEntryProperties();
                    if (reqProperties != null) {
                        if (reqProperties.get(propName) != null) {
                            return reqProperties.getProperty(propName);
                        }
                    }
                } else if (propEntry.getValue() != null) {
                    if (propEntry.getValue() instanceof OMText) {
                        OMText omText = (OMText) propEntry.getValue();
                        DataHandler dh = (DataHandler) omText.getDataHandler();
                        if (omText.getDataHandler() != null) {
                            try {
                                InputStreamReader streamReader = new InputStreamReader(dh.getInputStream());
                                BufferedReader stringReader = new BufferedReader(streamReader);
                                String omTextString = NULL_STRING;
                                String tempStr;
                                while ((tempStr = stringReader.readLine()) != null) {
                                    omTextString = omTextString + tempStr;
                                }
                                return omTextString;
                            } catch (IOException e) {
                                return NULL_STRING;
                            }
                        } else {
                            omText.getText();
                        }
                    }
                    return propEntry.getValue().toString();
                }
            }
        } else {
            if (traceOrDebugOn) {
                traceOrDebug(traceOn, "Invalid scope : '" + scope + "' has been set for the " +
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("LocalEntry update from file : " + fileName + " has started");
        }

        try {
            Entry e = EntryFactory.createEntry(artifactConfig, properties);
            if (e == null) {
                handleSynapseArtifactDeploymentError("Local entry update failed. The artifact " +
                        "defined in the file: " + fileName + " is not a valid local entry.");
                return null;
            }
            e.setFileName(new File(fileName).getName());

            if (log.isDebugEnabled()) {
                log.debug("Local entry: " + e.getKey() + " has been built from the file: " + fileName);
            }

            if (existingArtifactName.equals(e.getKey())) {
                getSynapseConfiguration().updateEntry(existingArtifactName, e);
            } else {
                // The user has changed the name of the entry
                // We should add the updated entry as a new entry and remove the old one
                getSynapseConfiguration().addEntry(e.getKey(), e);
                getSynapseConfiguration().removeEntry(existingArtifactName);
                log.info("Local entry: " + existingArtifactName + " has been undeployed");
            }

            log.info("Endpoint: " + e.getKey() + " has been updated from the file: " + fileName);
            return e.getKey();

        } catch (DeploymentException e) {
            handleSynapseArtifactDeploymentError("Error while updating the local entry from the " +
                    "file: " + fileName);
        }
View Full Code Here

            log.debug("LocalEntry Undeployment of the entry named : "
                    + artifactName + " : Started");
        }
       
        try {
            Entry e = getSynapseConfiguration().getDefinedEntries().get(artifactName);
            if (e != null && e.getType() != Entry.REMOTE_ENTRY) {
                getSynapseConfiguration().removeEntry(artifactName);
                if (log.isDebugEnabled()) {
                    log.debug("LocalEntry Undeployment of the entry named : "
                            + artifactName + " : Completed");
                }
                log.info("LocalEntry named '" + e.getKey() + "' has been undeployed");
            } else if (log.isDebugEnabled()) {
                log.debug("Local entry " + artifactName + " has already been undeployed");
            }
        } catch (Exception e) {
            handleSynapseArtifactDeploymentError(
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("LocalEntry the Sequence with name : " + artifactName + " : Started");
        }

        try {
            Entry e = getSynapseConfiguration().getDefinedEntries().get(artifactName);
            OMElement entryElem = EntrySerializer.serializeEntry(e, null);
            if (e.getFileName() != null) {
                String fileName = getServerConfigurationInformation().getSynapseXMLLocation()
                        + File.separator + MultiXMLConfigurationBuilder.LOCAL_ENTRY_DIR
                        + File.separator + e.getFileName();
                writeToFile(entryElem, fileName);
                if (log.isDebugEnabled()) {
                    log.debug("Restoring the LocalEntry with name : " + artifactName + " : Completed");
                }
                log.info("LocalEntry named '" + artifactName + "' has been restored");
View Full Code Here

        if (cachedTemplatesMap.isEmpty() || !cachedTemplatesMap.containsKey(generatedXsltKey)) {
            // this is a creation case
            return true;
        } else {
            // build transformer - if necessary
            Entry dp = synCtx.getConfiguration().getEntryDefinition(generatedXsltKey);
            // if the xsltKey refers to a dynamic resource, and if it has been expired
            // it is a recreation case
            return dp != null && dp.isDynamic() && (!dp.isCached() || dp.isExpired());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.synapse.config.Entry

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.