/** * If the parameter is found in the current description then the Parameter will be writable else * it will be read only * * @param name name of Parameter to retrieve * @return the Parameter, if found anywhere in the stack, or null if not */ public Parameter getParameter(String name) { Parameter parameter = parameterInclude.getParameter(name); if (parameter != null) { parameter.setEditable(true); return parameter; } if (parent != null) { parameter = parent.getParameter(name); if (parameter != null) { parameter.setEditable(false); } return parameter; } return null; }
/** * If the parameter is found in the current description then the Parameter will be writable else * it will be read only * * @param name name of Parameter to retrieve * @return the Parameter, if found anywhere in the stack, or null if not */ public Parameter getParameter(String name) { Parameter parameter = parameterInclude.getParameter(name); if (parameter != null) { parameter.setEditable(true); return parameter; } if (parent != null) { parameter = parent.getParameter(name); if (parameter != null) { parameter.setEditable(false); } return parameter; } return null; }
public static void setPolicyBean (ServiceClient serviceClient, SandeshaPolicyBean policyBean) throws SandeshaException { try { AxisService axisService = serviceClient.getAxisService(); if (axisService!=null) { Parameter parameter = axisService.getParameter(Sandesha2Constants.SANDESHA_PROPERTY_BEAN); SandeshaPolicyBean parent = null; if (parameter==null) { parameter = new Parameter (); parameter.setName(Sandesha2Constants.SANDESHA_PROPERTY_BEAN); } else { parameter.setEditable(true); //if we don't do it here, Axis2 will not allow us to override the parameter value. parent = (SandeshaPolicyBean) parameter.getValue(); policyBean.setParent(parent); } parameter.setValue(policyBean); axisService.addParameter(parameter); } else { String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotSetPolicyBeanServiceNull); throw new SandeshaException (message); } } catch (AxisFault e) { throw new SandeshaException (e); } }