public Endpoint getEndpoint(String key) { Object o = localEntries.get(key); if (o != null && o instanceof Endpoint) { return (Endpoint) o; } else { Endpoint e = getConfiguration().getEndpoint(key); if (e != null) { if (!e.isInitialized()) { synchronized (e) { if (!e.isInitialized()) { e.init(synEnv); } } } localEntries.put(key, e); } return e; } }
public Endpoint getEndpoint(String key) { Object o = localEntries.get(key); if (o != null && o instanceof Endpoint) { return (Endpoint) o; } else { Endpoint e = getConfiguration().getEndpoint(key); if (e != null) { if (!e.isInitialized()) { synchronized (e) { if (!e.isInitialized()) { e.init(synEnv); } } } localEntries.put(key, e); } return e; } }
public void destroy() { if (target != null) { Endpoint endpoint = target.getEndpoint(); if (endpoint != null && endpoint.isInitialized()) { endpoint.destroy(); } ManagedLifecycle seq = target.getSequence(); if (seq != null) { seq.destroy(); } } } }
public Endpoint loadAndInitEndpoint(ConfigurationContext cc, String key) { Parameter parameter = cc.getAxisConfiguration().getParameter( SynapseConstants.SYNAPSE_CONFIG); Parameter synEnvParameter = cc.getAxisConfiguration().getParameter( SynapseConstants.SYNAPSE_ENV); if (parameter.getValue() instanceof SynapseConfiguration && synEnvParameter.getValue() instanceof SynapseEnvironment) { SynapseConfiguration synCfg = (SynapseConfiguration) parameter.getValue(); SynapseEnvironment synapseEnvironment = (SynapseEnvironment) synEnvParameter.getValue(); if (log.isDebugEnabled()) { log.debug("Loading real endpoint with key : " + key); } Endpoint ep = synCfg.getEndpoint(key); if (ep != null && !ep.isInitialized()) { synchronized (ep) { if (!ep.isInitialized()) { ep.init(synapseEnvironment); } } } return ep; } return null; }
public Endpoint getEndpoint(String key) { Object o = localEntries.get(key); if (o != null && o instanceof Endpoint) { return (Endpoint) o; } else { Endpoint e = getConfiguration().getEndpoint(key); synchronized (e) { if (!e.isInitialized()) { e.init(synEnv); } } localEntries.put(key, e); return e; } }
if (realEndpoint != null && !realEndpoint.isInitialized()) { realEndpoint.init(se);
log.debug("Sending using the endpoint named : " + endpointRef); if (!epr.isInitialized()) {
private Endpoint loadAndInitEndpoint(ConfigurationContext cc, String key) { Parameter parameter = cc.getAxisConfiguration().getParameter( SynapseConstants.SYNAPSE_CONFIG); Parameter synEnvParameter = cc.getAxisConfiguration().getParameter( SynapseConstants.SYNAPSE_ENV); if (parameter.getValue() instanceof SynapseConfiguration && synEnvParameter.getValue() instanceof SynapseEnvironment) { SynapseConfiguration synCfg = (SynapseConfiguration) parameter.getValue(); SynapseEnvironment synapseEnvironment = (SynapseEnvironment) synEnvParameter.getValue(); if (log.isDebugEnabled()) { log.debug("Loading real endpoint with key : " + key); } Endpoint ep = synCfg.getEndpoint(key); if (ep != null && !ep.isInitialized()) { synchronized (ep) { ep.init(synapseEnvironment); } } return ep; } return null; }
if (realEndpoint != null && !realEndpoint.isInitialized()) { realEndpoint.init(synapseEnvironment); if (epr != realEndpoint) { realEndpoint = epr; if (realEndpoint != null && !realEndpoint.isInitialized()) { realEndpoint.init(synapseEnvironment);
if (realEndpoint != null && !realEndpoint.isInitialized()) { realEndpoint.init(synapseEnvironment); if (epr != realEndpoint) { realEndpoint = epr; if (realEndpoint != null && !realEndpoint.isInitialized() && realEndpoint instanceof ManagedLifecycle) { realEndpoint.init(synapseEnvironment);
if (realEndpoint != null && !realEndpoint.isInitialized()) { realEndpoint.init(se);
public void destroy() { if (target != null) { Endpoint endpoint = target.getEndpoint(); if (endpoint != null && endpoint.isInitialized()) { endpoint.destroy(); } ManagedLifecycle seq = target.getSequence(); if (seq != null) { seq.destroy(); } else if (target.getSequenceRef() != null) { SequenceMediator targetSequence = (SequenceMediator) synapseEnv.getSynapseConfiguration(). getSequence(target.getSequenceRef()); if (targetSequence == null || targetSequence.isDynamic()) { synapseEnv.removeUnavailableArtifactRef(target.getSequenceRef()); } } } }
Endpoint ep1 = synCtx.getEndpoint(KEY_DYNAMIC_ENDPOINT_1); assertNotNull(ep1); assertTrue(ep1.isInitialized()); assertEquals(1, registry.getHitCount()); assertEquals("http://test.url", ((AddressEndpoint) ep1).getDefinition().getAddress()); Endpoint ep4 = synCtx.getEndpoint(KEY_DYNAMIC_ENDPOINT_1); assertNotNull(ep4); assertTrue(ep4.isInitialized()); assertEquals(2, registry.getHitCount()); assertEquals("http://test2.url", ((AddressEndpoint) ep4).getDefinition().getAddress()); assertTrue(ep1 != ep4); assertTrue(!ep1.isInitialized());