Refine search
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; }
@Override protected void doInit() throws AxisFault { super.doInit(); // set the synchronise callback table if (cfgCtx.getProperty(BaseConstants.CALLBACK_TABLE) == null){ cfgCtx.setProperty(BaseConstants.CALLBACK_TABLE, new ConcurrentHashMap()); } }
@Override public void destroy() { try { super.destroy(); servletConfig = null; if (tmpconfigContext.getListenerManager() != null){ tmpconfigContext.getListenerManager().destroy(); } } catch (Exception e) { e.printStackTrace(); } }
protected void populateRequestAttributes(HttpServletRequest req) { HashMap services = configContext.getAxisConfiguration().getServices(); req.setAttribute(Constants.SERVICE_MAP, services); req.setAttribute(Constants.SERVICE_PATH, configContext.getServicePath()); } }
protected void setConfigurationContextService(ConfigurationContextService ccService) { ConfigurationContext serverCtx = ccService.getServerConfigContext(); AxisConfiguration serverConfig = serverCtx.getAxisConfiguration(); LocalTransportReceiver.CONFIG_CONTEXT = new ConfigurationContext(serverConfig); LocalTransportReceiver.CONFIG_CONTEXT.setServicePath("services"); LocalTransportReceiver.CONFIG_CONTEXT.setContextRoot("local:/"); Util.setConfigurationContextService(ccService); }
protected void setUp() throws Exception { super.setUp(); SynapseConfiguration synCfg = new SynapseConfiguration(); AxisConfiguration config = new AxisConfiguration(); testCtx = new Axis2MessageContext(new org.apache.axis2.context.MessageContext(), synCfg, new Axis2SynapseEnvironment(new ConfigurationContext(config), synCfg)); ((Axis2MessageContext) testCtx).getAxis2MessageContext().setConfigurationContext(new ConfigurationContext(config)); }
@Override public AxisService findService(final MessageContext msgCtx) throws AxisFault { AxisService axisService = msgCtx.getAxisService(); if (axisService != null) return axisService; else if (msgCtx.getTo().getAddress().endsWith("msh")) return msgCtx.getConfigurationContext().getAxisConfiguration().getService("as4"); else return null; }
private Phase getAddressingPhase(MessageContext context) { if (addressingPhase == null) { List<Phase> inFlowPhases = context.getConfigurationContext().getAxisConfiguration().getPhasesInfo() .getINPhases(); for (Phase p : inFlowPhases) { if (p.getName().equalsIgnoreCase("Addressing")) { addressingPhase = p; } } } return addressingPhase; }
private boolean listServiceDisabled () { Parameter parameter = configContext.getAxisConfiguration() .getParameter(Constants.ADMIN_SERVICE_LISTING_DISABLED); return parameter != null && "true".equals(parameter.getValue()); }
private ClusteringAgent getClusteringAgent() throws AxisFault { AxisConfiguration axisConfig = MessageContext.getCurrentMessageContext(). getConfigurationContext().getAxisConfiguration(); ClusteringAgent clusterManager = axisConfig.getClusteringAgent(); if (clusterManager == null) { handleException("ClusteringAgent not enabled in axis2.xml file"); } return clusterManager; }
public AxisService findService(MessageContext mc) throws AxisFault { AxisConfiguration ac = mc.getConfigurationContext().getAxisConfiguration(); return ac.getService(SynapseConstants.SYNAPSE_SERVICE_NAME); }
public void setConfigContext(ConfigurationContext configContext) { // setting ServletContext into configctx configContext.setProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT, config.getServletContext()); Parameter servletConfigParam = new Parameter(); servletConfigParam.setName(HTTPConstants.HTTP_SERVLETCONFIG); servletConfigParam.setValue(config); try { configContext.getAxisConfiguration().addParameter(servletConfigParam); } catch (AxisFault axisFault) { log.error(axisFault.getMessage(), axisFault); } super.setConfigContext(configContext); } }
/** * 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; }
/** * 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); }
public boolean isServerRegistered() { ConfigurationContext configCtx = MessageContext.getCurrentMessageContext().getConfigurationContext(); String serverReg = (String) configCtx.getProperty(ServerConstants.SERVER_REGISTERED); if (serverReg == null) { serverReg = pm.getConfigurationProperty(ServerConstants.SERVER_REGISTERED); if (serverReg == null) { serverReg = "false"; pm.updateConfigurationProperty(ServerConstants.SERVER_REGISTERED, "false"); configCtx.setProperty(ServerConstants.SERVER_REGISTERED, "false"); } } return serverReg.equals("true"); }
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); } }
public static boolean isInOrder(MessageContext context) throws SandeshaException { if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Enter: SandeshaUtil::isInOrder"); SandeshaPolicyBean policy = getPropertyBean(context.getConfigurationContext().getAxisConfiguration()); boolean result = policy.isInOrder(); if (LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Enter: SandeshaUtil::isInOrder, " + result); return result; }
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); }
/** * Check whether the state store in the specified <code>messageContext</code> can be replicated. * Also note that if there are no members, we need not do any replication * * @param messageContext The MessageContext to be subjected to this test * @return true - State needs to be replicated * false - otherwise */ private static boolean canReplicate(MessageContext messageContext) { ClusteringAgent clusteringAgent = messageContext.getRootContext().getAxisConfiguration().getClusteringAgent(); return clusteringAgent != null && clusteringAgent.getStateManager() != null; } }
private String getFilePathFromFileId(String fileId) { ConfigurationContext configCtx = MessageContext.getCurrentMessageContext().getConfigurationContext(); Map fileResMap = (Map) configCtx.getProperty(ServerConstants.FILE_RESOURCE_MAP); return (String) fileResMap.get(fileId); } }