use of org.apache.axis2.engine.AxisEvent in project wso2-synapse by wso2.
the class ThrottleObserver method serviceUpdate.
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
log.debug("ThrottleObserver notified for a serviceUpdate.");
AxisDescription axisDescription = axisEvent.getAxisDescription();
if (axisDescription.isEngaged(axisService.getAxisConfiguration().getModule(ThrottleConstants.THROTTLE_MODULE_NAME))) {
if (axisEvent.getEventType() == AxisEvent.POLICY_ADDED) {
try {
ThrottleEnguageUtils.enguage(axisDescription, configctx, defautThrottle);
} catch (AxisFault axisFault) {
log.error("Error while re-engaging throttling", axisFault);
}
}
}
}
use of org.apache.axis2.engine.AxisEvent in project wso2-synapse by wso2.
the class ProxyService method start.
/**
* Start the proxy service
* @param synCfg the synapse configuration
*/
public void start(SynapseConfiguration synCfg) {
AxisConfiguration axisConfig = synCfg.getAxisConfiguration();
if (axisConfig != null) {
Parameter param = axisConfig.getParameter(SynapseConstants.SYNAPSE_ENV);
if (param != null && param.getValue() instanceof SynapseEnvironment) {
SynapseEnvironment env = (SynapseEnvironment) param.getValue();
if (targetInLineInSequence != null) {
targetInLineInSequence.init(env);
}
if (targetInLineOutSequence != null) {
targetInLineOutSequence.init(env);
}
if (targetInLineFaultSequence != null) {
targetInLineFaultSequence.init(env);
}
} else {
auditWarn("Unable to find the SynapseEnvironment. " + "Components of the proxy service may not be initialized");
}
AxisService as = axisConfig.getServiceForActivation(this.getName());
as.setActive(true);
axisConfig.notifyObservers(new AxisEvent(AxisEvent.SERVICE_START, as), as);
this.setRunning(true);
auditInfo("Started the proxy service : " + name);
} else {
auditWarn("Unable to start proxy service : " + name + ". Couldn't access Axis configuration");
}
}
use of org.apache.axis2.engine.AxisEvent in project wso2-synapse by wso2.
the class ProxyService method stop.
/**
* Stop the proxy service
* @param synCfg the synapse configuration
*/
public void stop(SynapseConfiguration synCfg) {
AxisConfiguration axisConfig = synCfg.getAxisConfiguration();
if (axisConfig != null) {
AxisService as = axisConfig.getServiceForActivation(this.getName());
// If an active AxisService is found
if (as != null) {
if (as.isActive()) {
as.setActive(false);
}
axisConfig.notifyObservers(new AxisEvent(AxisEvent.SERVICE_STOP, as), as);
}
this.setRunning(false);
auditInfo("Stopped the proxy service : " + name);
} else {
auditWarn("Unable to stop proxy service : " + name + ". Couldn't access Axis configuration");
}
}
Aggregations