public static SynapseEnvironment getSynapseEnvironment(AxisConfiguration axisCfg) { return axisCfg != null && axisCfg.getParameter(SynapseConstants.SYNAPSE_HOME) != null ? (SynapseEnvironment) axisCfg.getParameterValue(SynapseConstants.SYNAPSE_CONFIG) : null; }
public static SynapseEnvironment getSynapseEnvironment(AxisConfiguration axisCfg) { return axisCfg != null && axisCfg.getParameter(SynapseConstants.SYNAPSE_HOME) != null ? (SynapseEnvironment) axisCfg.getParameterValue(SynapseConstants.SYNAPSE_CONFIG) : null; }
/** * This include all the major changes we have done from 1.2 release to 1.3 release. This will * include API changes , class deprecating etc etc. */ private void cleanupTemp() { File tempFile = (File)axisConfiguration.getParameterValue( Constants.Configuration.ARTIFACTS_TEMP_DIR); if (tempFile == null) { String property = AccessController.doPrivileged( new PrivilegedAction<String>() { public String run() { return System.getProperty("java.io.tmpdir"); } } ); tempFile = new File(property, "_axis2"); } deleteTempFiles(tempFile); }
/** * This include all the major changes we have done from 1.2 release to 1.3 release. This will * include API changes , class deprecating etc etc. */ private void cleanupTemp() { File tempFile = (File)axisConfiguration.getParameterValue( Constants.Configuration.ARTIFACTS_TEMP_DIR); if (tempFile == null) { String property = AccessController.doPrivileged( new PrivilegedAction<String>() { public String run() { return System.getProperty("java.io.tmpdir"); } } ); tempFile = new File(property, "_axis2"); } deleteTempFiles(tempFile); }
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault { org.apache.axiom.soap.SOAPEnvelope envelope = msgContext.getEnvelope(); if (envelope.getHeader() == null) { return InvocationResponse.CONTINUE; } // Get all the headers targeted to us Iterator headerBlocks = envelope.getHeader().getHeadersToProcess((RolePlayer)msgContext.getConfigurationContext().getAxisConfiguration().getParameterValue("rolePlayer")); while (headerBlocks.hasNext()) { SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next(); QName headerName = headerBlock.getQName(); if(headerName.getLocalPart().equals("Security")) { headerBlock.setProcessed(); } } return InvocationResponse.CONTINUE; } }
/** * Sets hotDeployment and hot update. */ protected void setDeploymentFeatures() { Parameter hotDeployment = axisConfig.getParameter(TAG_HOT_DEPLOYMENT); Parameter hotUpdate = axisConfig.getParameter(TAG_HOT_UPDATE); if (hotDeployment != null) { this.hotDeployment = JavaUtils.isTrue(hotDeployment.getValue(), true); } if (hotUpdate != null) { this.hotUpdate = JavaUtils.isTrue(hotUpdate.getValue(), true); } String serviceDirPara = (String) axisConfig.getParameterValue(DeploymentConstants.SERVICE_DIR_PATH); if (serviceDirPara != null) { servicesPath = serviceDirPara; } String moduleDirPara = (String) axisConfig.getParameterValue(DeploymentConstants.MODULE_DRI_PATH); if (moduleDirPara != null) { modulesPath = moduleDirPara; } }
/** * Sets hotDeployment and hot update. */ protected void setDeploymentFeatures() { Parameter hotDeployment = axisConfig.getParameter(TAG_HOT_DEPLOYMENT); Parameter hotUpdate = axisConfig.getParameter(TAG_HOT_UPDATE); if (hotDeployment != null) { this.hotDeployment = JavaUtils.isTrue(hotDeployment.getValue(), true); } if (hotUpdate != null) { this.hotUpdate = JavaUtils.isTrue(hotUpdate.getValue(), true); } String serviceDirPara = (String) axisConfig.getParameterValue(DeploymentConstants.SERVICE_DIR_PATH); if (serviceDirPara != null) { servicesPath = serviceDirPara; } String moduleDirPara = (String) axisConfig.getParameterValue(DeploymentConstants.MODULE_DRI_PATH); if (moduleDirPara != null) { modulesPath = moduleDirPara; } }
public static Attachments createAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength) { LifecycleManager manager = null; try { AxisConfiguration configuration = msgContext.getRootContext().getAxisConfiguration(); manager = (LifecycleManager)configuration .getParameterValue(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER); if (manager == null) { manager = new LifecycleManagerImpl(); configuration.addParameter(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER, manager); } } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Exception getting Attachments LifecycleManager", e); } } return new Attachments(manager, inStream, contentTypeString, fileCacheForAttachments, attachmentRepoDir, attachmentSizeThreshold, contentLength); }
deploymentFileData.setClassLoader(isDirectory, axisConfig.getModuleClassLoader(), (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR), axisConfig.isChildFirstClassLoading());
public static Attachments createAttachments(MessageContext msgContext, InputStream inStream, String contentTypeString, boolean fileCacheForAttachments, String attachmentRepoDir, String attachmentSizeThreshold, int contentLength) { LifecycleManager manager = null; try { AxisConfiguration configuration = msgContext.getRootContext().getAxisConfiguration(); manager = (LifecycleManager)configuration .getParameterValue(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER); if (manager == null) { manager = new LifecycleManagerImpl(); configuration.addParameter(DeploymentConstants.ATTACHMENTS_LIFECYCLE_MANAGER, manager); } } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Exception getting Attachments LifecycleManager", e); } } return new Attachments(manager, inStream, contentTypeString, fileCacheForAttachments, attachmentRepoDir, attachmentSizeThreshold, contentLength); }
deploymentFileData.setClassLoader(isDirectory, axisConfig.getModuleClassLoader(), (File) axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR), axisConfig.isChildFirstClassLoading());
/** * Get the StatisticsCollector from synapse env. * * @param contextInfo server information * @return StatisticsCollector instance if there is any */ public static StatisticsCollector getStatisticsCollector(ServerContextInformation contextInfo) { if (contextInfo != null && contextInfo.getServerState() == ServerState.INITIALIZED) { Object o = contextInfo.getServerContext(); if (o instanceof ConfigurationContext) { ConfigurationContext context = (ConfigurationContext) o; SynapseEnvironment environment = (SynapseEnvironment) context.getAxisConfiguration().getParameterValue( SynapseConstants.SYNAPSE_ENV); if (environment != null) { return environment.getStatisticsCollector(); } } } return null; }
Iterator headerBlocks = envelope.getHeader().getHeadersToProcess((RolePlayer)msgContext.getConfigurationContext().getAxisConfiguration().getParameterValue("rolePlayer")); while (headerBlocks.hasNext()) { SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next();
.getAxisConfiguration(); String multipleCredentialDomain = (String) axisConfiguration.getParameterValue(DOMAIN_PARAMETER); if (multipleCredentialDomain == null) { multipleCredentialDomain = MULTIPLE_CREDENTIAL_DOMAIN_NAME;
.getAxisConfiguration(); String multipleCredentialDomain = (String) axisConfiguration.getParameterValue(DOMAIN_PARAMETER); if (multipleCredentialDomain == null) { multipleCredentialDomain = MULTIPLE_CREDENTIAL_DOMAIN_NAME;
/** * This method will call the normal initiation after setting the SYNAPSE_XML file to get from * the axis2 repository/conf folder * * @param configurationContext - ConfigurationContext of the Axis2 env * @param axisModule - AxisModule describing handler initializationModule of Synapse * @throws AxisFault - in-case of a failure in initiation */ public void init(ConfigurationContext configurationContext, AxisModule axisModule) throws AxisFault { Object synEnvParameter = configurationContext.getAxisConfiguration().getParameterValue( SynapseConstants.SYNAPSE_ENV); if (synEnvParameter != null && !(((SynapseEnvironment) synEnvParameter) .getServerContextInformation().getServerState() == ServerState.STARTED)) { log.info("Initializing the Synapse as a handler"); ServerConfigurationInformation configurationInformation = ServerConfigurationInformationFactory.createServerConfigurationInformation( configurationContext.getAxisConfiguration()); ServerContextInformation contextInfo = new ServerContextInformation(configurationContext, configurationInformation); ServerManager serverManager = new ServerManager(); serverManager.init(configurationInformation, contextInfo); serverManager.start(); } else { log.info("Detected an already started synapse instance using that for the mediation"); } }
/** * This method will call the normal initiation after setting the SYNAPSE_XML file to get from * the axis2 repository/conf folder * * @param configurationContext - ConfigurationContext of the Axis2 env * @param axisModule - AxisModule describing handler initializationModule of Synapse * @throws AxisFault - in-case of a failure in initiation */ public void init(ConfigurationContext configurationContext, AxisModule axisModule) throws AxisFault { Object synEnvParameter = configurationContext.getAxisConfiguration().getParameterValue( SynapseConstants.SYNAPSE_ENV); if (synEnvParameter != null && !(((SynapseEnvironment) synEnvParameter) .getServerContextInformation().getServerState() == ServerState.STARTED)) { log.info("Initializing the Synapse as a handler"); ServerConfigurationInformation configurationInformation = ServerConfigurationInformationFactory.createServerConfigurationInformation( configurationContext.getAxisConfiguration()); ServerContextInformation contextInfo = new ServerContextInformation(configurationContext, configurationInformation); ServerManager serverManager = new ServerManager(); serverManager.init(configurationInformation, contextInfo); serverManager.start(); } else { log.info("Detected an already started synapse instance using that for the mediation"); } }
axisConfiguration.getModuleClassLoader(), true, (File) axisConfiguration.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
/** * * @param to get an endpoint to send the information * @param member The member to which an EP has to be created * @param synCtx synapse context * @return the created endpoint */ private Endpoint getEndpoint(EndpointReference to, Member member, MessageContext synCtx) { AddressEndpoint endpoint = new AddressEndpoint(); endpoint.setEnableMBeanStats(false); endpoint.setName("DLB:" + member.getHostName() + ":" + member.getPort() + ":" + UUID.randomUUID()); EndpointDefinition definition = new EndpointDefinition(); definition.setSuspendMaximumDuration(10000); definition.setReplicationDisabled(true); definition.setAddress(to.getAddress()); endpoint.setDefinition(definition); endpoint.init((SynapseEnvironment) ((Axis2MessageContext) synCtx).getAxis2MessageContext(). getConfigurationContext().getAxisConfiguration(). getParameterValue(SynapseConstants.SYNAPSE_ENV)); return endpoint; }
/** * * @param to get an endpoint to send the information * @param member The member to which an EP has to be created * @param synCtx synapse context * @return the created endpoint */ private Endpoint getEndpoint(EndpointReference to, Member member, MessageContext synCtx) { AddressEndpoint endpoint = new AddressEndpoint(); endpoint.setEnableMBeanStats(false); endpoint.setName("DLB:" + member.getHostName() + ":" + member.getPort() + ":" + UUID.randomUUID()); EndpointDefinition definition = new EndpointDefinition(); definition.setSuspendMaximumDuration(10000); definition.setReplicationDisabled(true); definition.setAddress(to.getAddress()); endpoint.setDefinition(definition); endpoint.init((SynapseEnvironment) ((Axis2MessageContext) synCtx).getAxis2MessageContext(). getConfigurationContext().getAxisConfiguration(). getParameterValue(SynapseConstants.SYNAPSE_ENV)); return endpoint; }