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


Java TransportOutDescription类代码示例

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


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


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