当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationContext.setProperty方法代码示例

本文整理汇总了Java中org.apache.axis2.context.ConfigurationContext.setProperty方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationContext.setProperty方法的具体用法?Java ConfigurationContext.setProperty怎么用?Java ConfigurationContext.setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis2.context.ConfigurationContext的用法示例。


在下文中一共展示了ConfigurationContext.setProperty方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getStubs

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private Stubs getStubs(String serverUrl) throws Exception
{
	final ConfigurationContext ctx = getConfiguration();

	final HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
	final ProxyDetails proxy = configService.getProxyDetails();
	if( proxy.isConfigured() && !proxy.isHostExcepted(new URL(serverUrl).getHost()) )
	{
		proxyProperties.setProxyName(proxy.getHost());
		proxyProperties.setProxyPort(proxy.getPort());
		ctx.setProperty(HTTPConstants.PROXY, proxyProperties);
	}
	ctx.setProperty(HTTPConstants.SO_TIMEOUT, 120000);
	ctx.setProperty(HTTPConstants.CONNECTION_TIMEOUT, 120000);

	return new Stubs(ctx, serverUrl);
}
 
开发者ID:equella,项目名称:Equella,代码行数:18,代码来源:BlackboardConnectorServiceImpl.java

示例2: verifyCertExistence

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Check whether the certificate is available in the file system
 *
 * @param fileName             file name
 * @param configurationContext configuration context of the current message
 */
