private String[] getServiceEPRs(AxisService service) throws AxisFault { if (!service.isActive()) { return new String[]{"Service is inactive. No valid end point references."}; } return service.getEPRs(); }
/** * Method getService. * * @param name the name of the service to look up * @return an AxisService if found, or null */ public AxisService getService(String name) throws AxisFault { AxisService axisService = allServices.get(name); if (axisService != null) { if (axisService.isActive()) { return axisService; } else { throw new AxisFault(Messages .getMessage("serviceinactive", name)); } } else { axisService = allEndpoints.get(name); if (axisService != null) { if (axisService.isActive()) { return axisService; } else { throw new AxisFault(Messages .getMessage("serviceinactive", name)); } } } return null; }
/** * Method getService. * * @param name the name of the service to look up * @return an AxisService if found, or null */ public AxisService getService(String name) throws AxisFault { AxisService axisService = allServices.get(name); if (axisService != null) { if (axisService.isActive()) { return axisService; } else { throw new AxisFault(Messages .getMessage("serviceinactive", name)); } } else { axisService = allEndpoints.get(name); if (axisService != null) { if (axisService.isActive()) { return axisService; } else { throw new AxisFault(Messages .getMessage("serviceinactive", name)); } } } return null; }
if (service != null && service.isActive()) { return service;
if (service.isActive() && filter.matches(service)) { serviceAdded(service);
if (service.isActive() && filter.matches(service)) { serviceAdded(service);
AxisService axisService = (AxisService) services.next(); AxisServiceGroup asGroup = (AxisServiceGroup) axisService.getParent(); if (!axisService.isActive() || axisService.isClientSide() || SystemFilter.isFilteredOutService(asGroup.getServiceGroupName())) { continue;
AxisService axisService = (AxisService) services.next(); AxisServiceGroup asGroup = (AxisServiceGroup) axisService.getParent(); if (axisService.isActive() && !axisService.isClientSide() && !SystemFilter.isFilteredOutService(asGroup)) {
smd.setEprs(getServiceEPRs(axisService)); smd.setServiceVersion(""); smd.setActive(axisService.isActive()); smd.setServiceType(serviceType); smd.setDescription(axisService.getDocumentation());
+ "' has been deployed from file : " + filePath); if (!proxy.isStartOnLoad() || !axisService.isActive()) { proxy.stop(getSynapseConfiguration()); log.info("ProxyService named '" + proxy.getName()
/** * Remove an event source from the configuration. If the specified event source does not * exist a runtime exception is thrown. * * @param name name of the event source to be removed */ public synchronized void removeEventSource(String name) { SynapseEventSource eventSource = eventSources.get(name); if (eventSource == null) { handleException("No event source exists by the name : " + name); } else { try { if (getAxisConfiguration().getServiceForActivation(name) != null) { if (getAxisConfiguration().getServiceForActivation(name) .isActive()) { getAxisConfiguration().getService(name) .setActive(false); } getAxisConfiguration().removeService(name); } eventSources.remove(name); for (SynapseObserver o : observers) { o.eventSourceRemoved(eventSource); } } catch (AxisFault axisFault) { handleException(axisFault.getMessage()); } } }
/** * Remove an event source from the configuration. If the specified event source does not * exist a runtime exception is thrown. * * @param name name of the event source to be removed */ public synchronized void removeEventSource(String name) { SynapseEventSource eventSource = eventSources.get(name); if (eventSource == null) { handleException("No event source exists by the name : " + name); } else { try { if (getAxisConfiguration().getServiceForActivation(name) != null) { if (getAxisConfiguration().getServiceForActivation(name) .isActive()) { getAxisConfiguration().getService(name) .setActive(false); } getAxisConfiguration().removeService(name); } eventSources.remove(name); for (SynapseObserver o : observers) { o.eventSourceRemoved(eventSource); } } catch (AxisFault axisFault) { handleException(axisFault.getMessage()); } } }
/** * Deletes the Proxy Service named with the given name. If a proxy service does not exist by * the specified name a runtime exception is thrown. * * @param name * of the Proxy Service to be deleted */ public synchronized void removeProxyService(String name) { ProxyService proxy = proxyServices.get(name); if (proxy == null) { handleException("Unknown proxy service for name : " + name); } else { try { if (getAxisConfiguration().getServiceForActivation(name) != null) { if (getAxisConfiguration().getServiceForActivation(name) .isActive()) { getAxisConfiguration().getService(name) .setActive(false); } getAxisConfiguration().removeService(name); } proxyServices.remove(name); for (SynapseObserver o : observers) { o.proxyServiceRemoved(proxy); } } catch (AxisFault axisFault) { handleException(axisFault.getMessage()); } } }
if (getAxisConfiguration().getServiceForActivation(name) != null) { if (getAxisConfiguration().getServiceForActivation(name) .isActive()) { getAxisConfiguration().getService(name) .setActive(false);
/** * 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"); } }
service.setName(serviceHierarchy + service.getName()); serviceActive = service.isActive();
if (state != BaseConstants.STARTED || !entry.getService().isActive()) { return;
/** * Stop the proxy service * @param synCfg the synapse configuration */ public void stop(SynapseConfiguration synCfg) { AxisConfiguration axisConfig = synCfg.getAxisConfiguration(); if (axisConfig != null) { if (targetInLineInSequence != null) { targetInLineInSequence.destroy(); } if (targetInLineOutSequence != null) { targetInLineOutSequence.destroy(); } if (targetInLineFaultSequence != null) { targetInLineFaultSequence.destroy(); } AxisService as = axisConfig.getServiceForActivation(this.getName()); if (as != null && 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"); } }
smd.setServiceId(serviceName); smd.setServiceVersion(""); smd.setActive(service.isActive()); smd.setEprs(getServiceEPRs(service)); smd.setServiceType(serviceType);
/** * Tests starting a proxy service with correct axis configuration provided. * * @throws Exception if an exception occurs while configuring the axis configuration */ public void testStart() throws Exception { String proxyServiceName = "TestStartProxy"; SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration axisCfg = new AxisConfiguration(); SynapseEnvironment synEnv = new Axis2SynapseEnvironment(new ConfigurationContext(axisCfg), synCfg); axisCfg.addParameter(SynapseConstants.SYNAPSE_ENV, synEnv); synCfg.setAxisConfiguration(axisCfg); ProxyService proxyService = new ProxyService(proxyServiceName); AxisService axisServiceForActivation = new AxisService(); axisServiceForActivation.setName(proxyServiceName); axisCfg.addToAllServicesMap(axisServiceForActivation); proxyService.setTargetInLineInSequence(new SequenceMediator()); proxyService.setTargetInLineOutSequence(new SequenceMediator()); proxyService.setTargetInLineFaultSequence(new SequenceMediator()); proxyService.start(synCfg); Assert.assertTrue("Underlying Axis service is not activated", axisServiceForActivation.isActive()); Assert.assertTrue("Proxy service is not running", proxyService.isRunning()); proxyService.stop(synCfg); }