• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TransportOutDescription类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.axis2.description.TransportOutDescription的典型用法代码示例。如果您正苦于以下问题:Java TransportOutDescription类的具体用法?Java TransportOutDescription怎么用?Java TransportOutDescription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TransportOutDescription类属于org.apache.axis2.description包,在下文中一共展示了TransportOutDescription类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadTransportProperties

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
private static Properties loadTransportProperties() throws Exception {
	
	transportProperties = new Properties();

	try {
		ConfigurationContext configContext = CarbonConfigurationContextFactory.getConfigurationContext();
		AxisConfiguration axisConfig = configContext.getAxisConfiguration();
		TransportOutDescription mailto = axisConfig.getTransportOut("mailto"); 
		ArrayList<Parameter> parameters = mailto.getParameters();
		
           for (Parameter parameter : parameters) {
			String prop = parameter.getName();
			String value = (String)parameter.getValue();
			transportProperties.setProperty(prop, value);
		}
	}
	catch (Exception e) {
		throw e;
	}
	
	return transportProperties;
}
 
开发者ID:vasttrafik,项目名称:wso2-community-api,代码行数:23,代码来源:MailUtil.java


示例2: authenticate

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
private boolean authenticate() throws Exception {
    ConfigurationContext configurationContext;
    configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
    Map<String, TransportOutDescription> transportsOut =configurationContext
            .getAxisConfiguration().getTransportsOut();
    for (TransportOutDescription transportOutDescription : transportsOut.values()) {
        transportOutDescription.getSender().init(configurationContext, transportOutDescription);
    }
    AuthenticationAdminStub authAdmin = new AuthenticationAdminStub(configurationContext,
            serverUrl);
    boolean isAuthenticated = authAdmin.login(userName, password, "localhost");
    cookie = (String) authAdmin._getServiceClient().getServiceContext()
            .getProperty(HTTPConstants.COOKIE_STRING);
    authAdmin._getServiceClient().cleanupTransport();
    return isAuthenticated;

}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:18,代码来源:Authenticator.java


