Refine search
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); }
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 unsetConfigurationContextService(ConfigurationContextService contextService) { AxisConfiguration axisConf = configContext.getAxisConfiguration(); AxisModule statModule = axisConf.getModule(StatisticsConstants.STATISTISTICS_MODULE_NAME); if (statModule != null) { try { axisConf.disengageModule(statModule); } catch (AxisFault axisFault) { log.error("Failed disengage module: " + StatisticsConstants.STATISTISTICS_MODULE_NAME); } } this.configContext = null; }
@Override public void createdConfigurationContext(ConfigurationContext configurationContext) { AxisConfiguration axisConfig = configurationContext.getAxisConfiguration(); AxisModule poxSecModule = axisConfig.getModule("POXSecurityModule"); if (poxSecModule != null) { try { axisConfig.engageModule(poxSecModule); } catch (AxisFault e) { log.error("Cannot globally engage POX Security module", e); } } }
private void unDeployCRUDService(GovernanceArtifactConfiguration configuration, AxisConfiguration axisConfig) { String singularLabel = configuration.getSingularLabel(); try { if (axisConfig.getService(singularLabel) != null) { axisConfig.removeService(singularLabel); } } catch (AxisFault axisFault) { log.error(axisFault); } }
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); }
private void setUpHTTPTransporters() throws AxisFault { final AxisConfiguration axisConfiguration = soapContext.getAxis2ConfigurationContext().getAxisConfiguration(); soapContext.getSoapServerConfig() .initTransportListenerForAxis(axisConfiguration.getTransportIn(Constants.TRANSPORT_HTTP)); soapContext.getSoapServerConfig() .initTransportListenerForAxis(axisConfiguration.getTransportIn(Constants.TRANSPORT_HTTPS)); }
private String findAxisServiceName(String path) { HashMap services = configContext.getAxisConfiguration().getServices(); if (services == null) { return null; } String[] parts = path.split("/"); String serviceName = ""; for (int i=parts.length-1; i>=0; i--) { serviceName = parts[i] + serviceName; if (services.containsKey(serviceName)) { return serviceName; } serviceName = "/" + serviceName; if (services.containsKey(serviceName)) { return serviceName; } } return null; }
axisService.isEnableAllTransports(); ConfigurationContext configctx = this.configContext; if (configctx != null) { ListenerManager lm = configctx.getListenerManager(); if (!lm.isListenerRunning(transport)) { TransportInDescription trsin = configctx.getAxisConfiguration().getTransportIn(transport); if (trsin != null) { lm.addListener(trsin, false); return lm.getEPRforService(axisService.getName(), null, transport);
protected void activate(ComponentContext ctxt) { //TODO: Modify the permission in the UI try { ConfigurationContext configContext = configContextService.getServerConfigContext(); AxisService serviceAdmin = configContext.getAxisConfiguration().getService("ServiceAdmin"); Properties props = new Properties(); props.put(CarbonConstants.AXIS2_CONFIG_SERVICE, AxisObserver.class.getName()); ctxt.getBundleContext().registerService(AxisObserver.class.getName(), new CloudMSDeploymentInterceptor(), props); // register the role player for this configuration AxisConfiguration axisConfiguration = configContext.getAxisConfiguration(); axisConfiguration.addParameter(new Parameter("rolePlayer", new SuperTenantRolePlayer())); } catch (Exception e) { log.error("CloudMSDeploymentServiceComponent activation failed", e); } }
public void buildService(AxisConfiguration axisCfg) throws AxisFault { AxisService eventSourceService = new AxisService(); eventSourceService.setName(this.name); // Add wse operations addOperations(eventSourceService); axisCfg.addService(eventSourceService); //Set the service parameters eventSourceService .addParameter(EventingConstants.SUBSCRIPTION_MANAGER, subscriptionManager); eventSourceService.addParameter(SynapseEventingConstants.SERVICE_TYPE, SynapseEventingConstants.EVENTING_ST); }
public static synchronized void deployService(AxisService service) throws AxisFault { receiver.getConfigurationContext().getAxisConfiguration().addService( service); }
/** * Create a mock SynapseEnvironment object * * @return Axis2SynapseEnvironment instance * @throws AxisFault on creating/mocking object */ private Axis2SynapseEnvironment getMockedSynapseEnvironment() throws AxisFault { Axis2SynapseEnvironment synapseEnvironment = PowerMockito.mock(Axis2SynapseEnvironment.class); ConfigurationContext axis2ConfigurationContext = new ConfigurationContext(new AxisConfiguration()); axis2ConfigurationContext.getAxisConfiguration().addParameter(SynapseConstants.SYNAPSE_ENV, synapseEnvironment); Mockito.when(synapseEnvironment.getAxis2ConfigurationContext()).thenReturn(axis2ConfigurationContext); return synapseEnvironment; }
public String getEndpoint(String serviceName) throws AxisFault { if (configurationContext == null) { throw new IllegalStateException(); } return configurationContext.getAxisConfiguration().getService(serviceName).getEPRs()[0]; }
public static void deployService(String serviceName, String scope, InputStream config) throws Exception { if (context == null) { throw new RuntimeException("Missing context"); } // Load the service AxisService service = DeploymentEngine.buildService(config, Thread.currentThread().getContextClassLoader(), context); // Service name = actor name service.setName(serviceName); // application scope service.setScope(scope); // Register the service context.getAxisConfiguration().addService(service); // FIXME: it seems that it takes a bit longer for a service to become available }
protected void populateRequestAttributes(HttpServletRequest req) { HashMap services = configContext.getAxisConfiguration().getServices(); req.setAttribute(Constants.SERVICE_MAP, services); req.setAttribute(Constants.SERVICE_PATH, configContext.getServicePath()); } }
public void destroy() throws AxisFault { stop(); this.configctx.setTransportManager(null); // need to destory all the transports not only the started ones // most of the transports create the worker pool at the init method. TransportInDescription transportInDescription; for (Object o : configctx.getAxisConfiguration().getAxisConfiguration().getTransportsIn().values()) { transportInDescription = (TransportInDescription) o; TransportListener transportListener = transportInDescription.getReceiver(); transportListener.destroy(); } this.startedTransports.clear(); this.configctx = null; }
private boolean processInternalWSDL(String uri, ConfigurationContext configurationContext, String serviceName, AxisHttpResponse response, String ip) throws IOException { String wsdlName = uri.substring(uri.lastIndexOf("=") + 1); HashMap services = configurationContext.getAxisConfiguration().getServices(); AxisService service = (AxisService) services.get(serviceName); if (service != null) { response.setStatus(HttpStatus.SC_OK); response.setContentType("text/xml"); service.printUserWSDL(response.getOutputStream(), wsdlName, ip); response.getOutputStream().flush(); return true; } else { // no schema available by that name - send 404 response.sendError(HttpStatus.SC_NOT_FOUND, "Schema Not Found!"); return true; } }
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; }