public DescriptionBuilder(InputStream serviceInputStream, ConfigurationContext configCtx) { this.configCtx = configCtx; this.descriptionStream = serviceInputStream; this.axisConfig = this.configCtx.getAxisConfiguration(); }
public ServiceBuilder(ConfigurationContext configCtx, AxisService service) { this.service = service; this.configCtx = configCtx; this.axisConfig = this.configCtx.getAxisConfiguration(); }
/** * Removes the Synapse Service from the Axis2 configuration. * * @throws AxisFault if an error occurs during Axis2 service removal */ private void undeploySynapseService() throws AxisFault { log.info("Undeploying the Synapse service..."); configurationContext.getAxisConfiguration().removeService( SynapseConstants.SYNAPSE_SERVICE_NAME); }
protected void processListFaultyServices(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { String serviceName = req.getParameter("serviceName"); if (serviceName != null) { AxisService service = configContext.getAxisConfiguration().getService(serviceName); req.setAttribute(Constants.SINGLE_SERVICE, service); } renderView(LIST_FAULTY_SERVICES_JSP_NAME, req, res); }
protected void populateRequestAttributes(HttpServletRequest req) { HashMap services = configContext.getAxisConfiguration().getServices(); req.setAttribute(Constants.SERVICE_MAP, services); req.setAttribute(Constants.SERVICE_PATH, configContext.getServicePath()); } }
/** * Deploys all event sources. * * @throws AxisFault if an error occurs deploying the event sources. */ private void deployEventSources() throws AxisFault { log.info("Deploying EventSources..."); for (SynapseEventSource eventSource : synapseConfiguration.getEventSources()) { eventSource.buildService(configurationContext.getAxisConfiguration()); } }
public void setConfigurationContext(ConfigurationContext configCtx) { this.configCtx = configCtx; // The following code does the bridging between Axis2 and Synapse load balancing clusteringAgent = configCtx.getAxisConfiguration().getClusteringAgent(); if(clusteringAgent == null){ String msg = "In order to enable load balancing across an Axis2 cluster, " + "the cluster entry should be enabled in the axis2.xml file"; log.error(msg); throw new SynapseException(msg); } }
private boolean listServiceDisabled () { Parameter parameter = configContext.getAxisConfiguration() .getParameter(Constants.ADMIN_SERVICE_LISTING_DISABLED); return parameter != null && "true".equals(parameter.getValue()); }
protected void waitForCompletion() { long timeout = 2000L; Parameter param = cfgCtx.getAxisConfiguration().getParameter("hotupdate.timeout"); if (param != null && param.getValue() != null) { timeout = Long.parseLong(param.getValue().toString()); } try { Thread.sleep(timeout); } catch (InterruptedException ignored) { } }
/** * Undeploys all event sources. * * @throws AxisFault if an error occurs undeploying the event sources. */ private void undeployEventSources() throws AxisFault { log.info("Undeploying EventSources..."); for (SynapseEventSource eventSource : synapseConfiguration.getEventSources()) { configurationContext.getAxisConfiguration().removeService(eventSource.getName()); } }
/** * Removes all Synapse proxy services from the Axis2 configuration. * * @throws AxisFault if an error occurs undeploying proxy services */ private void undeployProxyServices() throws AxisFault { log.info("Undeploying Proxy services..."); for (ProxyService proxy : synapseConfiguration.getProxyServices()) { configurationContext.getAxisConfiguration().removeService( proxy.getName()); } }
protected ServerContextInformation getServerContextInformation() throws DeploymentException { Parameter serverCtxParam = cfgCtx.getAxisConfiguration().getParameter( SynapseConstants.SYNAPSE_SERVER_CTX_INFO); if (serverCtxParam == null) { throw new DeploymentException("ServerContextInformation not found. " + "Unable to continue the deployment operation."); } return (ServerContextInformation) serverCtxParam.getValue(); }
protected SynapseConfiguration getSynapseConfiguration() throws DeploymentException { Parameter synCfgParam = cfgCtx.getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_CONFIG); if (synCfgParam == null) { throw new DeploymentException("SynapseConfiguration not found. " + "Unable to continue the deployment operation."); } return (SynapseConfiguration) synCfgParam.getValue(); }
protected ServerConfigurationInformation getServerConfigurationInformation() throws DeploymentException { Parameter serverCfgParam = cfgCtx.getAxisConfiguration().getParameter( SynapseConstants.SYNAPSE_SERVER_CONFIG_INFO); if (serverCfgParam == null) { throw new DeploymentException("SynapseConfigurationInformation not found. " + "Unable to continue the deployment operation."); } return (ServerConfigurationInformation) serverCfgParam.getValue(); }
private static SynapseConfiguration getSynapseConfiguration( org.apache.axis2.context.MessageContext axisMsgCtx) { AxisConfiguration axisCfg = axisMsgCtx.getConfigurationContext().getAxisConfiguration(); Parameter param = axisCfg.getParameter(SynapseConstants.SYNAPSE_CONFIG); if (param != null) { return (SynapseConfiguration) param.getValue(); } return null; }
private static SynapseEnvironment getSynapseEnvironment( org.apache.axis2.context.MessageContext axisMsgCtx) { AxisConfiguration axisCfg = axisMsgCtx.getConfigurationContext().getAxisConfiguration(); Parameter param = axisCfg.getParameter(SynapseConstants.SYNAPSE_ENV); if (param != null) { return (SynapseEnvironment) param.getValue(); } return null; } }
protected SynapseEnvironment getSynapseEnvironment() throws DeploymentException { Parameter synCfgParam = cfgCtx.getAxisConfiguration().getParameter(SynapseConstants.SYNAPSE_ENV); if (synCfgParam == null) { throw new DeploymentException("SynapseEnvironment not found. " + "Unable to continue the deployment operation."); } return (SynapseEnvironment) synCfgParam.getValue(); }
public int getActiveConnectionsCount() { Map<String, TransportInDescription> trpIns = configurationContext.getAxisConfiguration().getTransportsIn(); for (TransportInDescription trpIn : trpIns.values()) { if (trpIn.getReceiver() instanceof HttpCoreNIOListener) { return ((HttpCoreNIOListener) trpIn.getReceiver()).getActiveConnectionsSize(); } } return 0; }
protected void processListServices(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException { if(listServiceDisabled()){ return; } populateRequestAttributes(req); req.setAttribute(Constants.ERROR_SERVICE_MAP, configContext.getAxisConfiguration().getFaultyServices()); renderView(LIST_MULTIPLE_SERVICE_JSP_NAME, req, res); }
public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault { AxisConfiguration axiConfiguration = configContext.getAxisConfiguration(); Counter globalRequestCounter = new Counter(); Parameter globalRequestCounterParameter = new Parameter(); globalRequestCounterParameter.setName(MetricsConstants.GLOBAL_REQUEST_COUNTER); globalRequestCounterParameter.setValue(globalRequestCounter); axiConfiguration.addParameter(globalRequestCounterParameter); }