use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class IndirectEndpoint method init.
@Override
public /**
* Figure out the real endpoint we proxy for, and make sure its initialized
*/
void init(SynapseEnvironment synapseEnvironment) {
ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
reLoadAndInitEndpoint(cc);
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class LoadbalanceEndpoint method init.
@Override
public void init(SynapseEnvironment synapseEnvironment) {
ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
if (!initialized) {
super.init(synapseEnvironment);
if (algorithmContext == null) {
algorithmContext = new AlgorithmContext(isClusteringEnabled, cc, getName());
}
// initlize the algorithm
if (algorithm != null && algorithm instanceof ManagedLifecycle) {
ManagedLifecycle lifecycle = (ManagedLifecycle) algorithm;
lifecycle.init(synapseEnvironment);
}
loadBalanceEPInitialized = true;
buildMessage = Boolean.parseBoolean(SynapsePropertiesLoader.getPropertyValue(SynapseConstants.BUILD_MESSAGE_ON_FAILOVER, "false"));
}
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class SALoadbalanceEndpoint method init.
public void init(SynapseEnvironment synapseEnvironment) {
ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
if (!initialized) {
super.init(synapseEnvironment);
// Initialize the SAL Sessions if already has not been initialized.
SALSessions salSessions = SALSessions.getInstance();
if (!salSessions.isInitialized()) {
salSessions.initialize(isClusteringEnabled, cc);
}
// and it needs way to pick endpoints by name
if (isClusteringEnabled && (this.getParentEndpoint() == null || !(this.getParentEndpoint() instanceof SALoadbalanceEndpoint))) {
SALSessions.getInstance().registerChildren(this, getChildren());
}
}
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class ServiceDynamicLoadbalanceEndpoint method init.
@Override
public void init(SynapseEnvironment synapseEnvironment) {
if (!initialized) {
super.init(synapseEnvironment);
ConfigurationContext cfgCtx = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
ClusteringAgent clusteringAgent = cfgCtx.getAxisConfiguration().getClusteringAgent();
if (clusteringAgent == null) {
throw new SynapseException("Axis2 ClusteringAgent not defined in axis2.xml");
}
// Add the Axis2 GroupManagement agents
for (String domain : hostDomainMap.values()) {
if (clusteringAgent.getGroupManagementAgent(domain) == null) {
clusteringAgent.addGroupManagementAgent(new DefaultGroupManagementAgent(), domain);
}
}
slbMembershipHandler = new ServiceLoadBalanceMembershipHandler(hostDomainMap, getAlgorithm(), cfgCtx, isClusteringEnabled, getName());
// Initialize the SAL Sessions if already has not been initialized.
SALSessions salSessions = SALSessions.getInstance();
if (!salSessions.isInitialized()) {
salSessions.initialize(isClusteringEnabled, cfgCtx);
}
initialized = true;
log.info("ServiceDynamicLoadbalanceEndpoint initialized");
}
}
use of org.apache.synapse.core.axis2.Axis2SynapseEnvironment in project wso2-synapse by wso2.
the class AbstractEndpoint method init.
// ----------------------- default method implementations and common code -----------------------
public void init(SynapseEnvironment synapseEnvironment) {
ConfigurationContext cc = ((Axis2SynapseEnvironment) synapseEnvironment).getAxis2ConfigurationContext();
if (!initialized) {
// The check for clustering environment
ClusteringAgent clusteringAgent = cc.getAxisConfiguration().getClusteringAgent();
if (clusteringAgent != null && clusteringAgent.getStateManager() != null) {
isClusteringEnabled = Boolean.TRUE;
} else {
isClusteringEnabled = Boolean.FALSE;
}
context = new EndpointContext(getName(), getDefinition(), isClusteringEnabled, cc, metricsMBean);
}
initialized = true;
if (children != null) {
for (Endpoint e : children) {
e.init(synapseEnvironment);
}
}
contentAware = definition != null && ((definition.getFormat() != null && !definition.getFormat().equals(SynapseConstants.FORMAT_REST)) || definition.isSecurityOn() || definition.isReliableMessagingOn() || definition.isAddressingOn() || definition.isUseMTOM() || definition.isUseSwa());
}
Aggregations