private static boolean verifyCertExistence(String fileName, ConfigurationContext configurationContext) {
    String workDir = (String) configurationContext.getProperty(ServerConstants.WORK_DIR);
    String filePath = workDir + File.separator + "pub_certs" + File.separator + fileName;
    File pubCert = new File(workDir + File.separator + "pub_certs" + File.separator + fileName);

    //if cert is still available then exit
    if (pubCert.exists()) {
        Map fileResourcesMap = (Map) configurationContext.getProperty(WSO2Constants.FILE_RESOURCE_MAP);
        if (fileResourcesMap == null) {
            fileResourcesMap = new Hashtable();
            configurationContext.setProperty(WSO2Constants.FILE_RESOURCE_MAP, fileResourcesMap);
        }
        if (fileResourcesMap.get(fileName) == null) {
            fileResourcesMap.put(fileName, filePath);
        }
        return true;
    }
    return false;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:26,代码来源:KeyStoreMgtUtil.java

示例3: appendMessage

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Appends SOAP message metadata to a message buffer
 *
 * @param configCtx  The server ConfigurationContext
 * @param serviceName  The service name
 * @param operationName  The operation name
 * @param msgSeq The message sequence. Use -1 if unknown.
 */
protected void appendMessage(ConfigurationContext configCtx,
                             String serviceName,
                             String operationName,
                             Long msgSeq) {
    CircularBuffer<MessageInfo> buffer =
        (CircularBuffer<MessageInfo>) configCtx.getProperty(TracerConstants.MSG_SEQ_BUFFER);
    if (buffer == null){
        buffer = new CircularBuffer<MessageInfo>(TracerConstants.MSG_BUFFER_SZ);
        configCtx.setProperty(TracerConstants.MSG_SEQ_BUFFER, buffer);
    }
    GregorianCalendar cal = new GregorianCalendar();
    cal.setTime(new Date());
    MessageInfo messageInfo = new MessageInfo();
    messageInfo.setMessageSequence(msgSeq);
    messageInfo.setOperationName(operationName);
    messageInfo.setServiceId(serviceName);
    messageInfo.setTimestamp(cal);
    buffer.append(messageInfo);
}
 
开发者ID:wso2,项目名称:carbon-commons,代码行数:28,代码来源:AbstractTracingHandler.java

示例4: Stubs

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
public Stubs(ConfigurationContext ctx, String bbUrl) throws AxisFault
{
	this.ctx = ctx;
	this.bbUrl = bbUrl;

	/*
	 * Must use deprecated class of setting up security because the SOAP
	 * response doesn't include a security header. Using the deprecated
	 * OutflowConfiguration class we can specify that the security
	 * header is only for the outgoing SOAP message.
	 */
	ofc = new OutflowConfiguration();
	ofc.setActionItems("UsernameToken Timestamp");
	ofc.setUser("session");
	ofc.setPasswordType("PasswordText");

	final MultiThreadedHttpConnectionManager conMan = new MultiThreadedHttpConnectionManager();
	final HttpConnectionManagerParams params = new HttpConnectionManagerParams();
	params.setMaxTotalConnections(1000);
	params.setDefaultMaxConnectionsPerHost(100);
	params.setSoTimeout(60000);
	params.setConnectionTimeout(30000);
	conMan.setParams(params);

	httpClient = new HttpClient(conMan);
	final HttpClientParams clientParams = httpClient.getParams();
	clientParams.setAuthenticationPreemptive(false);
	clientParams.setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
	ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

	contextWebservice = new ContextWSStub(ctx, PathUtils.filePath(bbUrl, "webapps/ws/services/Context.WS"));
	initStub(contextWebservice);
}
 
开发者ID:equella,项目名称:Equella,代码行数:34,代码来源:BlackboardConnectorServiceImpl.java

示例5: dumpCert

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Dumping the generated pub. cert to a file
 *
 * @param configurationContext
 * @param cert                 content of the certificate
 * @param fileName             file name
 * @return file system location of the pub. cert
 */
public static String dumpCert(ConfigurationContext configurationContext, byte[] cert,
                              String fileName) {
    if (!verifyCertExistence(fileName, configurationContext)) {
        String workDir = (String) configurationContext.getProperty(ServerConstants.WORK_DIR);
        File pubCert = new File(workDir + File.separator + "pub_certs");

        if (fileName == null) {
            fileName = String.valueOf(System.currentTimeMillis() + new SecureRandom().nextDouble()) + ".cert";
        }
        if (!pubCert.exists()) {
            pubCert.mkdirs();
        }

        String filePath = workDir + File.separator + "pub_certs" + File.separator + fileName;
        OutputStream outStream = null;
        try {
            outStream = new FileOutputStream(filePath);
            outStream.write(cert);
        } catch (Exception e) {
            String msg = "Error when writing the public certificate to a file";
            log.error(msg);
            throw new SecurityException("msg", e);
        } finally {
            IdentityIOStreamUtils.flushOutputStream(outStream);
            IdentityIOStreamUtils.closeOutputStream(outStream);
        }

        Map fileResourcesMap = (Map) configurationContext.getProperty(WSO2Constants.FILE_RESOURCE_MAP);
        if (fileResourcesMap == null) {
            fileResourcesMap = new Hashtable();
            configurationContext.setProperty(WSO2Constants.FILE_RESOURCE_MAP, fileResourcesMap);
        }

        fileResourcesMap.put(fileName, filePath);
    }
    return WSO2Constants.ContextPaths.DOWNLOAD_PATH + "?id=" + fileName;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:46,代码来源:KeyStoreMgtUtil.java

示例6: dumpCert

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Dumping the generated pub. cert to a file
 *
 * @param configurationContext
 * @param cert                 content of the certificate
 * @param fileName             file name
 * @return file system location of the pub. cert
 */
public static String dumpCert(ConfigurationContext configurationContext, byte[] cert,
                              String fileName) {
    if (!verifyCertExistence(fileName, configurationContext)) {
        String workDir = (String) configurationContext.getProperty(ServerConstants.WORK_DIR);
        File pubCert = new File(workDir + File.separator + "pub_certs");

        if (fileName == null) {
            fileName = String.valueOf(System.currentTimeMillis() + Math.random()) + ".cert";
        }
        if (!pubCert.exists()) {
            pubCert.mkdirs();
        }

        String filePath = workDir + File.separator + "pub_certs" + File.separator + fileName;
        OutputStream outStream = null;
        try {
            outStream = new FileOutputStream(filePath);
            outStream.write(cert);
        } catch (Exception e) {
            String msg = "Error when writing the public certificate to a file";
            log.error(msg);
            throw new SecurityException("msg", e);
        } finally {
            IdentityIOStreamUtils.flushOutputStream(outStream);
            IdentityIOStreamUtils.closeOutputStream(outStream);
        }

        Map fileResourcesMap = (Map) configurationContext.getProperty(WSO2Constants.FILE_RESOURCE_MAP);
        if (fileResourcesMap == null) {
            fileResourcesMap = new Hashtable();
            configurationContext.setProperty(WSO2Constants.FILE_RESOURCE_MAP, fileResourcesMap);
        }

        fileResourcesMap.put(fileName, filePath);
    }
    return WSO2Constants.ContextPaths.DOWNLOAD_PATH + "?id=" + fileName;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:46,代码来源:KeyStoreMgtUtil.java

示例7: addApplicationContextMigrator

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Register a new ContextPropertyMigrator.
 *
 * @param configurationContext
 * @param contextMigratorListID The name of the property in the ConfigurationContext that
 *                              contains the list of migrators.
 * @param migrator
 */
public static void addApplicationContextMigrator(ConfigurationContext configurationContext,
                                                 String contextMigratorListID,
                                                 ApplicationContextMigrator migrator) {
    List<ApplicationContextMigrator> migratorList =
            (List<ApplicationContextMigrator>)configurationContext
                    .getProperty(contextMigratorListID);

    if (migratorList == null) {
        migratorList = new LinkedList<ApplicationContextMigrator>();
        configurationContext.setProperty(contextMigratorListID, migratorList);
    }

    synchronized (migratorList) {
        // Check to make sure we haven't already added this migrator to the
        // list.
        ListIterator<ApplicationContextMigrator> itr = migratorList.listIterator();
        while (itr.hasNext()) {
            ApplicationContextMigrator m = itr.next();
            if (m.getClass().equals(migrator.getClass())) {
                return;
            }
        }

        if (log.isDebugEnabled()) {
            log.debug("Adding ApplicationContextMigrator: " + migrator.getClass().getName());
        }
        migratorList.add(migrator);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:38,代码来源:ApplicationContextMigratorUtil.java

示例8: initConfigContext

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
/**
 * Initialize the Axis configuration context
 *
 * @param config Servlet configuration
 * @return ConfigurationContext
 * @throws ServletException
 */
protected ConfigurationContext initConfigContext(ServletConfig config) throws ServletException {
    try {
        ConfigurationContext configContext =
                ConfigurationContextFactory
                        .createConfigurationContext(new WarBasedAxisConfigurator(config));
        configContext.setProperty(Constants.CONTAINER_MANAGED, Constants.VALUE_TRUE);
        return configContext;
    } catch (Exception e) {
        log.info(e);
        throw new ServletException(e);
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:20,代码来源:AxisServlet.java

示例9: setConfigContext

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
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);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:15,代码来源:WarBasedAxisConfigurator.java

示例10: AutoscalerCloudControllerClient

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private AutoscalerCloudControllerClient() {
    MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new
            MultiThreadedHttpConnectionManager();
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    params.setDefaultMaxConnectionsPerHost(AS_CC_CLIENT_MAX_CONNECTIONS_PER_HOST);
    params.setMaxTotalConnections(AS_CC_CLIENT_MAX_TOTAL_CONNECTIONS);
    multiThreadedHttpConnectionManager.setParams(params);
    HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);

    try {
        ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
        ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
        XMLConfiguration conf = ConfUtil.getInstance(null).getConfiguration();
        int port = conf.getInt("autoscaler.cloudController.port", AutoscalerConstants
                .CLOUD_CONTROLLER_DEFAULT_PORT);
        String hostname = conf.getString("autoscaler.cloudController.hostname", "localhost");
        String epr = "https://" + hostname + ":" + port + "/" + AutoscalerConstants.CLOUD_CONTROLLER_SERVICE_SFX;
        int cloudControllerClientTimeout = conf.getInt("autoscaler.cloudController.clientTimeout", 180000);

        stub = new CloudControllerServiceStub(ctx, epr);
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, cloudControllerClientTimeout);
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT,
                cloudControllerClientTimeout);
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
        stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean
                .TRUE);
    } catch (Exception e) {
        log.error("Could not initialize cloud controller client", e);
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:31,代码来源:AutoscalerCloudControllerClient.java

示例11: CloudControllerServiceClient

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private CloudControllerServiceClient(String epr) throws AxisFault {
    MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new
            MultiThreadedHttpConnectionManager();
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    params.setDefaultMaxConnectionsPerHost(StratosConstants.CLOUD_CONTROLLER_CLIENT_MAX_CONNECTIONS_PER_HOST);
    params.setMaxTotalConnections(StratosConstants.CLOUD_CONTROLLER_CLIENT_MAX_TOTAL_CONNECTIONS);
    multiThreadedHttpConnectionManager.setParams(params);
    HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);
    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

    String ccSocketTimeout = System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_SOCKET_TIMEOUT) == null ?
            StratosConstants.DEFAULT_CLIENT_SOCKET_TIMEOUT :
            System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_SOCKET_TIMEOUT);

    String ccConnectionTimeout =
            System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_CONNECTION_TIMEOUT) == null ?
                    StratosConstants.DEFAULT_CLIENT_CONNECTION_TIMEOUT :
                    System.getProperty(StratosConstants.CLOUD_CONTROLLER_CLIENT_CONNECTION_TIMEOUT);
    try {
        stub = new CloudControllerServiceStub(ctx, epr);
        stub._getServiceClient().getOptions()
                .setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf(ccSocketTimeout));
        stub._getServiceClient().getOptions()
                .setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(ccConnectionTimeout));
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
        stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean
                .TRUE);
    } catch (AxisFault axisFault) {
        String msg = "Could not initialize cloud controller service client";
        log.error(msg, axisFault);
        throw new AxisFault(msg, axisFault);
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:35,代码来源:CloudControllerServiceClient.java

示例12: AutoscalerServiceClient

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private AutoscalerServiceClient(String epr) throws AxisFault {
    MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new
            MultiThreadedHttpConnectionManager();
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    params.setDefaultMaxConnectionsPerHost(StratosConstants.AUTOSCALER_CLIENT_MAX_CONNECTIONS_PER_HOST);
    params.setMaxTotalConnections(StratosConstants.AUTOSCALER_CLIENT_MAX_TOTAL_CONNECTIONS);
    multiThreadedHttpConnectionManager.setParams(params);
    HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);
    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

    String autosclaerSocketTimeout = System.getProperty(StratosConstants.AUTOSCALER_CLIENT_SOCKET_TIMEOUT) == null ?
            StratosConstants.DEFAULT_CLIENT_SOCKET_TIMEOUT :
            System.getProperty(StratosConstants.AUTOSCALER_CLIENT_SOCKET_TIMEOUT);

    String autosclaerConnectionTimeout = System.getProperty(StratosConstants.AUTOSCALER_CLIENT_CONNECTION_TIMEOUT)
            == null ? StratosConstants.DEFAULT_CLIENT_CONNECTION_TIMEOUT :
            System.getProperty(StratosConstants.AUTOSCALER_CLIENT_CONNECTION_TIMEOUT);
    try {
        stub = new AutoscalerServiceStub(ctx, epr);
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT,
                Integer.valueOf(autosclaerSocketTimeout));
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT,
                Integer.valueOf(autosclaerConnectionTimeout));
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
        stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean
                .TRUE);
    } catch (AxisFault axisFault) {
        String msg = "Could not initialize autoscaler service client";
        log.error(msg, axisFault);
        throw new AxisFault(msg, axisFault);
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:34,代码来源:AutoscalerServiceClient.java

示例13: StratosManagerServiceClient

import org.apache.axis2.context.ConfigurationContext; //导入方法依赖的package包/类
private StratosManagerServiceClient(String epr) throws AxisFault {
    MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new
            MultiThreadedHttpConnectionManager();
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    params.setDefaultMaxConnectionsPerHost(StratosConstants.STRATOS_MANAGER_CLIENT_MAX_CONNECTIONS_PER_HOST);
    params.setMaxTotalConnections(StratosConstants.STRATOS_MANAGER_CLIENT_MAX_TOTAL_CONNECTIONS);
    multiThreadedHttpConnectionManager.setParams(params);
    HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);
    ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    ctx.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);

    String ccSocketTimeout = System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT) == null ?
            StratosConstants.DEFAULT_CLIENT_SOCKET_TIMEOUT :
            System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_SOCKET_TIMEOUT);

    String ccConnectionTimeout = System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT)
            == null ?
            StratosConstants.DEFAULT_CLIENT_CONNECTION_TIMEOUT :
            System.getProperty(StratosConstants.STRATOS_MANAGER_CLIENT_CONNECTION_TIMEOUT);
    try {
        stub = new StratosManagerServiceStub(ctx, epr);
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.SO_TIMEOUT, Integer.valueOf
                (ccSocketTimeout));
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CONNECTION_TIMEOUT, Integer.valueOf
                (ccConnectionTimeout));
        stub._getServiceClient().getOptions().setProperty(HTTPConstants.CHUNKED, Constants.VALUE_FALSE);
        stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION, Boolean
                .TRUE);
    } catch (AxisFault axisFault) {
        String msg = "Could not initialize stratos manager service client";
        log.error(msg, axisFault);
        throw new AxisFault(msg, axisFault);
    }
}
 
开发者ID:apache,项目名称:stratos,代码行数:35,代码来源:StratosManagerServiceClient.java


注:本文中的org.apache.axis2.context.ConfigurationContext.setProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。