示例3: initConfigurationContext

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
private void initConfigurationContext() throws Exception {
    HttpConnectionManager multiThreadedHttpConnectionManager = new MultiThreadedHttpConnectionManager();
    HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);

    File configFile = new File(DEFAULT_AXIS2_XML);

    if (!configFile.exists()) {
        configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
        configurationContext.setProperty(HTTPConstants.DEFAULT_MAX_CONNECTIONS_PER_HOST, MAX_CONNECTIONS_PER_HOST);
    } else {
        configurationContext = ConfigurationContextFactory.
                createConfigurationContextFromFileSystem(DEFAULT_CLIENT_REPO, DEFAULT_AXIS2_XML);
    }
    configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
    configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Constants.VALUE_TRUE);

    Map<String, TransportOutDescription> transportsOut =
            configurationContext.getAxisConfiguration().getTransportsOut();

    for (TransportOutDescription transportOutDescription : transportsOut.values()) {
        if (Constants.TRANSPORT_HTTP.equals(transportOutDescription.getName()) ||
                Constants.TRANSPORT_HTTPS.equals(transportOutDescription.getName())) {
            transportOutDescription.getSender().init(configurationContext, transportOutDescription);
        }
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:27,代码来源:BasicAuthEntitlementServiceClient.java


示例4: getClientCfgCtx

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
public ConfigurationContext getClientCfgCtx() throws Exception {
    ConfigurationContext cfgCtx =
        ConfigurationContextFactory.createConfigurationContext(new CustomAxisConfigurator());
    AxisConfiguration axisCfg = cfgCtx.getAxisConfiguration();
    axisCfg.engageModule("addressing");

    TransportInDescription trpInDesc = new TransportInDescription("udp");
    trpInDesc.setReceiver(new UDPListener());
    axisCfg.addTransportIn(trpInDesc);
    
    TransportOutDescription trpOutDesc = new TransportOutDescription("udp");
    trpOutDesc.setSender(new UDPSender());
    axisCfg.addTransportOut(trpOutDesc);
    
    return cfgCtx;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:17,代码来源:UDPTest.java


示例5: resumeSend

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * To resume the invocation at the send path , this is neened since it is require to call
 * TransportSender at the end
 *
 * @param msgContext
 * @return An InvocationResponse allowing the invoker to perhaps determine
 *         whether or not the message processing will ever succeed.
 * @throws AxisFault
 */
public static InvocationResponse resumeSend(MessageContext msgContext) throws AxisFault {
    if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
        log.trace(msgContext.getLogIDString() + " resumeSend:" + msgContext.getMessageID());
    }

    //REVIEW: This name is a little misleading, as it seems to indicate that there should be a resumeSendFault as well, when, in fact, this does both
    //REVIEW: Unlike with send, there is no wrapping try/catch clause which would
    //fire off the flowComplete on an error, as we have to assume that the
    //message will be resumed again, but perhaps we need to unwind back to
    //the point at which the message was resumed and provide another API
    //to allow the full unwind if the message is going to be discarded.
    //invoke the phases
    InvocationResponse pi = invoke(msgContext, RESUMING_EXECUTION);
    //Invoking Transport Sender
    if (pi.equals(InvocationResponse.CONTINUE)) {
        // write the Message to the Wire
        TransportOutDescription transportOut = msgContext.getTransportOut();
        TransportSender sender = transportOut.getSender();
        sender.invoke(msgContext);
        flowComplete(msgContext);
    }

    return pi;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:34,代码来源:AxisEngine.java


示例6: initTransportSenders

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * Initializes TransportSenders and TransportListeners with appropriate configuration information
 *
 * @param configContext : ConfigurationContext
 */
private static void initTransportSenders(ConfigurationContext configContext) {
    AxisConfiguration axisConf = configContext.getAxisConfiguration();

    // Initialize Transport Outs
    HashMap transportOuts = axisConf.getTransportsOut();

    Iterator values = transportOuts.values().iterator();

    while (values.hasNext()) {
        TransportOutDescription transportOut = (TransportOutDescription) values.next();
        TransportSender sender = transportOut.getSender();

        if (sender != null) {
            try {
                sender.init(configContext, transportOut);
            } catch (AxisFault axisFault) {
                log.info(Messages.getMessage("transportiniterror", transportOut.getName()));
            }
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:27,代码来源:ConfigurationContextFactory.java


示例7: ServiceClient

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * Create a service client for WSDL service identified by the QName of the wsdl:service element
 * in a WSDL document.
 *
 * @param configContext   The configuration context under which this service lives (may be
 *                        <code>null</code>, in which case a new local one will be created) *
 * @param wsdlURL         The URL of the WSDL document to read
 * @param wsdlServiceName The QName of the WSDL service in the WSDL document to create a client
 *                        for
 * @param portName        The name of the WSDL 1.1 port to create a client for. May be null (if
 *                        WSDL 2.0 is used or if only one port is there). .
 * @throws AxisFault if something goes wrong while creating a config context (if needed)
 */
public ServiceClient(ConfigurationContext configContext, URL wsdlURL,
                     QName wsdlServiceName, String portName) throws AxisFault {
    configureServiceClient(configContext, AxisService.createClientSideAxisService(wsdlURL,
            wsdlServiceName,
            portName,
            options));
    Parameter transportName = axisService.getParameter("TRANSPORT_NAME");
    if (transportName != null) {
        TransportOutDescription transportOut =
                configContext.getAxisConfiguration().getTransportOut(
                        transportName.getValue().toString());
        if (transportOut == null) {
            throw new AxisFault(
                    "Cannot load transport from binding, either defin in Axis2.config " +
                            "or set it explicitely in ServiceClinet.Options");
        } else {
            options.setTransportOut(transportOut);
        }
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:34,代码来源:ServiceClient.java


示例8: initializeRestClient

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * Initialize the rest client and set username and password of the user
 *
 * @param serverURL server URL
 * @param username  username
 * @param password  password
 * @throws AxisFault
 */
private void initializeRestClient(String serverURL, String username, String password) throws AxisFault {
    HttpTransportProperties.Authenticator authenticator = new HttpTransportProperties.Authenticator();
    authenticator.setUsername(username);
    authenticator.setPassword(password);
    authenticator.setPreemptiveAuthentication(true);

    ConfigurationContext configurationContext;
    try {
        configurationContext = ConfigurationContextFactory.createDefaultConfigurationContext();
    } catch (Exception e) {
        String msg = "Backend error occurred. Please contact the service admins!";
        throw new AxisFault(msg, e);
    }
    HashMap<String, TransportOutDescription> transportsOut = configurationContext
            .getAxisConfiguration().getTransportsOut();
    for (TransportOutDescription transportOutDescription : transportsOut.values()) {
        transportOutDescription.getSender().init(configurationContext, transportOutDescription);
    }

    this.restClient = new RestClient(serverURL, username, password);
}
 
开发者ID:apache,项目名称:stratos,代码行数:30,代码来源:RestCommandLineService.java


示例9: CarbonRemoteUserStoreManger

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * @param realmConfig
 * @param properties
 * @throws Exception
 */
public CarbonRemoteUserStoreManger(RealmConfiguration realmConfig, Map properties)
        throws Exception {

    ConfigurationContext configurationContext = ConfigurationContextFactory
            .createDefaultConfigurationContext();

    Map<String, TransportOutDescription> transportsOut = configurationContext
            .getAxisConfiguration().getTransportsOut();
    for (TransportOutDescription transportOutDescription : transportsOut.values()) {
        transportOutDescription.getSender().init(configurationContext, transportOutDescription);
    }

    String[] serverUrls = realmConfig.getUserStoreProperty(SERVER_URLS).split(",");

    for (int i = 0; i < serverUrls.length; i++) {
        remoteUserStore = new WSUserStoreManager(
                realmConfig.getUserStoreProperty(REMOTE_USER_NAME),
                realmConfig.getUserStoreProperty(PASSWORD), serverUrls[i],
                configurationContext);

        if (log.isDebugEnabled()) {
            log.debug("Remote Servers for User Management : " + serverUrls[i]);
        }

        remoteServers.put(serverUrls[i], remoteUserStore);
    }

    this.realmConfig = realmConfig;
    domainName = realmConfig.getUserStoreProperty(UserStoreConfigConstants.DOMAIN_NAME);
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:36,代码来源:CarbonRemoteUserStoreManger.java


示例10: UtilsUDPServer

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
public UtilsUDPServer() throws Exception {
    TransportInDescription trpInDesc = new TransportInDescription("udp");
    trpInDesc.setReceiver(new UDPListener());
    TransportOutDescription trpOutDesc = new TransportOutDescription("udp");
    trpOutDesc.setSender(new UDPSender());
    addTransport(trpInDesc, trpOutDesc);
    enableAddressing();
    
    List<Parameter> params = new LinkedList<Parameter>();
    params.add(new Parameter(UDPConstants.PORT_KEY, 3333));
    params.add(new Parameter(UDPConstants.CONTENT_TYPE_KEY, "text/xml+soap"));
    deployEchoService("EchoService", params);
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:14,代码来源:UtilsUDPServer.java


示例11: getDescriptionFor

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
private static String getDescriptionFor(ParameterInclude paramInclude) {
    if (paramInclude instanceof AxisService) {
        return "service '" + ((AxisService)paramInclude).getName() + "'";
    } else if (paramInclude instanceof TransportInDescription) {
        return "transport receiver '" + ((TransportInDescription)paramInclude).getName() + "'";
    } else if (paramInclude instanceof TransportOutDescription) {
        return "transport sender '" + ((TransportOutDescription)paramInclude).getName() + "'";
    } else {
        return paramInclude.getClass().getName();
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:12,代码来源:ParamUtils.java


示例12: init

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * Initialize the generic transport sender.
 *
 * @param cfgCtx the axis configuration context
 * @param transportOut the transport-out description
 * @throws AxisFault on error
 */
public void init(ConfigurationContext cfgCtx, TransportOutDescription transportOut)
    throws AxisFault {
    this.cfgCtx = cfgCtx;
    this.transportOut = transportOut;
    this.transportIn  = cfgCtx.getAxisConfiguration().getTransportIn(getTransportName());
    this.state = BaseConstants.STARTED;

    // register with JMX
    mbeanSupport = new TransportMBeanSupport(this, getTransportName());
    mbeanSupport.register();
    log.info(getTransportName().toUpperCase() + " Sender started");
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:20,代码来源:AbstractTransportSender.java


示例13: createTransportOutDescription

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
public TransportOutDescription createTransportOutDescription() throws Exception {
    TransportOutDescription trpOutDesc = new TransportOutDescription(MailConstants.TRANSPORT_NAME);
    trpOutDesc.setSender(new MailTransportSender());
    trpOutDesc.addParameter(new Parameter(MailConstants.TRANSPORT_MAIL_DEBUG, "true"));
    for (Map.Entry<String,String> prop : getOutProperties().entrySet()) {
        trpOutDesc.addParameter(new Parameter(prop.getKey(), prop.getValue()));
    }
    return trpOutDesc;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:10,代码来源:MailTestEnvironment.java


示例14: setTransportOutDetails

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
public void setTransportOutDetails(TransportOutDescription transportOutDetails) throws AxisFault {

         if (transportOutDetails.getParameter(SMSTransportConstents.MODEM_GATEWAY_ID) != null) {
            gsmTransportOutDetails.setGatewayId((String) transportOutDetails.getParameter(
                    SMSTransportConstents.MODEM_GATEWAY_ID).getValue());
        } else {
            throw new AxisFault("GATEWAY ID NOT SET for the SMS transprot");
        }

        if (transportOutDetails.getParameter(SMSTransportConstents.COM_PORT) != null) {
            gsmTransportOutDetails.setComPort((String) transportOutDetails.getParameter(
                    SMSTransportConstents.COM_PORT).getValue());
        } else {
            throw new AxisFault("COM PORT NOT SET for the SMS transprot");
        }
        if (transportOutDetails.getParameter(SMSTransportConstents.BAUD_RATE) != null) {
            int bRate = Integer.parseInt((String) transportOutDetails.getParameter(
                    SMSTransportConstents.BAUD_RATE).getValue());
            gsmTransportOutDetails.setBaudRate(bRate);
        } else {
            throw new AxisFault("BAUD RATE NOT SET for the SMS transprot");
        }
        if (transportOutDetails.getParameter(SMSTransportConstents.MANUFACTURER) != null) {
            gsmTransportOutDetails.setManufacturer((String) transportOutDetails.getParameter(
                    SMSTransportConstents.MANUFACTURER).getValue());
        } else {
            throw new AxisFault("Manufactuer NOT SET for the SMS transprot");
        }

        if (transportOutDetails.getParameter(SMSTransportConstents.MODEL) != null) {
            gsmTransportOutDetails.setModel((String) transportOutDetails.getParameter(
                    SMSTransportConstents.MODEL).getValue());
        } else {
            throw new AxisFault("Model NOT SET for the SMS transprot");
        }


    }
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:39,代码来源:GSMImplManager.java


示例15: setTransportOutDetails

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
public void setTransportOutDetails(TransportOutDescription transportOutDetails) throws AxisFault{
     if(transportOutDetails == null) {
        throw new AxisFault("No transport in details");
    }

    if(transportOutDetails.getParameter(SMSTransportConstents.SYSTEM_TYPE) != null){
        smppTransportOutDetails.setSystemType((String)transportOutDetails.getParameter(
                SMSTransportConstents.SYSTEM_TYPE).getValue());
    }

    if (transportOutDetails.getParameter(SMSTransportConstents.SYSTEM_ID) != null) {
        smppTransportOutDetails.setSystemId((String)transportOutDetails.getParameter(SMSTransportConstents.SYSTEM_ID).
                getValue());
    } else {
        throw new AxisFault("System Id not set");
    }

    if (transportOutDetails.getParameter(SMSTransportConstents.PASSWORD) != null) {
        smppTransportOutDetails.setPassword((String)transportOutDetails.getParameter(SMSTransportConstents.PASSWORD).
                getValue());
    } else {
        throw new AxisFault("password not set");
    }

    if(transportOutDetails.getParameter(SMSTransportConstents.HOST) != null) {
        smppTransportOutDetails.setHost((String)transportOutDetails.getParameter(SMSTransportConstents.HOST).
                getValue());
    }

    if(transportOutDetails.getParameter(SMSTransportConstents.PORT) != null) {
        smppTransportOutDetails.setPort(Integer.parseInt((String)transportOutDetails.getParameter(
                SMSTransportConstents.PORT).getValue()));
    }

    if(transportOutDetails.getParameter(SMSTransportConstents.PHONE_NUMBER) != null) {
        smppTransportOutDetails.setPhoneNumber((String)transportOutDetails.getParameter(
                SMSTransportConstents.PHONE_NUMBER).getValue());
    }
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:40,代码来源:SMPPImplManager.java


示例16: init

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * Initialize the SMS Maneger with TransportOutDiscription
 * if the Maneger is already inited  it will set the Transport Outdetails
 * in the Current Implimentation Manage
 * @param transportOutDescription
 * @param configurationContext
 */
public void init(TransportOutDescription transportOutDescription , ConfigurationContext configurationContext) throws
        AxisFault {
    if(!inited) {
        basicInit(transportOutDescription , configurationContext);
    }

    Parameter formatterClass = transportOutDescription.getParameter(SMSTransportConstents.FORMATTER_CLASS);

    if(formatterClass == null) {
        messageFormatter = new DefaultSMSMessageFormatterImpl();
    }else {
        try {
            messageFormatter = (SMSMessageFormatter)Class.forName((String)formatterClass.getValue()).newInstance();
        } catch (Exception e) {
            throw new AxisFault("Error while instentiating the Class: " +formatterClass.getValue() ,e);
        }
    }
    currentImplimentation.setTransportOutDetails(transportOutDescription);

    Parameter invertS_n_D = transportOutDescription.getParameter(
            SMSTransportConstents.INVERT_SOURCE_AND_DESTINATION);
    if(invertS_n_D != null) {
        String val = (String)invertS_n_D.getValue();
        if("false".equals(val)) {
            invertSourceAndDestination = false;
        } else if("true".equals(val)) {
            invertSourceAndDestination = true;
        } else {
            log.warn("Invalid parameter value set to the parameter invert_source_and_destination," +
                    "setting the default value :true ");
            invertSourceAndDestination = true;
        }
    }
    inited = true;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:43,代码来源:SMSManager.java


示例17: testTransactionCommandParameter

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
 * Test case for EI-1244.
 * test transport.jms.TransactionCommand parameter in transport url when sending the message.
 * This will verify the fixes which prevent possible OOM issue when publishing messages to a broker using jms.
 *
 * @throws Exception
 */
public void testTransactionCommandParameter() throws Exception {
    JMSSender jmsSender = PowerMockito.spy(new JMSSender());
    JMSOutTransportInfo jmsOutTransportInfo = Mockito.mock(JMSOutTransportInfo.class);
    JMSMessageSender jmsMessageSender = Mockito.mock(JMSMessageSender.class);
    Session session = Mockito.mock(Session.class);

    Mockito.doReturn(session).when(jmsMessageSender).getSession();
    PowerMockito.whenNew(JMSOutTransportInfo.class).withArguments(any(String.class))
            .thenReturn(jmsOutTransportInfo);
    Mockito.doReturn(jmsMessageSender).when(jmsOutTransportInfo).createJMSSender(any(MessageContext.class));
    PowerMockito.doNothing()
            .when(jmsSender, "sendOverJMS", ArgumentMatchers.any(), ArgumentMatchers.any(), ArgumentMatchers.any(),
                    ArgumentMatchers.any(), ArgumentMatchers.any());

    jmsSender.init(new ConfigurationContext(new AxisConfiguration()), new TransportOutDescription("jms"));
    MessageContext messageContext = new MessageContext();
    //append the transport.jms.TransactionCommand
    String targetAddress = "jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName="
            + "QueueConnectionFactory&transport.jms.TransactionCommand=begin"
            + "&java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory";
    Transaction transaction = new TestJMSTransaction();
    messageContext.setProperty(JMSConstants.JMS_XA_TRANSACTION, transaction);

    jmsSender.sendMessage(messageContext, targetAddress, null);
    Map<Transaction, ArrayList<JMSMessageSender>> jmsMessageSenderMap = Whitebox
            .getInternalState(JMSSender.class, "jmsMessageSenderMap");
    Assert.assertEquals("Transaction not added to map", 1, jmsMessageSenderMap.size());
    List senderList = jmsMessageSenderMap.get(transaction);
    Assert.assertNotNull("List is null", senderList );
    Assert.assertEquals("List is empty", 1, senderList.size());
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:39,代码来源:JMSSenderTestCase.java


示例18: createTransportOutDescription

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
public TransportOutDescription createTransportOutDescription() throws Exception {
    TransportOutDescription trpOutDesc = new TransportOutDescription(JMSSender.TRANSPORT_NAME);
    if (cfOnSender) {
        setupTransport(trpOutDesc);
    }
    trpOutDesc.setSender(new JMSSender());
    return trpOutDesc;
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:9,代码来源:JMSTransportDescriptionFactory.java


示例19: init

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
    * Initialize the transport sender by reading pre-defined connection factories for
    * outgoing messages. These will create sessions (one per each destination dealt with)
    * to be used when messages are being sent.
    * @param confContext the configuration context
    * @param transportOut the transport sender definition from axis2.xml
    * @throws AxisFault on error
    */	
public void init(ConfigurationContext confContext,
		TransportOutDescription transportOut) throws AxisFault {
	//if connection details are available from axis configuration
	//use those & connect to jabber server(s)
	serverCredentials = new XMPPServerCredentials();
	getConnectionDetailsFromAxisConfiguration(transportOut);	
	
	defaultConnectionFactory = new XMPPConnectionFactory();
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:18,代码来源:XMPPSender.java


示例20: getConnectionDetailsFromAxisConfiguration

import org.apache.axis2.description.TransportOutDescription; //导入依赖的package包/类
/**
    * Extract connection details from axis2.xml's transportsender section
    * @param serverCredentials
    * @param transportOut
    */
   private void getConnectionDetailsFromAxisConfiguration(TransportOutDescription transportOut){
   	if(transportOut != null){
		Parameter serverUrl = transportOut.getParameter(XMPPConstants.XMPP_SERVER_URL);
		if (serverUrl != null) {
			serverCredentials.setServerUrl(Utils.getParameterValue(serverUrl));
		}
		
		Parameter userName = transportOut.getParameter(XMPPConstants.XMPP_SERVER_USERNAME);
		if (userName != null) {
			serverCredentials.setAccountName(Utils.getParameterValue(userName));
		}
	
		Parameter password = transportOut.getParameter(XMPPConstants.XMPP_SERVER_PASSWORD);
		if (password != null) {
			serverCredentials.setPassword(Utils.getParameterValue(password));
		}

		Parameter serverType = transportOut.getParameter(XMPPConstants.XMPP_SERVER_TYPE);			
		if (serverType != null) {
			serverCredentials.setServerType(Utils.getParameterValue(serverType));
		}	
		
		Parameter domainName = transportOut.getParameter(XMPPConstants.XMPP_DOMAIN_NAME);
		if (serverUrl != null) {
			serverCredentials.setDomainName(Utils.getParameterValue(domainName));
		}
	}
}
 
开发者ID:wso2,项目名称:wso2-axis2-transports,代码行数:34,代码来源:XMPPSender.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TriggerSyncReceiver类代码示例发布时间:2022-05-22
下一篇:
Java Tree类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap