Refine search
private static HTTPClientPolicy createSystemProxyConfiguration() { // Retrieve system properties (if any) HTTPClientPolicy systemProxyConfiguration = null; String proxyHost = SystemPropertyAction.getPropertyOrNull(HTTP_PROXY_HOST); if (StringUtils.isEmpty(proxyHost)) { proxyHost = null; } if (proxyHost != null) { // System is configured with a proxy, use it systemProxyConfiguration = new HTTPClientPolicy(); systemProxyConfiguration.setProxyServer(proxyHost); systemProxyConfiguration.setProxyServerType(ProxyServerType.HTTP); // 8080 is the default proxy port value as per some documentation String proxyPort = SystemPropertyAction.getProperty(HTTP_PROXY_PORT, "8080"); if (StringUtils.isEmpty(proxyPort)) { proxyPort = "8080"; } systemProxyConfiguration.setProxyServerPort(Integer.parseInt(proxyPort)); // Load non proxy hosts String nonProxyHosts = SystemPropertyAction.getPropertyOrNull(HTTP_NON_PROXY_HOSTS); if (!StringUtils.isEmpty(nonProxyHosts)) { systemProxyConfiguration.setNonProxyHosts(nonProxyHosts); } } return systemProxyConfiguration; }
public static String getProperty(String name) { return AccessController.doPrivileged(new SystemPropertyAction(name)); }
@Override public Integer run() { return SystemPropertyAction.getInteger("org.apache.cxf.jaxrs.max_provider_cache_size", 100); } }).intValue();
public Bus createBus(String[] cfgFiles, boolean includeDefaults) { try { String userCfgFile = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_NAME); String sysCfgFileUrl = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_URL); final Resource r = BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE); boolean exists = true; if (r != null) { exists = AccessController .doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { return r.exists(); } }); } if (context == null && userCfgFile == null && cfgFiles == null && sysCfgFileUrl == null && (r == null || !exists) && includeDefaults) { return new org.apache.cxf.bus.CXFBusFactory().createBus(); } return finishCreatingBus(createApplicationContext(cfgFiles, includeDefaults)); } catch (BeansException ex) { LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null); throw new RuntimeException(ex); } }
private static int getInteger(String prop, int def) { try { String s = SystemPropertyAction.getPropertyOrNull(prop); if (StringUtils.isEmpty(s)) { return def; } int i = Integer.parseInt(s); if (i < 0) { i = def; } return i; } catch (Throwable t) { //ignore } return def; } private static long getLong(String prop, long def) {
private static synchronized ClassLoader getXJCClassLoader() { if (jaxbXjcLoader == null) { try { Class.forName("com.sun.tools.internal.xjc.api.XJC"); jaxbXjcLoader = ClassLoader.getSystemClassLoader(); } catch (Exception t2) { //couldn't find either, probably cause tools.jar isn't on //the classpath. Let's see if we can find the tools jar String s = SystemPropertyAction.getProperty("java.home"); if (!StringUtils.isEmpty(s)) { File home = new File(s); File jar = new File(home, "lib/tools.jar"); if (!jar.exists()) { jar = new File(home, "../lib/tools.jar"); } if (jar.exists()) { try { jaxbXjcLoader = new URLClassLoader(new URL[] {jar.toURI().toURL()}); Class.forName("com.sun.tools.internal.xjc.api.XJC", false, jaxbXjcLoader); } catch (Exception e) { jaxbXjcLoader = null; } } } } } return jaxbXjcLoader; }
protected void checkPublishPermission() { SecurityManager sm = System.getSecurityManager(); boolean checkPublishEndpointPermissionWithSecurityManager = Boolean.parseBoolean( SystemPropertyAction.getProperty( CHECK_PUBLISH_ENDPOINT_PERMISSON_PROPERTY_WITH_SECURITY_MANAGER, "true")); if (checkPublishEndpointPermissionWithSecurityManager && sm != null) { sm.checkPermission(PUBLISH_PERMISSION); } else if (Boolean.getBoolean(CHECK_PUBLISH_ENDPOINT_PERMISSON_PROPERTY)) { AccessController.checkPermission(PUBLISH_PERMISSION); } }
public static String getKeystore(String keyStoreLocation, Logger log) { String logMsg = null; if (keyStoreLocation != null) { logMsg = "KEY_STORE_SET"; } else { keyStoreLocation = SystemPropertyAction.getProperty("javax.net.ssl.keyStore"); if (keyStoreLocation != null) { logMsg = "KEY_STORE_SYSTEM_PROPERTY_SET"; } else { keyStoreLocation = SystemPropertyAction.getProperty("user.home") + "/.keystore"; logMsg = "KEY_STORE_NOT_SET"; } } LogUtils.log(log, Level.FINE, logMsg, keyStoreLocation); return keyStoreLocation; }
public static void setDefaultCipherTransformation(String n) { if (n == null) { n = SystemPropertyAction.getPropertyOrNull("org.apache.cxf.io.CachedOutputStream.CipherTransformation"); } defaultCipherTransformation = n; }
public static void setDefaultThreshold(int i) { if (i == -1) { String s = SystemPropertyAction.getProperty("org.apache.cxf.io.CachedOutputStream.Threshold"); if (s == null) { // lookup the deprecated property s = SystemPropertyAction.getProperty("org.apache.cxf.io.CachedWriter.Threshold", "-1"); } i = Integer.parseInt(s); if (i <= 0) { i = 64 * 1024; } } defaultThreshold = i; }
public Bus createBus(String[] cfgFiles, boolean includeDefaults) { try { String userCfgFile = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_NAME); String sysCfgFileUrl = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_URL); final Resource r = BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE); boolean exists = true; if (r != null) { exists = AccessController .doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { return r.exists(); } }); } if (context == null && userCfgFile == null && cfgFiles == null && sysCfgFileUrl == null && (r == null || !exists) && includeDefaults) { return new org.apache.cxf.bus.CXFBusFactory().createBus(); } return finishCreatingBus(createApplicationContext(cfgFiles, includeDefaults)); } catch (BeansException ex) { LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null); throw new RuntimeException(ex); } }
private static long getLong(String prop, long def) { try { String s = SystemPropertyAction.getPropertyOrNull(prop); if (StringUtils.isEmpty(s)) { return def; } long i = Long.parseLong(s); if (i < 0) { i = def; } return i; } catch (Throwable t) { //ignore } return def; }
private static synchronized ClassLoader getXJCClassLoader() { if (jaxbXjcLoader == null) { try { Class.forName("com.sun.tools.internal.xjc.api.XJC"); jaxbXjcLoader = ClassLoader.getSystemClassLoader(); } catch (Exception t2) { //couldn't find either, probably cause tools.jar isn't on //the classpath. Let's see if we can find the tools jar String s = SystemPropertyAction.getProperty("java.home"); if (!StringUtils.isEmpty(s)) { File home = new File(s); File jar = new File(home, "lib/tools.jar"); if (!jar.exists()) { jar = new File(home, "../lib/tools.jar"); } if (jar.exists()) { try { jaxbXjcLoader = new URLClassLoader(new URL[] {jar.toURI().toURL()}); Class.forName("com.sun.tools.internal.xjc.api.XJC", false, jaxbXjcLoader); } catch (Exception e) { jaxbXjcLoader = null; } } } } } return jaxbXjcLoader; }
protected void checkPublishPermission() { SecurityManager sm = System.getSecurityManager(); boolean checkPublishEndpointPermissionWithSecurityManager = Boolean.parseBoolean( SystemPropertyAction.getProperty( CHECK_PUBLISH_ENDPOINT_PERMISSON_PROPERTY_WITH_SECURITY_MANAGER, "true")); if (checkPublishEndpointPermissionWithSecurityManager && sm != null) { sm.checkPermission(PUBLISH_PERMISSION); } else if (Boolean.getBoolean(CHECK_PUBLISH_ENDPOINT_PERMISSON_PROPERTY)) { AccessController.checkPermission(PUBLISH_PERMISSION); } }
public static String getTrustStore(String trustStoreLocation, Logger log) { String logMsg = null; if (trustStoreLocation != null) { logMsg = "TRUST_STORE_SET"; } else { trustStoreLocation = SystemPropertyAction.getProperty("javax.net.ssl.trustStore"); if (trustStoreLocation != null) { logMsg = "TRUST_STORE_SYSTEM_PROPERTY_SET"; } else { trustStoreLocation = SystemPropertyAction.getProperty("java.home") + "/lib/security/cacerts"; logMsg = "TRUST_STORE_NOT_SET"; } } LogUtils.log(log, Level.FINE, logMsg, trustStoreLocation); return trustStoreLocation; }
public String run() { String mode = SystemPropertyAction.getPropertyOrNull(SPRING_VALIDATION_MODE); if (mode == null) { mode = SystemPropertyAction.getPropertyOrNull("spring.validation.mode"); } return mode; } });
public static void setDefaultThreshold(int i) { if (i == -1) { String s = SystemPropertyAction.getProperty(CachedConstants.THRESHOLD_SYS_PROP, "-1"); i = Integer.parseInt(s); if (i <= 0) { i = 128 * 1024; } else { thresholdSysPropSet = true; } } defaultThreshold = i; }
public static String getProperty(String name, String def) { try { return AccessController.doPrivileged(new SystemPropertyAction(name, def)); } catch (SecurityException ex) { LOG.log(Level.FINE, "SecurityException raised getting property " + name, ex); return def; } }
public Bus createBus(String cfgFiles[], boolean includeDefaults) { try { String userCfgFile = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_NAME); String sysCfgFileUrl = SystemPropertyAction.getPropertyOrNull(Configurer.USER_CFG_FILE_PROPERTY_URL); final Resource r = BusApplicationContext.findResource(Configurer.DEFAULT_USER_CFG_FILE); boolean exists = true; if (r != null) { exists = AccessController .doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { return r.exists(); } }); } if (context == null && userCfgFile == null && cfgFiles == null && sysCfgFileUrl == null && (r == null || !exists) && includeDefaults) { return new org.apache.cxf.bus.CXFBusFactory().createBus(); } return finishCreatingBus(createApplicationContext(cfgFiles, includeDefaults)); } catch (BeansException ex) { LogUtils.log(LOG, Level.WARNING, "APP_CONTEXT_CREATION_FAILED_MSG", ex, (Object[])null); throw new RuntimeException(ex); } }
private static long getLong(String prop, long def) { try { String s = SystemPropertyAction.getPropertyOrNull(prop); if (StringUtils.isEmpty(s)) { return def; } long i = Long.parseLong(s); if (i < 0) { i = def; } return i; } catch (Throwable t) { //ignore } return def; }