/** * Construct a new instance. A new, empty environment map is created for this context. */ protected AbstractContext() { this(new FastHashtable<>()); }
RemoteContext(final RemoteNamingProvider provider, final String scheme, final Hashtable<String, Object> env) throws CommunicationException { super(FastHashtable.of(env)); this.provider = provider; this.scheme = scheme; }
/** * Get the security credential, if any. If an entry is present but not recognized, an empty credential set is * returned. * * @param env the environment (must not be {@code null}) * @return the security credentials, or {@code null} if none was present */ public static IdentityCredentials getSecurityCredentials(Map<String, ?> env) { return getSecurityCredentials(env, Context.SECURITY_CREDENTIALS); }
private Endpoint getEndpoint(final FastHashtable<String, Object> env) { return env.containsKey(ENDPOINT) ? (Endpoint) env.get(ENDPOINT) : Endpoint.getCurrent(); } }
public static String formatPossibleIpv6Address(String address) { if(address == null) { return null; } String ipv6Address; if (address.startsWith("[") && address.endsWith("]")) { ipv6Address = address.substring(0, address.lastIndexOf(']')).substring(1); } else { ipv6Address = address; } // Definitely not an IPv6, return untouched input. if (!mayBeIPv6Address(ipv6Address)) { return ipv6Address; } return '[' + canonize(ipv6Address) + ']'; }
private static boolean checkForLinux() { return checkForPresence("os.name", "linux"); }
public Object addToEnvironment(final String propName, final Object propVal) { return environment.put(propName, propVal); }
public Object removeFromEnvironment(final String propName) { return environment.remove(propName); }
/** * Get the URL package prefixes defined in the given property name. If no URL package prefixes are defined in the * given property name, then the default list is returned. The returned list is mutable. * * @param env the environment (must not be {@code null}) * @return the list of package prefixes */ public static List<String> getURLPackagePrefixes(Map<String, ?> env) { return getURLPackagePrefixes(env, Context.URL_PKG_PREFIXES); }
public static <K, V> FastHashtable<K, V> of(final Hashtable<K, V> other) { if (other instanceof FastHashtable) { return (FastHashtable<K, V>) other; } else { return new FastHashtable<>(other); } } }
private static boolean checkForSolaris() { return checkForPresence("os.name", "sun"); }
public Object addToEnvironment(final String propName, final Object propVal) { return environment.put(propName, propVal); }
public Object removeFromEnvironment(final String propName) { return environment.remove(propName); }
/** * Construct a new instance. * * @throws NamingException if constructing the initial context fails */ public WildFlyInitialContext() throws NamingException { this(new FastHashtable<>()); }
private static boolean checkForWindows() { return checkForPresence("os.name", "win"); }
public FastHashtable<K, V> clone() { return new FastHashtable<>(this); }
private static boolean checkForHp() { return checkForPresence("os.name", "hp"); }
/** * Get a new initial context. * * @param environment the context environment * @return the initial context * @throws NamingException if constructing the initial context fails */ @SuppressWarnings({"rawtypes", "unchecked"}) public Context getInitialContext(final Hashtable<?, ?> environment) throws NamingException { return new WildFlyRootContext(new FastHashtable<>((Map<String, Object>) (Map) environment)); } }
public static boolean checkForMac() { return checkForPresence("os.name", "mac"); }
/** * Construct a new instance. * * @param environment the initial environment * @throws NamingException if constructing the initial context fails */ @SuppressWarnings("unchecked") public WildFlyInitialContext(final Hashtable<?, ?> environment) throws NamingException { rootContext = new WildFlyRootContext(new FastHashtable<>((Hashtable<String, Object>) environment)); }