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


Java ConfigurationContextFactory.createConfigurationContextFromFileSystem方法代码示例

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


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

示例1: init

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
@Override
public void init(PublisherDataHolder propertyHolder) throws EntitlementException {

    PublisherPropertyDTO[] propertyDTOs = propertyHolder.getPropertyDTOs();
    for (PublisherPropertyDTO dto : propertyDTOs) {
        if ("subscriberURL".equals(dto.getId())) {
            serverUrl = dto.getValue();
        } else if ("subscriberUserName".equals(dto.getId())) {
            serverUserName = dto.getValue();
        } else if ("subscriberPassword".equals(dto.getId())) {
            serverPassword = dto.getValue();
        }
    }

    try {
        configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    } catch (AxisFault axisFault) {
        log.error("Error while initializing module", axisFault);
        throw new EntitlementException("Error while initializing module", axisFault);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:22,代码来源:CarbonBasicPolicyPublisherModule.java

示例2: AxisOperationClient

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public AxisOperationClient() {


        String repositoryPath = System.getProperty(ServerConstants.CARBON_HOME) + File.separator +
                "samples" + File.separator + "axis2Server" + File.separator + "repository";
        File repository = new File(repositoryPath);
        log.info("Using the Axis2 repository path: " + repository.getAbsolutePath());

        try {
            cfgCtx =
                    ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository.getCanonicalPath(),
                            null);
            serviceClient = new ServiceClient(cfgCtx, null);
            log.info("Sample clients initialized successfully...");
        } catch (Exception e) {
            log.error("Error while initializing the Operational Client", e);
        }
    }
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:AxisOperationClient.java

示例3: init

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
private void init() throws IOException {
    String repositoryPath =
        System.getProperty(ESBTestConstant.CARBON_HOME) + File.separator + "samples" + File.separator +
        "axis2Client" + File.separator + DEFAULT_CLIENT_REPO;

    File repository = new File(repositoryPath);
    if (log.isDebugEnabled()) {
        log.debug("Axis2 repository path: " + repository.getAbsolutePath());
    }

    ConfigurationContext configurationContext =
        ConfigurationContextFactory.createConfigurationContextFromFileSystem(
            repository.getCanonicalPath(), null);
    serviceClient = new ServiceClient(configurationContext, null);
    log.info("LoadBalanceSessionFullClient initialized successfully...");
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:LoadBalanceSessionFullClient.java

示例4: LoadbalanceFailoverClient

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public LoadbalanceFailoverClient() {
    String repositoryPath = System.getProperty(ESBTestConstant.CARBON_HOME) + File.separator + "samples" + File.separator + "axis2Client" +
            File.separator + "client_repo";

    File repository = new File(repositoryPath);
    log.info("Using the Axis2 repository path: " + repository.getAbsolutePath());

    try {
        cfgCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                repository.getCanonicalPath(), null);
        serviceClient = new ServiceClient(cfgCtx, null);
        log.info("Sample clients initialized successfully...");
    } catch (Exception e) {
        log.error("Error while initializing the StockQuoteClient", e);
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:17,代码来源:LoadbalanceFailoverClient.java

示例5: SampleAxis2Server

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public SampleAxis2Server(String axis2xmlFile) {
    repositoryPath = System.getProperty(ServerConstants.CARBON_HOME) + File.separator +
                     "samples" + File.separator + "axis2Server" + File.separator + "repository";
    File repository = new File(repositoryPath);
    log.info("Using the Axis2 repository path: " + repository.getAbsolutePath());

    try {
        File axis2xml = copyResourceToFileSystem(axis2xmlFile, "axis2.xml");
        if (axis2xml == null) {
            log.error("Error while copying the test axis2.xml to the file system");
            return;
        }
        log.info("Loading axis2.xml from: " + axis2xml.getAbsolutePath());
        cfgCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                repository.getAbsolutePath(), axis2xml.getAbsolutePath());
    } catch (Exception e) {
        log.error("Error while initializing the configuration context", e);
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:20,代码来源:SampleAxis2Server.java

示例6: Axis2ServerManager

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public Axis2ServerManager(String axis2xmlFile) {
    repositoryPath = System.getProperty(ServerConstants.CARBON_HOME) + File.separator +
            "samples" + File.separator + "axis2Server" + File.separator + "repository";
    File repository = new File(repositoryPath);
    log.info("Using the Axis2 repository path: " + repository.getAbsolutePath());
    try {
        File axis2xml = copyResourceToFileSystem(axis2xmlFile, "axis2.xml");
        if (!axis2xml.exists()) {
            log.error("Error while copying the test axis2.xml to the file system");
            return;
        }
        log.info("Loading axis2.xml from: " + axis2xml.getAbsolutePath());
        cfgCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                repository.getAbsolutePath(), axis2xml.getAbsolutePath());
    } catch (Exception e) {
        log.error("Error while initializing the configuration context", e);
    }
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:19,代码来源:Axis2ServerManager.java

示例7: main

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
	String epr = "https://" + HOST_IP + ":" + HOST_HTTPS_PORT + "/services/samples/SecureDataService";
	System.setProperty("javax.net.ssl.trustStore", (new File(CLIENT_JKS_PATH)).getAbsolutePath());
	ConfigurationContext ctx = ConfigurationContextFactory
			.createConfigurationContextFromFileSystem(null, null);
               SecureDataServiceStub stub = new SecureDataServiceStub(ctx, epr);
	ServiceClient client = stub._getServiceClient();
	Options options = client.getOptions();
	client.engageModule("rampart");		
	options.setUserName("admin");
	options.setPassword("admin");

	options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, loadPolicy(SECURITY_POLICY_PATH));
	Office[] offices = stub.showAllOffices();
	for (Office office : offices) {
		System.out.println("\t-----------------------------");
		System.out.println("\tOffice Code: " + office.getOfficeCode());
		System.out.println("\tPhone: " + office.getPhone());
		System.out.println("\tAddress Line 1: " + office.getAddressLine1());
		System.out.println("\tAddress Line 2: " + office.getAddressLine2());
		System.out.println("\tCity: " + office.getCity());			
		System.out.println("\tState: " + office.getState());
		System.out.println("\tPostal Code: " + office.getPostalCode());
		System.out.println("\tCountry: " + office.getCountry());
	}
}
 
开发者ID:wso2,项目名称:product-ei,代码行数:27,代码来源:SecureSample.java

示例8: RemoteAppManagerConnector

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public RemoteAppManagerConnector(AppManagementConfig appManagementConfig, DeviceManagementRepository pluginRepository) {

        IdentityConfigurations identityConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig().
                getDeviceManagementConfigRepository().getIdentityConfigurations();
        this.authenticator =
                new ServiceAuthenticator(identityConfig.getAdminUsername(), identityConfig.getAdminPassword());
        this.oAuthAdminServiceUrl =
                identityConfig.getServerUrl() + DeviceManagementConstants.AppManagement.OAUTH_ADMIN_SERVICE;
        try {
            this.configCtx = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
        } catch (AxisFault e) {
            throw new IllegalArgumentException("Error occurred while initializing Axis2 Configuration Context. " +
                    "Please check if an appropriate axis2.xml is provided", e);
        }
        this.pluginRepository = pluginRepository;
    }
 
开发者ID:wso2-incubator,项目名称:iot-server-appliances,代码行数:17,代码来源:RemoteAppManagerConnector.java

示例9: setUp

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
protected void setUp() throws Exception {
    super.setUp();
   
    System.setProperty("javax.net.ssl.trustStore", CARBON_HOME + "/resources/security/wso2carbon.jks");
    System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
    System.setProperty("javax.net.ssl.trustStoreType","JKS");
    try {
        configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(axis2Repo, axis2Conf);
        authenticate(configContext, serverURL);
        registry = new WSRegistryServiceClient(serverURL, "admin", "admin", configContext);
        registry.addSecurityOptions(policyPath, CARBON_HOME + "/resources/security/wso2carbon.jks",username,password);
        
    } catch (Exception e) {
        e.printStackTrace();
        fail("Failed to authenticate the client. Caused by: " + e.getMessage());
    }
    
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:19,代码来源:SecurityTestSetup.java

示例10: start

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public static synchronized void start() throws Exception {
    if (count == 0) {

        // start tcp server
        File file = new File(prefixBaseDirectory(Constants.TESTING_REPOSITORY));
        System.out.println(file.getAbsoluteFile());
        if (!file.exists()) {
            throw new Exception("Repository directory does not exist");
        }
        ConfigurationContext er =
            ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                    file.getAbsolutePath(), file.getAbsolutePath() + "/conf/axis2.xml");
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e1) {
            throw new AxisFault("Thread interuptted", e1);
        }
        receiver = new TCPTransportListener();
        receiver.init(er, er.getAxisConfiguration().getTransportIn(Constants.TRANSPORT_TCP));
        receiver.start();
    }
    count++;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:24,代码来源:UtilsTCPServer.java

示例11: initClient

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
private void initClient () throws AxisFault {

		String CLIENT_REPO = null;
		String AXIS2_XML = null;
		
		if (repo!=null) {
			CLIENT_REPO = repo;
			AXIS2_XML = repo + File.separator + "axis2.xml";
		} else {
//			throw new AxisFault ("Please specify the client repository as a program argument.Use '-h' for help.");
		}
		
		ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(CLIENT_REPO,null);
		serviceClient = new ServiceClient (configContext,null); //TODO give a repo
		
		options = new Options ();
		serviceClient.setOptions(options);
		serviceClient.engageModule(new QName ("addressing"));
		
		eventingClient = new EventingClient (serviceClient);
		
		String toAddress = "http://" + serverIP + ":" + port + toAddressPart;
		options.setTo(new EndpointReference (toAddress));
	}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:25,代码来源:Client.java

示例12: testEchoXMLSync

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public void testEchoXMLSync() throws Exception {
    OMElement payload = TestingUtils.createDummyOMElement();

    Options clientOptions = new Options();
    clientOptions.setTransportInProtocol(Constants.TRANSPORT_HTTP);

    ConfigurationContext configContext =
            ConfigurationContextFactory
                    .createConfigurationContextFromFileSystem(CLIENT_HOME, null);
    ServiceClient sender = new ServiceClient(configContext, null);
    sender.setOptions(clientOptions);
    clientOptions.setTo(targetEPR);

    OMElement result = sender.sendReceive(payload);


    TestingUtils.compareWithCreatedOMElement(result);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:EchoRawXMLChunkedTest.java

示例13: testFireAndForget

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public void testFireAndForget() throws Exception {

        EndpointReference targetEPR = new EndpointReference(
                "http://127.0.0.1:" + (UtilServer.TESTING_PORT)
//            "http://127.0.0.1:" + 5556
                        + "/axis2/services/Echo/echoOMElementNoResponse");
        OMElement payload = createDummyOMElement();
        Options options = new Options();
        options.setTo(targetEPR);
        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        options.setAction("urn:echoOMElementNoResponse");
        ConfigurationContext configContext =
                ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
        ServiceClient sender = new ServiceClient(configContext, null);
        sender.setOptions(options);

        sender.fireAndForget(payload);
        Thread.sleep(100);
        String value = System.getProperty("echoOMElementNoResponse");
        System.setProperty("echoOMElementNoResponse", "");
        assertEquals(value, "echoOMElementNoResponse");
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:24,代码来源:ServiceClientTest.java

示例14: testEchoXMLMultipleSync

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public void testEchoXMLMultipleSync() throws Exception {
    OMElement payload = TestingUtils.createDummyOMElement();
    Options options = new Options();
    options.setTo(targetEPR);
    options.setCallTransportCleanup(true);
    options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
    options.setTimeOutInMilliSeconds(50000);
    ConfigurationContext configContext =
            ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    ServiceClient sender = new ServiceClient(configContext, null);
    sender.setOptions(options);
    for (int i = 0; i < 5; i++) {
        OMElement result = sender.sendReceive(payload);
        TestingUtils.compareWithCreatedOMElement(result);
    }
    sender.cleanup();
    configContext.terminate();
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:19,代码来源:EchoRawXMLMultipleSyncTest.java

示例15: testEchoXMLSync

import org.apache.axis2.context.ConfigurationContextFactory; //导入方法依赖的package包/类
public void testEchoXMLSync() throws Exception {

        OMElement payload = TestingUtils.createDummyOMElement();
        Options options = new Options();
        options.setTo(targetEPR);
        options.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
        options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

        ConfigurationContext configContext =
                ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
        ServiceClient sender = new ServiceClient(configContext, null);
        sender.setOptions(options);

        OMElement result = sender.sendReceive(payload);

        TestingUtils.compareWithCreatedOMElement(result);
    }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:18,代码来源:EchoRawXMLTest.java


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