use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.
the class AdminActions method listSingleService.
@Action(name = "listSingleService")
public View listSingleService(HttpServletRequest req) throws AxisFault {
// Clearing out any old values.
req.getSession().setAttribute(Constants.IS_FAULTY, "");
String serviceName = req.getParameter("serviceName");
if (serviceName != null) {
AxisService service = configContext.getAxisConfiguration().getService(serviceName);
req.getSession().setAttribute(Constants.SINGLE_SERVICE, service);
}
return new View("listSingleService.jsp");
}
use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.
the class AdminActions method updateServiceParameters.
@Action(name = "updateServiceParameters", post = true)
public Redirect updateServiceParameters(HttpServletRequest request) throws AxisFault {
String serviceName = request.getParameter("axisService");
AxisService service = configContext.getAxisConfiguration().getService(serviceName);
if (service != null) {
for (Parameter parameter : service.getParameters()) {
String para = request.getParameter(serviceName + "_" + parameter.getName());
service.addParameter(new Parameter(parameter.getName(), para));
}
for (Iterator<AxisOperation> iterator = service.getOperations(); iterator.hasNext(); ) {
AxisOperation axisOperation = iterator.next();
String op_name = axisOperation.getName().getLocalPart();
for (Parameter parameter : axisOperation.getParameters()) {
String para = request.getParameter(op_name + "_" + parameter.getName());
axisOperation.addParameter(new Parameter(parameter.getName(), para));
}
}
}
return new Redirect(EDIT_SERVICE_PARAMETERS).withStatus(true, "Parameters Changed Successfully.").withParameter("axisService", serviceName);
}
use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.
the class AdminActions method editServiceParameters.
@Action(name = EDIT_SERVICE_PARAMETERS)
public View editServiceParameters(HttpServletRequest req) throws AxisFault {
String serviceName = req.getParameter("axisService");
AxisService service = configContext.getAxisConfiguration().getServiceForActivation(serviceName);
if (service.isActive()) {
if (serviceName != null) {
req.getSession().setAttribute(Constants.SERVICE, configContext.getAxisConfiguration().getService(serviceName));
}
req.setAttribute("serviceName", serviceName);
req.setAttribute("parameters", getParameters(service));
Map<String, Map<String, String>> operations = new TreeMap<String, Map<String, String>>();
for (Iterator<AxisOperation> it = service.getOperations(); it.hasNext(); ) {
AxisOperation operation = it.next();
operations.put(operation.getName().getLocalPart(), getParameters(operation));
}
req.setAttribute("operations", operations);
} else {
req.setAttribute("status", "Service " + serviceName + " is not an active service" + ". \n Only parameters of active services can be edited.");
}
return new View("editServiceParameters.jsp");
}
use of org.apache.axis2.description.AxisService in project MassBank-web by MassBank.
the class AdminActions method viewServiceContext.
@Action(name = "viewServiceContext")
public View viewServiceContext(HttpServletRequest req) throws AxisFault {
String type = req.getParameter("TYPE");
String sgID = req.getParameter("PID");
String ID = req.getParameter("ID");
ServiceGroupContext sgContext = configContext.getServiceGroupContext(sgID);
if (sgContext != null) {
AxisService service = sgContext.getDescription().getService(ID);
ServiceContext serviceContext = sgContext.getServiceContext(service);
req.setAttribute("ServiceContext", serviceContext);
req.setAttribute("TYPE", type);
} else {
req.setAttribute("ServiceContext", null);
req.setAttribute("TYPE", type);
}
return new View("viewServiceContext.jsp");
}
use of org.apache.axis2.description.AxisService in project wso2-axis2-transports by wso2.
the class RabbitMQEndpoint method loadConfiguration.
@Override
public boolean loadConfiguration(ParameterInclude params) throws AxisFault {
// We only support endpoints configured at service level
if (!(params instanceof AxisService)) {
return false;
}
AxisService service = (AxisService) params;
rabbitMQConnectionFactory = rabbitMQListener.getConnectionFactory(service);
if (rabbitMQConnectionFactory == null) {
return false;
}
serviceTaskManager = ServiceTaskManagerFactory.createTaskManagerForService(rabbitMQConnectionFactory, service, workerPool);
serviceTaskManager.setRabbitMQMessageReceiver(new RabbitMQMessageReceiver(rabbitMQListener, rabbitMQConnectionFactory, this));
return true;
}
Aggregations