本文整理汇总了Java中org.apache.axis2.engine.AxisConfiguration.getParameter方法的典型用法代码示例。如果您正苦于以下问题:Java AxisConfiguration.getParameter方法的具体用法?Java AxisConfiguration.getParameter怎么用?Java AxisConfiguration.getParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis2.engine.AxisConfiguration
的用法示例。
在下文中一共展示了AxisConfiguration.getParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: invoke
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public void invoke() {
ConfigurationContext mainCfgCtx =
ConfigHolder.getInstance().getServerConfigurationContext();
if (mainCfgCtx != null) {
AxisConfiguration mainAxisConfig = mainCfgCtx.getAxisConfiguration();
if (mainAxisConfig.getParameter(DiscoveryConstants.DISCOVERY_PROXY) != null) {
if (log.isDebugEnabled()) {
log.debug("Sending BYE messages for services deployed in the super tenant");
}
Util.unregisterServiceObserver(mainAxisConfig, true);
}
} else {
log.warn("Unable to notify service undeployment. ConfigurationContext is " +
"unavailable.");
}
}
示例2: getScriptServicesDirectory
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Gets the repo directory for the scripts. The scripts directory is a
* sub-directory of the Axis2 repository directory. Its name may be defined
* by a 'scriptServicesDir' property in the axis2.xml otherwise it defaults
* a to a directory named 'scriptServices'.
*/
protected File getScriptServicesDirectory(AxisConfiguration axisConfig) throws DeploymentException {
try {
URL axis2Repository = axisConfig.getRepository();
Parameter scriptsDirParam = axisConfig.getParameter("scriptServicesDir");
String scriptsDir = scriptsDirParam == null ? "scriptServices" : (String)scriptsDirParam.getValue();
String path = URLDecoder.decode(axis2Repository.getPath(), defaultEncoding);
java.io.File repoDir =
new java.io.File(path.replace('/', File.separatorChar).replace('|', ':'));
return new File(repoDir, scriptsDir);
} catch (UnsupportedEncodingException e) {
throw new DeploymentException("UnsupportedEncodingException getting script service directory", e);
}
}
示例3: getParameter
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Retrieves configuration descriptor parameters at any level. The order of
* search is as follows:
* <ol>
* <li> Search in message description if it exists </li>
* <li> If parameter is not found or if axisMessage is null, search in
* AxisOperation </li>
* <li> If parameter is not found or if operationContext is null, search in
* AxisService </li>
* <li> If parameter is not found or if axisService is null, search in
* AxisConfiguration </li>
* </ol>
*
* @param key name of desired parameter
* @return Parameter <code>Parameter</code>
*/
public Parameter getParameter(String key) {
if( axisMessage != null ) {
return axisMessage.getParameter(key);
}
if (axisOperation != null) {
return axisOperation.getParameter(key);
}
if (axisService != null) {
return axisService.getParameter(key);
}
if (axisServiceGroup != null) {
return axisServiceGroup.getParameter(key);
}
if (configurationContext != null) {
AxisConfiguration baseConfig = configurationContext
.getAxisConfiguration();
return baseConfig.getParameter(key);
}
return null;
}
示例4: performMigrationToThread
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Activate any registered ThreadContextMigrators to move context info
* to the thread of execution.
*
* @param threadContextMigratorListID The name of the parameter in the
* AxisConfiguration that contains
* the list of migrators.
* @param msgContext
* @throws AxisFault
*/
public static void performMigrationToThread(String threadContextMigratorListID,
MessageContext msgContext)
throws AxisFault {
if (msgContext == null) {
return;
}
AxisConfiguration axisConfiguration =
msgContext.getConfigurationContext().getAxisConfiguration();
Parameter param = axisConfiguration.getParameter(threadContextMigratorListID);
if (param != null) {
List migratorList = (List) param.getValue();
int size = migratorList.size();
for (int i=0; i<size;i++) {
((ThreadContextMigrator) migratorList.get(i))
.migrateContextToThread(msgContext);
}
}
}
示例5: getMinSystemResponseTime
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public long getMinSystemResponseTime(AxisConfiguration axisConfig) {
Parameter processor =
axisConfig.getParameter(StatisticsConstants.RESPONSE_TIME_PROCESSOR);
if (processor != null) {
Object value = processor.getValue();
if (value instanceof ResponseTimeProcessor) {
return ((ResponseTimeProcessor) value).getMinResponseTime();
}
}
return 0;
}
示例6: disableServiceDiscovery
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Disable publishing services using WS-Discovery
*
* @param sendBye true is BYE messages should be sent before disabling WS-Discovery
* @throws Exception on error
*/
public void disableServiceDiscovery(boolean sendBye) throws Exception {
AxisConfiguration axisConfig = getAxisConfig();
Parameter param = axisConfig.getParameter(DiscoveryConstants.DISCOVERY_PROXY);
if (param == null) {
return;
}
DiscoveryMgtUtils.persistPublisherConfiguration(param.getValue().toString(), false,
getConfigSystemRegistry());
Util.unregisterServiceObserver(axisConfig, sendBye);
axisConfig.removeParameter(param);
}
示例7: getServiceDiscoveryConfig
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Get the current service discovery configuration
*
* @return a ServiceDiscoveryConfig instance
* @throws Exception on error
*/
public ServiceDiscoveryConfig getServiceDiscoveryConfig() throws Exception {
ServiceDiscoveryConfig config = new ServiceDiscoveryConfig();
AxisConfiguration axisConfig = getAxisConfig();
Parameter param = axisConfig.getParameter(DiscoveryConstants.DISCOVERY_PROXY);
config.setEnabled(param != null);
config.setProxyURL(DiscoveryMgtUtils.getDiscoveryProxyURL(axisConfig));
return config;
}
示例8: findServices
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Search the service artifacts stored in the registry and find the set of services
* that satisfy the conditions stated in the given WS-D probe. If the probe does not
* impose any restrictions on the result set, all the services in the registry will
* be returned.
*
* @param probe a WS-D probe describing the search criteria
* @return an array of TargetService instances matching the probe or null
* @throws Exception if an error occurs while accessing the registry
*/
public static TargetService[] findServices(Probe probe) throws Exception {
ServiceManager serviceManager = new ServiceManager(getRegistry());
DiscoveryServiceFilter filter = new DiscoveryServiceFilter(probe);
// Check whether the inactive services should be skipped when searching
AxisConfiguration axisConfig;
String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true);
ConfigurationContext mainCfgCtx = ConfigHolder.getInstance().getServerConfigurationContext();
if (tenantDomain != MultitenantConstants.SUPER_TENANT_DOMAIN_NAME) {
axisConfig = TenantAxisUtils.getTenantAxisConfiguration(tenantDomain, mainCfgCtx);
} else {
axisConfig = mainCfgCtx.getAxisConfiguration();
}
Parameter parameter = axisConfig.getParameter(DiscoveryConstants.SKIP_INACTIVE_SERVICES);
filter.setSkipInactiveServices(parameter == null || "true".equals(parameter.getValue()));
Service[] services = serviceManager.findServices(filter);
if (services != null && services.length > 0) {
TargetService[] targetServices = new TargetService[services.length];
for (int i = 0; i < services.length; i++) {
targetServices[i] = getTargetService(services[i]);
}
return targetServices;
}
return null;
}
示例9: enableServiceDiscovery
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Enable publishing services using WS-Discovery to the specified Discovery proxy
*
* @param proxyURL URL of the target discovery proxy
* @throws Exception on error
*/
public void enableServiceDiscovery(String proxyURL) throws Exception {
AxisConfiguration axisConfig = getAxisConfig();
if (axisConfig.getParameter(DiscoveryConstants.DISCOVERY_PROXY) != null) {
return;
}
Parameter param = new Parameter(DiscoveryConstants.DISCOVERY_PROXY, proxyURL);
param.setParameterElement(AXIOMUtil.stringToOM("<parameter name=\"" +
DiscoveryConstants.DISCOVERY_PROXY + "\">" + proxyURL + "</parameter>"));
axisConfig.addParameter(param);
Util.registerServiceObserver(axisConfig);
DiscoveryMgtUtils.persistPublisherConfiguration(proxyURL, true, getConfigSystemRegistry());
}
示例10: getHostname
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* First check whether the hostname parameter is there in AxisConfiguration (axis2.xml) ,
* if it is there then this will return that as the host name , o.w will return the IP address.
* @param axisConfiguration
* @return hostname
*/
public static String getHostname(AxisConfiguration axisConfiguration) {
if(axisConfiguration!=null){
Parameter param = axisConfiguration.getParameter(TransportListener.HOST_ADDRESS);
if (param != null) {
String hostAddress = ((String) param.getValue()).trim();
if(hostAddress!=null){
return hostAddress;
}
}
}
return null;
}
示例11: setupMemoryParms
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
private void setupMemoryParms( AxisConfiguration axisCfg) {
if (log.isDebugEnabled() ) {
log.debug("setupMemoryParms(AxisConfiguration) entry");
}
// determine what the setting for the memory optimization is
if (axisCfg != null) {
Parameter param = axisCfg.getParameter(Constants.Configuration.REDUCE_WSDL_MEMORY_CACHE);
reduceWSDLMemoryCache =
param != null && ((String) param.getValue()).equalsIgnoreCase("true");
param = axisCfg.getParameter(Constants.Configuration.REDUCE_WSDL_MEMORY_TYPE);
if (param != null) {
String value = (String) param.getValue();
if (value != null) {
Integer i = new Integer(value);
reduceWSDLMemoryType = i.intValue();
}
}
if (log.isDebugEnabled() ) {
log.debug("reduceWSDLMemoryCache:"+ reduceWSDLMemoryCache + ", reduceWSDLMemoryType:" + reduceWSDLMemoryType );
}
} else {
if (log.isDebugEnabled() ) {
log.debug("AxisConfiguration is null. This is unexpected" );
}
}
}
示例12: setupReleaseResources
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
private void setupReleaseResources(ConfigurationContext configurationContext) {
if (configurationContext != null) {
AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
if (axisConfiguration != null) {
Parameter param =
axisConfiguration.getParameter(Constants.Configuration.REDUCE_WSDL_MEMORY_CACHE);
if (param != null) {
releaseAxisServiceResources = ((String) param.getValue()).equalsIgnoreCase("true");
if (log.isDebugEnabled()) {
log.debug("EndpointDescription configured to release AxisService resources via "
+ Constants.Configuration.REDUCE_WSDL_MEMORY_CACHE);
}
}
}
}
else if(composite != null) {
Boolean reduceCache = (Boolean) composite.getProperties().get(Constants.Configuration.REDUCE_WSDL_MEMORY_CACHE);
if(reduceCache != null) {
if(log.isDebugEnabled()) {
log.debug("Retrieved the following reduce WSDL cache value: " + reduceCache +
" from the composite: " + composite.getClassName());
}
releaseAxisServiceResources = reduceCache;
}
}
}
示例13: unregisterServiceObserver
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* Disengage the TargetServiceObserver from the given AxisConfiguration. This will
* disable service discovery. If sendBye is set to 'true' this method will also send BYE
* messages to the discovery proxy before disabling the TargetServiceObserver. This method
* expects the discovery proxy parameter is available in the AxisConfiguration. Without
* that it will not send BYE messages even if sendBye is set to 'true'.
*
* @param axisConf AxisConfiguration instance
* @param sendBye true if BYE messages should be sent for all the deployed services
*/
public static void unregisterServiceObserver(AxisConfiguration axisConf, boolean sendBye) {
if (sendBye) {
Parameter discoveryProxyParam = axisConf.getParameter(DiscoveryConstants.DISCOVERY_PROXY);
if (discoveryProxyParam != null) {
MessageSender messageSender = new MessageSender();
try {
for (AxisService axisService : axisConf.getServices().values()) {
messageSender.sendBye(axisService, (String) discoveryProxyParam.getValue());
}
} catch (DiscoveryException e) {
log.error("Cannot send the bye message", e);
}
}
}
List<AxisObserver> observers = axisConf.getObserversList();
AxisObserver serviceObserver = null;
// Locate the TargetServiceObserver instance registered earlier
for (AxisObserver o : observers) {
if (o instanceof TargetServiceObserver) {
serviceObserver = o;
break;
}
}
if (serviceObserver != null) {
observers.remove(serviceObserver);
}
}
示例14: _isJAXBRemoveIllegalChars
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
/**
* _isJAXBRemoveIllegalChars
*
* Determine if illegal characters should be removed when JAXB beans are written
*
* @see Constants.JAXWS_JAXB_WRITE_REMOVE_ILLEGAL_CHARS
*
* @param mc
* @return true if property is set
*/
private static boolean _isJAXBRemoveIllegalChars(org.apache.axis2.context.MessageContext mc) {
boolean value = false;
if (mc == null) {
if (log.isDebugEnabled()) {
log.debug("_isJAXBRemoveIllegalChars returns false due to missing MessageContext");
}
return false;
}
// First examine the local property on the axis2 MessageContext
Boolean property = (Boolean) mc.getLocalProperty(
Constants.JAXWS_JAXB_WRITE_REMOVE_ILLEGAL_CHARS, false);
if (property != null) {
value = property.booleanValue();
if (log.isDebugEnabled()) {
log.debug("_isJAXBRemoveIllegalChars returns " + value + " per axis2 MessageContext property " +
Constants.JAXWS_JAXB_WRITE_REMOVE_ILLEGAL_CHARS);
}
return value;
}
// Now look at the configuration parameter
ConfigurationContext cc = mc.getConfigurationContext();
if (cc != null) {
AxisConfiguration baseConfig = cc.getAxisConfiguration();
if (baseConfig != null) {
Parameter p = baseConfig.getParameter(Constants.JAXWS_JAXB_WRITE_REMOVE_ILLEGAL_CHARS);
if (p != null) {
value = JavaUtils.isTrue(p.getValue());
if (log.isDebugEnabled()) {
log.debug("isJAXBRemoveIllegalChars returns " + value + " per inspection of Configuration property " +
Constants.JAXWS_JAXB_WRITE_REMOVE_ILLEGAL_CHARS);
}
return value;
}
}
}
if (log.isDebugEnabled()) {
log.debug("isJAXBRemoveIllegalChars returns the default: false");
}
return false;
}
示例15: getEPRsForService
import org.apache.axis2.engine.AxisConfiguration; //导入方法依赖的package包/类
public static EndpointReference[] getEPRsForService(ConfigurationContext configurationContext,
TransportInDescription trpInDesc, String serviceName, String ip, int port) throws AxisFault {
AxisConfiguration axisConfiguration = configurationContext.getAxisConfiguration();
Parameter param = axisConfiguration.getParameter(Constants.HTTP_FRONTEND_HOST_URL);
StringBuilder epr = new StringBuilder();
if (param != null) {
epr.append(param.getValue());
String servicePath = configurationContext.getServicePath();
if (epr.charAt(epr.length()-1) != '/' && !servicePath.startsWith("/")) {
epr.append('/');
}
epr.append(servicePath);
} else {
param = trpInDesc.getParameter(TransportListener.HOST_ADDRESS);
if (param != null) {
// TODO: Need to decide if we really want to deprecate this parameter.
// Reason to deprecate it is that it has a misleading name ("hostname"
// while it is actually a URL), that its role overlaps with that
// of the "httpFrontendHostUrl" parameter in the Axis configuration and
// that there might be a confusion with the "hostname" parameter in the
// Axis configuration (which has a different meaning).
// If we deprecate it, we need to remove it from all the axis2.xml sample
// files. Note that the same parameter seems to be used by the TCP transport,
// but it's role is not very clear (since TCP has no concept of request URI).
log.warn("Transport '" + trpInDesc.getName()
+ "' is configured with deprecated parameter '"
+ TransportListener.HOST_ADDRESS + "'. Please set '"
+ Constants.HTTP_FRONTEND_HOST_URL
+ "' in the Axis configuration instead.");
epr.append(param.getValue());
} else {
if (ip == null){
try {
ip = Utils.getIpAddress(configurationContext.getAxisConfiguration());
} catch (SocketException ex) {
AxisFault.makeFault(ex);
}
}
String scheme = trpInDesc.getName();
epr.append(scheme);
epr.append("://");
epr.append(ip);
if (!(scheme.equals("http") && port == 80
|| scheme.equals("https") && port == 443)) {
epr.append(':');
epr.append(port);
}
}
String serviceContextPath = configurationContext.getServiceContextPath();
if (epr.charAt(epr.length()-1) != '/' && !serviceContextPath.startsWith("/")) {
epr.append('/');
}
epr.append(serviceContextPath);
}
epr.append('/');
epr.append(serviceName);
epr.append('/');
return new EndpointReference[]{new EndpointReference(epr.toString())};
}