synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruwan Linton <ruwan.lin...@gmail.com>
Subject Re: svn commit: r909246 - in /synapse/branches/1.3/modules: core/ core/src/main/java/org/apache/synapse/deployers/ core/src/main/java/org/apache/synapse/endpoints/ extensions/src/main/java/org/apache/synapse/mediators/bsf/ extensions/src/test/java/or
Date Mon, 08 Mar 2010 04:28:11 GMT
Andreas,

Ohh, that was a mistake. Thanks for pointing this.

Reverted those two classes.

Thanks,
Ruwan

On Mon, Mar 8, 2010 at 12:22 AM, Andreas Veithen
<andreas.veithen@gmail.com>wrote:

> Ruwan,
>
> Did you include the changes in ScriptMediatorTest and
> HttpCoreNIOListenerTest intentionally or was that a mistake? These
> changes seem to be completely unrelated to hot deployment. Please note
> that the change in HttpCoreNIOListenerTest causes a build failure in
> Hudson (or locally when executed with the "hudson" profile).
>
> Andreas
>
> On Fri, Feb 12, 2010 at 06:36,  <ruwan@apache.org> wrote:
> > Author: ruwan
> > Date: Fri Feb 12 05:36:37 2010
> > New Revision: 909246
> >
> > URL: http://svn.apache.org/viewvc?rev=909246&view=rev
> > Log:
> > Adding hot deployment into the 1.3 branch
> >
> > Added:
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/AbstractSynapseArtifactDeployer.java
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EndpointDeployer.java
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EventSourceDeployer.java
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/LocalEntryDeployer.java
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/ProxyServiceDeployer.java
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/SequenceDeployer.java
> > Modified:
> >    synapse/branches/1.3/modules/core/pom.xml
> >
>  synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/endpoints/Endpoint.java
> >
>  synapse/branches/1.3/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
> >
>  synapse/branches/1.3/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
> >    synapse/branches/1.3/modules/transports/core/nhttp/pom.xml
> >
>  synapse/branches/1.3/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
> >
> > Modified: synapse/branches/1.3/modules/core/pom.xml
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/pom.xml?rev=909246&r1=909245&r2=909246&view=diff
> >
> ==============================================================================
> > --- synapse/branches/1.3/modules/core/pom.xml (original)
> > +++ synapse/branches/1.3/modules/core/pom.xml Fri Feb 12 05:36:37 2010
> > @@ -138,6 +138,7 @@
> >                         <Export-Package>
> >                             org.apache.synapse,
> >                             org.apache.synapse.aspects.*,
> > +                            org.apache.synapse.deployers.*,
> >                             org.apache.synapse.config.*,
> >                             org.apache.synapse.core.*,
> >                             org.apache.synapse.endpoints.*,
> >
> > Added:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/AbstractSynapseArtifactDeployer.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/AbstractSynapseArtifactDeployer.java?rev=909246&view=auto
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/AbstractSynapseArtifactDeployer.java
> (added)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/AbstractSynapseArtifactDeployer.java
> Fri Feb 12 05:36:37 2010
> > @@ -0,0 +1,170 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one
> > + *  or more contributor license agreements.  See the NOTICE file
> > + *  distributed with this work for additional information
> > + *  regarding copyright ownership.  The ASF licenses this file
> > + *  to you under the Apache License, Version 2.0 (the
> > + *  "License"); you may not use this file except in compliance
> > + *  with the License.  You may obtain a copy of the License at
> > + *
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing,
> > + *  software distributed under the License is distributed on an
> > + *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + *  KIND, either express or implied.  See the License for the
> > + *  specific language governing permissions and limitations
> > + *  under the License.
> > + */
> > +
> > +package org.apache.synapse.deployers;
> > +
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.axiom.om.OMException;
> > +import org.apache.axiom.om.impl.builder.StAXOMBuilder;
> > +import org.apache.axiom.om.util.StAXUtils;
> > +import org.apache.axis2.context.ConfigurationContext;
> > +import org.apache.axis2.deployment.Deployer;
> > +import org.apache.axis2.deployment.DeploymentException;
> > +import org.apache.axis2.deployment.repository.util.DeploymentFileData;
> > +import org.apache.axis2.description.Parameter;
> > +import org.apache.synapse.SynapseConstants;
> > +import org.apache.synapse.config.SynapseConfiguration;
> > +import org.apache.synapse.core.SynapseEnvironment;
> > +
> > +import javax.xml.stream.XMLStreamException;
> > +import java.io.FileInputStream;
> > +import java.io.IOException;
> > +import java.io.InputStream;
> > +import java.util.HashMap;
> > +import java.util.Map;
> > +
> > +/**
> > + * Implements the generic logic for the synapse artifact deployment and
> provide a deployment framework
> > + * for the synapse.</p>
> > + *
> > + * <p>Any  synapse artifact which requires the hot deployment or hot
> update features should extend this and
> > + * just needs to concentrate on the deployment logic. By default setting
> the file extension and directory dynamically
> > + * is not supported.
> > + *
> > + * @see org.apache.axis2.deployment.Deployer
> > + */
> > +public abstract class AbstractSynapseArtifactDeployer implements
> Deployer {
> > +
> > +    protected ConfigurationContext cfgCtx;
> > +
> > +    /**
> > +     * Keeps track of the deployed artifacts in the synapse environment
> > +     */
> > +    private Map<String, String> fileName2ArtifactName = new
> HashMap<String, String>();
> > +
> > +    /**
> > +     * Initializes the Synapse artifact deployment
> > +     *
> > +     * @param configCtx Axis2 ConfigurationContext
> > +     */
> > +    public void init(ConfigurationContext configCtx) {
> > +        this.cfgCtx = configCtx;
> > +    }
> > +
> > +    /**
> > +     *  This method is called by the axis2 deployment framework and it
> performs a synapse artifact specific
> > +     * yet common across all the artifacts, set of tasks and delegate
> the actual deployment to the respective
> > +     * artifact deployers.
> > +     *
> > +     * @param deploymentFileData file to be used for the deployment
> > +     * @throws DeploymentException incase of an error in deploying the
> file
> > +     *
> > +     * @see
> org.apache.synapse.deployers.AbstractSynapseArtifactDeployer#deploySynapseArtifact(
> > +     * org.apache.axiom.om.OMElement, String)
> > +     */
> > +    public void deploy(DeploymentFileData deploymentFileData) throws
> DeploymentException {
> > +        String filename = deploymentFileData.getAbsolutePath();
> > +        try {
> > +            InputStream in = new FileInputStream(filename);
> > +            try {
> > +                // construct the xml element from the file, it has to be
> XML,
> > +                // since all synapse artifacts are XML based
> > +                OMElement element = new StAXOMBuilder(
> > +
>  StAXUtils.createXMLStreamReader(in)).getDocumentElement();
> > +                String artifatcName = deploySynapseArtifact(element,
> filename);
> > +                if (artifatcName != null) {
> > +                    fileName2ArtifactName.put(filename, artifatcName);
> > +                }
> > +            } finally {
> > +                in.close();
> > +            }
> > +        } catch (IOException ex) {
> > +            throw new DeploymentException("Error reading "
> > +                    + filename + " : " + ex.getMessage(), ex);
> > +        } catch (XMLStreamException ex) {
> > +            throw new DeploymentException("Error parsing "
> > +                    + filename + " : " + ex.getMessage(), ex);
> > +        } catch (OMException ex) {
> > +            throw new DeploymentException("Error parsing "
> > +                    + filename + " : " + ex.getMessage(), ex);
> > +        }
> > +    }
> > +
> > +    /**
> > +     * This is the method called by the axis2 framework for undeployment
> of the artifacts. As in the deploy
> > +     * case this performs some common tasks across all the synapse
> artifacts and fall back to the artifact
> > +     * specific logic of undeployment.
> > +     *
> > +     * @param fileName file describing the artifact to be undeployed
> > +     * @throws DeploymentException in case of an error in undeployment
> > +     *
> > +     * @see
> org.apache.synapse.deployers.AbstractSynapseArtifactDeployer#undeploySynapseArtifact(String)
> > +     */
> > +    public void unDeploy(String fileName) throws DeploymentException {
> > +        undeploySynapseArtifact(fileName2ArtifactName.get(fileName));
> > +        fileName2ArtifactName.remove(fileName);
> > +    }
> > +
> > +    // We do not support dynamically setting the directory nor the
> extension
> > +    public void setDirectory(String directory) {}
> > +    public void setExtension(String extension) {}
> > +
> > +    /**
> > +     * All synapse artifact deployers MUST implement this method and it
> handles artifact specific deployment
> > +     * tasks of those artifacts.
> > +     *
> > +     * @param artifactConfig built element representing the artifact to
> be deployed loaded from the file
> > +     * @param fileName file name from which this artifact is being
> loaded
> > +     * @return String artifact name created by the deployment task
> > +     *
> > +     * @see
> org.apache.synapse.deployers.AbstractSynapseArtifactDeployer#deploy(
> > +     * org.apache.axis2.deployment.repository.util.DeploymentFileData)
> > +     */
> > +    public abstract String deploySynapseArtifact(OMElement
> artifactConfig, String fileName);
> > +
> > +    /**
> > +     * All synapse artifact deployers MUST implement this method and it
> handles artifact specific undeployment
> > +     * tasks of those artifacts.
> > +     *
> > +     * @param artifactName name of the artifact to be undeployed
> > +     *
> > +     * @see
> org.apache.synapse.deployers.AbstractSynapseArtifactDeployer#unDeploy(String)
> > +     */
> > +    public abstract void undeploySynapseArtifact(String artifactName);
> > +
> > +    protected SynapseConfiguration getSynapseConfiguration() throws
> DeploymentException {
> > +        Parameter synCfgParam =
> > +
>  cfgCtx.getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_CONFIG);
> > +        if (synCfgParam == null) {
> > +            throw new DeploymentException("SynapseConfiguration not
> found. " +
> > +                    "Are you sure that you are running Synapse?");
> > +        }
> > +        return (SynapseConfiguration) synCfgParam.getValue();
> > +    }
> > +
> > +    protected SynapseEnvironment getSynapseEnvironment() throws
> DeploymentException {
> > +        Parameter synCfgParam =
> > +
>  cfgCtx.getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_ENV);
> > +        if (synCfgParam == null) {
> > +            throw new DeploymentException("SynapseEnvironment not found.
> " +
> > +                    "Are you sure that you are running Synapse?");
> > +        }
> > +        return (SynapseEnvironment) synCfgParam.getValue();
> > +    }
> > +}
> >
> > Added:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EndpointDeployer.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EndpointDeployer.java?rev=909246&view=auto
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EndpointDeployer.java
> (added)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EndpointDeployer.java
> Fri Feb 12 05:36:37 2010
> > @@ -0,0 +1,99 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one
> > + *  or more contributor license agreements.  See the NOTICE file
> > + *  distributed with this work for additional information
> > + *  regarding copyright ownership.  The ASF licenses this file
> > + *  to you under the Apache License, Version 2.0 (the
> > + *  "License"); you may not use this file except in compliance
> > + *  with the License.  You may obtain a copy of the License at
> > + *
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing,
> > + *  software distributed under the License is distributed on an
> > + *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + *  KIND, either express or implied.  See the License for the
> > + *  specific language governing permissions and limitations
> > + *  under the License.
> > + */
> > +
> > +package org.apache.synapse.deployers;
> > +
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.commons.logging.Log;
> > +import org.apache.commons.logging.LogFactory;
> > +import org.apache.synapse.config.xml.endpoints.EndpointFactory;
> > +import org.apache.synapse.endpoints.Endpoint;
> > +
> > +/**
> > + *  Handles the <code>Endpoint</code> deployment and undeployment tasks
> > + *
> > + * @see org.apache.synapse.deployers.AbstractSynapseArtifactDeployer
> > + */
> > +public class EndpointDeployer extends AbstractSynapseArtifactDeployer {
> > +
> > +    private static Log log = LogFactory.getLog(EndpointDeployer.class);
> > +
> > +    @Override
> > +    public String deploySynapseArtifact(OMElement artifactConfig, String
> fileName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("Endpoint Deployment from file : " + fileName + "
> : Started");
> > +        }
> > +
> > +        try {
> > +            Endpoint ep =
> EndpointFactory.getEndpointFromElement(artifactConfig, false);
> > +            if (ep != null) {
> > +                ep.setFileName(fileName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Endpoint named '" + ep.getName()
> > +                            + "' has been built from the file " +
> fileName);
> > +                }
> > +                ep.init(getSynapseEnvironment());
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Initialized the endpoint : " +
> ep.getName());
> > +                }
> > +                getSynapseConfiguration().addEndpoint(ep.getName(), ep);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Endpoint Deployment from file : " +
> fileName + " : Completed");
> > +                }
> > +                return ep.getName();
> > +            } else {
> > +                log.error("Endpoint Deployment Failed. The artifact
> described in the file "
> > +                        + fileName + " is not an Endpoint");
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("Endpoint Deployment from the file : " + fileName
> + " : Failed.", e);
> > +        }
> > +
> > +        return null;
> > +    }
> > +
> > +    @Override
> > +    public void undeploySynapseArtifact(String artifactName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("Endpoint Undeployment of the endpoint named : "
> > +                    + artifactName + " : Started");
> > +        }
> > +
> > +        try {
> > +            Endpoint ep =
> getSynapseConfiguration().getDefinedEndpoints().get(artifactName);
> > +            if (ep != null) {
> > +                getSynapseConfiguration().removeEndpoint(artifactName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Destroying the endpoint named : " +
> artifactName);
> > +                }
> > +                ep.destroy();
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Endpoint Undeployment of the endpoint
> named : "
> > +                            + artifactName + " : Completed");
> > +                }
> > +            } else {
> > +                log.error("Couldn't find the endpoint named : " +
> artifactName);
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("Endpoint Undeployement of endpoint named : " +
> artifactName + " : Failed");
> > +        }
> > +    }
> > +}
> >
> > Added:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EventSourceDeployer.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EventSourceDeployer.java?rev=909246&view=auto
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EventSourceDeployer.java
> (added)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/EventSourceDeployer.java
> Fri Feb 12 05:36:37 2010
> > @@ -0,0 +1,96 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one
> > + *  or more contributor license agreements.  See the NOTICE file
> > + *  distributed with this work for additional information
> > + *  regarding copyright ownership.  The ASF licenses this file
> > + *  to you under the Apache License, Version 2.0 (the
> > + *  "License"); you may not use this file except in compliance
> > + *  with the License.  You may obtain a copy of the License at
> > + *
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing,
> > + *  software distributed under the License is distributed on an
> > + *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + *  KIND, either express or implied.  See the License for the
> > + *  specific language governing permissions and limitations
> > + *  under the License.
> > + */
> > +
> > +package org.apache.synapse.deployers;
> > +
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.commons.logging.Log;
> > +import org.apache.commons.logging.LogFactory;
> > +import org.apache.synapse.config.xml.eventing.EventSourceFactory;
> > +import org.apache.synapse.eventing.SynapseEventSource;
> > +
> > +/**
> > + *  Handles the <code>EventSource</code> deployment and undeployment
> tasks
> > + *
> > + * @see org.apache.synapse.deployers.AbstractSynapseArtifactDeployer
> > + */
> > +public class EventSourceDeployer extends AbstractSynapseArtifactDeployer
> {
> > +
> > +    private static Log log = LogFactory.getLog(SequenceDeployer.class);
> > +
> > +    @Override
> > +    public String deploySynapseArtifact(OMElement artifactConfig, String
> fileName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("EventSource Deployment from file : " + fileName +
> " : Started");
> > +        }
> > +
> > +        try {
> > +            SynapseEventSource es =
> EventSourceFactory.createEventSource(artifactConfig);
> > +            if (es != null) {
> > +                es.setFileName(fileName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("EventSource named '" + es.getName()
> > +                            + "' has been built from the file " +
> fileName);
> > +                }
> > +
>  es.buildService(getSynapseConfiguration().getAxisConfiguration());
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Initialized the EventSource : " +
> es.getName());
> > +                }
> > +                getSynapseConfiguration().addEventSource(es.getName(),
> es);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("EventSource Deployment from file : " +
> fileName + " : Completed");
> > +                }
> > +                return es.getName();
> > +            } else {
> > +                log.error("EventSource Deployment Failed. The artifact
> described in the file "
> > +                        + fileName + " is not an EventSource");
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("EventSource Deployment from the file : " +
> fileName + " : Failed.", e);
> > +        }
> > +
> > +        return null;
> > +    }
> > +
> > +    @Override
> > +    public void undeploySynapseArtifact(String artifactName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("EventSource Undeployment of the sequence named :
> "
> > +                    + artifactName + " : Started");
> > +        }
> > +
> > +        try {
> > +            SynapseEventSource es =
> getSynapseConfiguration().getEventSource(artifactName);
> > +            if (es != null) {
> > +
>  getSynapseConfiguration().removeEventSource(artifactName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("EventSource Undeployment of the
> EventSource named : "
> > +                            + artifactName + " : Completed");
> > +                }
> > +            } else {
> > +                log.error("Couldn't find the EventSource named : " +
> artifactName);
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("EventSource Undeployement of EventSource named :
> "
> > +                    + artifactName + " : Failed");
> > +        }
> > +    }
> > +}
> >
> > Added:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/LocalEntryDeployer.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/LocalEntryDeployer.java?rev=909246&view=auto
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/LocalEntryDeployer.java
> (added)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/LocalEntryDeployer.java
> Fri Feb 12 05:36:37 2010
> > @@ -0,0 +1,91 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one
> > + *  or more contributor license agreements.  See the NOTICE file
> > + *  distributed with this work for additional information
> > + *  regarding copyright ownership.  The ASF licenses this file
> > + *  to you under the Apache License, Version 2.0 (the
> > + *  "License"); you may not use this file except in compliance
> > + *  with the License.  You may obtain a copy of the License at
> > + *
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing,
> > + *  software distributed under the License is distributed on an
> > + *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + *  KIND, either express or implied.  See the License for the
> > + *  specific language governing permissions and limitations
> > + *  under the License.
> > + */
> > +
> > +package org.apache.synapse.deployers;
> > +
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.commons.logging.Log;
> > +import org.apache.commons.logging.LogFactory;
> > +import org.apache.synapse.config.Entry;
> > +import org.apache.synapse.config.xml.EntryFactory;
> > +
> > +/**
> > + *  Handles the <code>LocalEntry</code> deployment and undeployment
> tasks
> > + *
> > + * @see org.apache.synapse.deployers.AbstractSynapseArtifactDeployer
> > + */
> > +public class LocalEntryDeployer extends AbstractSynapseArtifactDeployer
> {
> > +
> > +    private static Log log =
> LogFactory.getLog(LocalEntryDeployer.class);
> > +
> > +    @Override
> > +    public String deploySynapseArtifact(OMElement artifactConfig, String
> fileName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("LocalEntry Deployment from file : " + fileName +
> " : Started");
> > +        }
> > +
> > +        try {
> > +            Entry e = EntryFactory.createEntry(artifactConfig);
> > +            if (e != null) {
> > +                e.setFileName(fileName);
> > +                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");
> > +                }
> > +                return e.getKey();
> > +            } else {
> > +                log.error("LocalEntry Deployment Failed. The artifact
> described in the file "
> > +                        + fileName + " is not a LocalEntry");
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("LocalEntry Deployment from the file : " +
> fileName + " : Failed.", e);
> > +        }
> > +
> > +        return null;
> > +    }
> > +
> > +    @Override
> > +    public void undeploySynapseArtifact(String artifactName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            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");
> > +                }
> > +            } else {
> > +                log.error("Couldn't find the LocalEntry named : " +
> artifactName);
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("LocalEntry Undeployement of entry named : " +
> artifactName + " : Failed");
> > +        }
> > +    }
> > +}
> >
> > Added:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/ProxyServiceDeployer.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/ProxyServiceDeployer.java?rev=909246&view=auto
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/ProxyServiceDeployer.java
> (added)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/ProxyServiceDeployer.java
> Fri Feb 12 05:36:37 2010
> > @@ -0,0 +1,119 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one
> > + *  or more contributor license agreements.  See the NOTICE file
> > + *  distributed with this work for additional information
> > + *  regarding copyright ownership.  The ASF licenses this file
> > + *  to you under the Apache License, Version 2.0 (the
> > + *  "License"); you may not use this file except in compliance
> > + *  with the License.  You may obtain a copy of the License at
> > + *
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing,
> > + *  software distributed under the License is distributed on an
> > + *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + *  KIND, either express or implied.  See the License for the
> > + *  specific language governing permissions and limitations
> > + *  under the License.
> > + */
> > +
> > +package org.apache.synapse.deployers;
> > +
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.commons.logging.Log;
> > +import org.apache.commons.logging.LogFactory;
> > +import org.apache.synapse.ManagedLifecycle;
> > +import org.apache.synapse.config.xml.ProxyServiceFactory;
> > +import org.apache.synapse.core.axis2.ProxyService;
> > +
> > +/**
> > + *  Handles the <code>ProxyService</code> deployment and undeployment
> tasks
> > + *
> > + * @see org.apache.synapse.deployers.AbstractSynapseArtifactDeployer
> > + */
> > +public class ProxyServiceDeployer extends
> AbstractSynapseArtifactDeployer {
> > +
> > +    private static Log log = LogFactory.getLog(SequenceDeployer.class);
> > +
> > +    @Override
> > +    public String deploySynapseArtifact(OMElement artifactConfig, String
> fileName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("ProxyService Deployment from file : " + fileName
> + " : Started");
> > +        }
> > +
> > +        try {
> > +            ProxyService proxy =
> ProxyServiceFactory.createProxy(artifactConfig);
> > +            if (proxy != null) {
> > +                proxy.setFileName(fileName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("ProxyService named '" + proxy.getName()
> > +                            + "' has been built from the file " +
> fileName);
> > +                }
> > +
> > +                if (proxy.getTargetInLineEndpoint() instanceof
> ManagedLifecycle) {
> > +
>  proxy.getTargetInLineEndpoint().init(getSynapseEnvironment());
> > +                }
> > +                if (proxy.getTargetInLineInSequence() != null) {
> > +
>  proxy.getTargetInLineInSequence().init(getSynapseEnvironment());
> > +                }
> > +                if (proxy.getTargetInLineOutSequence() != null) {
> > +
>  proxy.getTargetInLineOutSequence().init(getSynapseEnvironment());
> > +                }
> > +                if (proxy.getTargetInLineFaultSequence() != null) {
> > +
>  proxy.getTargetInLineFaultSequence().init(getSynapseEnvironment());
> > +                }
> > +
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Initialized the ProxyService : " +
> proxy.getName());
> > +                }
> > +
> > +                proxy.buildAxisService(getSynapseConfiguration(),
> > +
>  getSynapseConfiguration().getAxisConfiguration());
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Started the ProxyService : " +
> proxy.getName());
> > +                }
> > +
>  getSynapseConfiguration().addProxyService(proxy.getName(), proxy);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("ProxyService Deployment from file : " +
> fileName + " : Completed");
> > +                }
> > +                return proxy.getName();
> > +            } else {
> > +                log.error("ProxyService Deployment Failed. The artifact
> described in the file "
> > +                        + fileName + " is not a ProxyService");
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("ProxyService Deployment from the file : " +
> fileName + " : Failed.", e);
> > +        }
> > +
> > +        return null;
> > +    }
> > +
> > +    @Override
> > +    public void undeploySynapseArtifact(String artifactName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("ProxyService Undeployment of the proxy named : "
> > +                    + artifactName + " : Started");
> > +        }
> > +
> > +        try {
> > +            ProxyService proxy =
> getSynapseConfiguration().getProxyService(artifactName);
> > +            if (proxy != null) {
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Stopping the ProxyService named : " +
> artifactName);
> > +                }
> > +                proxy.stop(getSynapseConfiguration());
> > +
>  getSynapseConfiguration().removeProxyService(artifactName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("ProxyService Undeployment of the proxy
> named : "
> > +                            + artifactName + " : Completed");
> > +                }
> > +            } else {
> > +                log.error("Couldn't find the ProxyService named : " +
> artifactName);
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("ProxyService Undeployement of proxy named : " +
> artifactName + " : Failed");
> > +        }
> > +    }
> > +}
> >
> > Added:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/SequenceDeployer.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/SequenceDeployer.java?rev=909246&view=auto
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/SequenceDeployer.java
> (added)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/deployers/SequenceDeployer.java
> Fri Feb 12 05:36:37 2010
> > @@ -0,0 +1,102 @@
> > +/*
> > + *  Licensed to the Apache Software Foundation (ASF) under one
> > + *  or more contributor license agreements.  See the NOTICE file
> > + *  distributed with this work for additional information
> > + *  regarding copyright ownership.  The ASF licenses this file
> > + *  to you under the Apache License, Version 2.0 (the
> > + *  "License"); you may not use this file except in compliance
> > + *  with the License.  You may obtain a copy of the License at
> > + *
> > + *   http://www.apache.org/licenses/LICENSE-2.0
> > + *
> > + *  Unless required by applicable law or agreed to in writing,
> > + *  software distributed under the License is distributed on an
> > + *   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> > + *  KIND, either express or implied.  See the License for the
> > + *  specific language governing permissions and limitations
> > + *  under the License.
> > + */
> > +
> > +package org.apache.synapse.deployers;
> > +
> > +import org.apache.axiom.om.OMElement;
> > +import org.apache.commons.logging.Log;
> > +import org.apache.commons.logging.LogFactory;
> > +import org.apache.synapse.Mediator;
> > +import org.apache.synapse.config.xml.MediatorFactoryFinder;
> > +import org.apache.synapse.mediators.base.SequenceMediator;
> > +
> > +/**
> > + *  Handles the <code>Sequence</code> deployment and undeployment tasks
> > + *
> > + * @see org.apache.synapse.deployers.AbstractSynapseArtifactDeployer
> > + */
> > +public class SequenceDeployer extends AbstractSynapseArtifactDeployer {
> > +
> > +    private static Log log = LogFactory.getLog(SequenceDeployer.class);
> > +
> > +    @Override
> > +    public String deploySynapseArtifact(OMElement artifactConfig, String
> fileName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("Sequence Deployment from file : " + fileName + "
> : Started");
> > +        }
> > +
> > +        try {
> > +            Mediator m =
> MediatorFactoryFinder.getInstance().getMediator(artifactConfig);
> > +            if (m instanceof SequenceMediator) {
> > +                SequenceMediator seq = (SequenceMediator) m;
> > +                seq.setFileName(fileName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Sequence named '" + seq.getName()
> > +                            + "' has been built from the file " +
> fileName);
> > +                }
> > +                seq.init(getSynapseEnvironment());
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Initialized the sequence : " +
> seq.getName());
> > +                }
> > +                getSynapseConfiguration().addSequence(seq.getName(),
> seq);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Sequence Deployment from file : " +
> fileName + " : Completed");
> > +                }
> > +                return seq.getName();
> > +            } else {
> > +                log.error("Sequence Deployment Failed. The artifact
> described in the file "
> > +                        + fileName + " is not a Sequence");
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("Sequence Deployment from the file : " + fileName
> + " : Failed.", e);
> > +        }
> > +
> > +        return null;
> > +    }
> > +
> > +    @Override
> > +    public void undeploySynapseArtifact(String artifactName) {
> > +
> > +        if (log.isDebugEnabled()) {
> > +            log.debug("Sequence Undeployment of the sequence named : "
> > +                    + artifactName + " : Started");
> > +        }
> > +
> > +        try {
> > +            SequenceMediator seq
> > +                    =
> getSynapseConfiguration().getDefinedSequences().get(artifactName);
> > +            if (seq != null) {
> > +                getSynapseConfiguration().removeSequence(artifactName);
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Destroying the sequence named : " +
> artifactName);
> > +                }
> > +                seq.destroy();
> > +                if (log.isDebugEnabled()) {
> > +                    log.debug("Sequence Undeployment of the sequence
> named : "
> > +                            + artifactName + " : Completed");
> > +                }
> > +            } else {
> > +                log.error("Couldn't find the sequence named : " +
> artifactName);
> > +            }
> > +        } catch (Exception e) {
> > +            log.error("Sequence Undeployement of sequence named : " +
> artifactName + " : Failed");
> > +        }
> > +    }
> > +}
> >
> > Modified:
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/endpoints/Endpoint.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/endpoints/Endpoint.java?rev=909246&r1=909245&r2=909246&view=diff
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/endpoints/Endpoint.java
> (original)
> > +++
> synapse/branches/1.3/modules/core/src/main/java/org/apache/synapse/endpoints/Endpoint.java
> Fri Feb 12 05:36:37 2010
> > @@ -111,4 +111,16 @@
> >      * @return EndpointView instance
> >      */
> >     public EndpointView getMetricsMBean();
> > +
> > +    /**
> > +     * Get the filename from which this endpoint is loaded,
> <code>null</code> if it is an anonymous endpoint
> > +     * @return String file name
> > +     */
> > +    public String getFileName();
> > +
> > +    /**
> > +     * Set the filename from which the endpoint is loaded
> > +     * @param fileName from which the endpoint is loaded
> > +     */
> > +    public void setFileName(String fileName);
> >  }
> >
> > Modified:
> synapse/branches/1.3/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java?rev=909246&r1=909245&r2=909246&view=diff
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
> (original)
> > +++
> synapse/branches/1.3/modules/extensions/src/main/java/org/apache/synapse/mediators/bsf/ScriptMediator.java
> Fri Feb 12 05:36:37 2010
> > @@ -395,6 +395,7 @@
> >         if (scriptEngine == null) {
> >             handleException("No script engine found for language: " +
> language);
> >         }
> > +        System.out.println("Script Engine Selected is " +
> scriptEngine.toString());
> >         xmlHelper = XMLHelper.getArgHelper(scriptEngine);
> >
> >         this.multiThreadedEngine =
> scriptEngine.getFactory().getParameter("THREADING") != null;
> >
> > Modified:
> synapse/branches/1.3/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java?rev=909246&r1=909245&r2=909246&view=diff
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
> (original)
> > +++
> synapse/branches/1.3/modules/extensions/src/test/java/org/apache/synapse/mediators/bsf/ScriptMediatorTest.java
> Fri Feb 12 05:36:37 2010
> > @@ -54,13 +54,13 @@
> >     }
> >
> >
> > -    public static Test suite() {
> > -        TestSuite suite = new TestSuite();
> > -        for (int i = 0; i < 10; i++) {
> > -            suite.addTest(new RepeatedTest(new
> ScriptMediatorTest("testThreadSafety"), 10));
> > -        }
> > -        return suite;
> > -    }
> > +//    public static Test suite() {
> > +//        TestSuite suite = new TestSuite();
> > +//        for (int i = 0; i < 10; i++) {
> > +//            suite.addTest(new RepeatedTest(new
> ScriptMediatorTest("testThreadSafety"), 10));
> > +//        }
> > +//        return suite;
> > +//    }
> >
> >     public ScriptMediatorTest(String name) {
> >         super(name);
> >
> > Modified: synapse/branches/1.3/modules/transports/core/nhttp/pom.xml
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/transports/core/nhttp/pom.xml?rev=909246&r1=909245&r2=909246&view=diff
> >
> ==============================================================================
> > --- synapse/branches/1.3/modules/transports/core/nhttp/pom.xml (original)
> > +++ synapse/branches/1.3/modules/transports/core/nhttp/pom.xml Fri Feb 12
> 05:36:37 2010
> > @@ -152,4 +152,4 @@
> >         <httpcore.nio.version>4.1-alpha1</httpcore.nio.version>
> >     </properties>
> >
> > -</project>
> > \ No newline at end of file
> > +</project>
> >
> > Modified:
> synapse/branches/1.3/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
> > URL:
> http://svn.apache.org/viewvc/synapse/branches/1.3/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java?rev=909246&r1=909245&r2=909246&view=diff
> >
> ==============================================================================
> > ---
> synapse/branches/1.3/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
> (original)
> > +++
> synapse/branches/1.3/modules/transports/core/nhttp/src/test/java/org/apache/synapse/transport/nhttp/HttpCoreNIOListenerTest.java
> Fri Feb 12 05:36:37 2010
> > @@ -33,7 +33,14 @@
> >
> >         // These tests don't work because of a problem similar to
> SYNAPSE-418
> >         suite.addExclude("(test=EchoXML)");
> > -
> > +        suite.addExclude("(test=AsyncXML)");
> > +        suite.addExclude("(test=AsyncTextPlain)");
> > +        suite.addExclude("(test=AsyncBinary)");
> > +        suite.addExclude("(test=AsyncSwA)");
> > +        suite.addExclude("(test=AsyncSOAPLarge)");
> > +        suite.addExclude("(test=REST)");
> > +        suite.addExclude("(test=MinConcurrency)");
> > +
> >         TransportDescriptionFactory tdfNIO =
> >             new SimpleTransportDescriptionFactory("http",
> HttpCoreNIOListener.class,
> >
> HttpCoreNIOSender.class);
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: ruwan@wso2.com; cell: +94 77 341 3097
blog: http://ruwansblog.blogspot.com

Mime
View raw message