Search in sources :

Example 6 with AbstractEndpoint

use of org.apache.synapse.endpoints.AbstractEndpoint in project wso2-synapse by wso2.

the class StatisticSynapseConfigurationObserver method endpointAdded.

@Override
public void endpointAdded(Endpoint endpoint) {
    ArtifactHolder holder = new ArtifactHolder();
    holder.setParent(endpoint.getName());
    endpoint.setComponentStatisticsId(holder);
    ((AbstractEndpoint) endpoint).getDefinition().getAspectConfiguration().setHashCode(holder.getHashCodeAsString());
    StatisticIdentityGenerator.conclude(holder);
}
Also used : AbstractEndpoint(org.apache.synapse.endpoints.AbstractEndpoint) ArtifactHolder(org.apache.synapse.aspects.flow.statistics.data.artifact.ArtifactHolder)

Example 7 with AbstractEndpoint

use of org.apache.synapse.endpoints.AbstractEndpoint in project wso2-synapse by wso2.

the class DynamicEndpointTest method testContextProperties.

public void testContextProperties() throws Exception {
    SynapseXPath xpath = new SynapseXPath("$ctx:timeout");
    AbstractEndpoint endpoint = new AddressEndpoint();
    EndpointDefinition definition = new EndpointDefinition();
    endpoint.setDefinition(definition);
    definition.setDynamicTimeoutExpression(xpath);
    MessageContext synCtx = new TestMessageContext();
    synCtx.setProperty("timeout", "90000");
    assertEquals(Long.valueOf((String) xpath.evaluate(synCtx)).longValue(), endpoint.getDefinition().evaluateDynamicEndpointTimeout(synCtx));
}
Also used : SynapseXPath(org.apache.synapse.util.xpath.SynapseXPath) AbstractEndpoint(org.apache.synapse.endpoints.AbstractEndpoint) AddressEndpoint(org.apache.synapse.endpoints.AddressEndpoint) TestMessageContext(org.apache.synapse.TestMessageContext) EndpointDefinition(org.apache.synapse.endpoints.EndpointDefinition) TestMessageContext(org.apache.synapse.TestMessageContext) MessageContext(org.apache.synapse.MessageContext)

Aggregations

AbstractEndpoint (org.apache.synapse.endpoints.AbstractEndpoint)7 Endpoint (org.apache.synapse.endpoints.Endpoint)3 EndpointDefinition (org.apache.synapse.endpoints.EndpointDefinition)3 OMElement (org.apache.axiom.om.OMElement)2 EndpointReference (org.apache.axis2.addressing.EndpointReference)2 MessageContext (org.apache.synapse.MessageContext)2 SynapseException (org.apache.synapse.SynapseException)2 IndirectEndpoint (org.apache.synapse.endpoints.IndirectEndpoint)2 Collection (java.util.Collection)1 Set (java.util.Set)1 Stack (java.util.Stack)1 OMAttribute (org.apache.axiom.om.OMAttribute)1 OMException (org.apache.axiom.om.OMException)1 OMFactory (org.apache.axiom.om.OMFactory)1 AxisFault (org.apache.axis2.AxisFault)1 RelatesTo (org.apache.axis2.addressing.RelatesTo)1 Options (org.apache.axis2.client.Options)1 MessageContext (org.apache.axis2.context.MessageContext)1 ServiceContext (org.apache.axis2.context.ServiceContext)1 ServiceGroupContext (org.apache.axis2.context.ServiceGroupContext)1