public ProxySettings setFinderURL(SpaceURL finderURL) { _finderURL = finderURL; if (finderURL != null && finderURL.getCustomProperties() != null) _customProperties.putAll(finderURL.getCustomProperties()); return this; }
public static Object find(SpaceURL[] spaceURLs, CredentialsProvider credentialsProvider) throws FinderException { if (spaceURLs == null || spaceURLs.length == 0) throw new IllegalArgumentException("At least one urls must be passed to space finder"); return spaceFinder.findService(spaceURLs, spaceURLs[0].getCustomProperties(), null, credentialsProvider); }
public void loadSpaceTypes(SpaceURL url) throws DetailedUnusableEntryException { //load space predefined types if (url != null) { SpaceInstanceConfig spaceInstanceConfig = (SpaceInstanceConfig) url.getCustomProperties().get(Constants.Space.SPACE_CONFIG); SpaceTypeDescriptor[] typeDescriptors = spaceInstanceConfig != null ? spaceInstanceConfig.getTypeDescriptors() : null; if (typeDescriptors != null) for (SpaceTypeDescriptor typeDesc : typeDescriptors) addTypeDesc((ITypeDesc) typeDesc); } }
private void updateHostName(String value) { getCustomProperties().setProperty(XPathProperties.CONTAINER_JNDI_URL, value); String url = getProperty(URL_NAME); int lastSearchIndex = url.indexOf('?'); if (lastSearchIndex == -1) lastSearchIndex = url.length() - 1; //use here length of "java:" as fromIndex in order to reach //host url delimeter if exists int hostURLDelimeterIndex = url.lastIndexOf(":"); //if hist url delimeter exists ":" if (hostURLDelimeterIndex > 0 && hostURLDelimeterIndex < lastSearchIndex) { int lastHostURLIndex = url.indexOf("/", hostURLDelimeterIndex); int firstHostURLIndex = url.substring(0, lastHostURLIndex - 1).lastIndexOf("/"); if (firstHostURLIndex > 0 && lastHostURLIndex > firstHostURLIndex) { String oldValue = url.substring(firstHostURLIndex + 1, lastHostURLIndex); url = url.replaceFirst(oldValue, value); super.setProperty(URL_NAME, url); } } }
/** * @param spaceURL space URL to extract the 'secured' property from * @return <code>true</code> if 'secured=true' property exists in the space URL or as a custom * property; <code>false</code> otherwise. */ private static boolean hasSecuredProperty(SpaceURL spaceURL) { return PropertiesUtils.getBoolean(spaceURL, SpaceURL.SECURED, false) || PropertiesUtils.getBoolean(spaceURL.getCustomProperties(), SpaceURL.SECURED, false); } }
public RemoteOperationsExecutorProxy locateMember(String memberName, String spaceUuid, LookupType lookupType) { SpaceURL memberURL = getMemberUrl(memberName); if (_logger.isLoggable(Level.FINEST)) _logger.log(Level.FINEST, "Looking for server " + memberName + " at [" + memberURL + "]..."); try { IRemoteSpace proxy = SpaceFinder.findJiniSpace(memberURL, spaceUuid, memberURL.getCustomProperties(), LOOKUP_TIMEOUT, lookupType); if (_logger.isLoggable(Level.FINE)) _logger.log(Level.FINE, "Server " + memberName + " was found at [" + memberURL + "]."); return new RemoteOperationsExecutorProxy(memberName, proxy, _quiesceTokenProvider); } catch (FinderException e) { if (_logger.isLoggable(Level.FINEST)) _logger.log(Level.FINEST, "Could not find server " + memberName + " at " + memberURL + ".", e); else if (_logger.isLoggable(Level.FINER)) _logger.log(Level.FINER, "Could not find server " + memberName + " at " + memberURL + "."); return null; } }
public ReplicationFilterManager(ReplicationPolicy replPolicy, SpaceURL spaceURL, IJSpace spaceProxy) { _replicationPolicy = replPolicy; _replicationDescription = replPolicy.m_ReplMemberPolicyDescTable.get(replPolicy.m_OwnMemberName); _space = spaceProxy; //check if filters are built from ReplicationFiltertProvider or from cluster schema if (spaceURL != null) { ReplicationFilterProvider replicationFilterProvider = (ReplicationFilterProvider) spaceURL.getCustomProperties() .get(Constants.ReplicationFilter.REPLICATION_FILTER_PROVIDER); if (replicationFilterProvider != null) buildFilters(replicationFilterProvider); else buildFilters(_replicationDescription); } else { buildFilters(_replicationDescription); } }
protected Object findService(String url, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) throws FinderException { if (url == null) throw new FinderException(new SpaceURLValidationException("Invalid space url - SpaceURL value must be supplied to this method.")); StringTokenizer st = new StringTokenizer(url, ";"); String[] urls = new String[st.countTokens()]; for (int i = 0; st.hasMoreTokens(); i++) urls[i] = st.nextToken(); SpaceURL[] spaceURLs = prepareUrl(urls, customProperties); Properties customProps = spaceURLs[spaceURLs.length - 1].getCustomProperties(); return findService(spaceURLs, customProps, lifeCycle, credentialsProvider); }
private static SpaceConfigReader getDCacheConfigReader(IJSpace space) throws FinderException { try { return JProperties.loadDCacheConfig((ISpaceProxy) space, space.getFinderURL().getCustomProperties(), Constants.DCache.SPACE_SUFFIX); } catch (SpaceInitializationException e) { throw new FinderException("Failed to initialize map configuration", e); } } }
public static Object find(SpaceURL spaceURL, CredentialsProvider credentialsProvider, long timeout, LookupType lookupType) throws FinderException { if (spaceURL == null) throw new FinderException(new SpaceURLValidationException("Invalid space url - SpaceURL value must be supplied to this method.")); return spaceFinder.findService(spaceURL, spaceURL.getCustomProperties(), null /*lifeCycle*/, credentialsProvider, timeout, lookupType); }
String jndiFlag = _url.getCustomProperties().getProperty(XPathProperties.CONTAINER_JNDI_ENABLED); if (!JSpaceUtilities.isEmpty(jndiFlag) && jndiFlag.equalsIgnoreCase("false")) { if (_rmiHostAndPort == null)
Properties customProperties = spaceURL.getCustomProperties(); if (!JSpaceUtilities.isEmpty(propertiesName)) { Properties customPropertiesFile = ResourceLoader.findCustomPropertiesObj(propertiesName);
Properties customProperties = spaceURL.getCustomProperties();
/** * <pre> * The general format for this URL is as follows: * Protocol://[host]:[port]/[container_name]/[space_name]?[query_string] * Protocol: [ RMI | JINI | JAVA ] * This method also supports multiple URLs separate by ";", * e.i. jini://localhost/containerName/SpaceName;jini://'*'/containerName/SpaceName; * It is useful when Jini URL for locating services on the network is not available. * If the first space URL is unavailable, SpaceFinder will try the next one until a live proxy * will be found. * If all URLs are unavailable this method throws FinderException * </pre> * * @param credentialsProvider credentials to be used for authentication against a remote secured * space; may be <code>null</code>. * @return Returns single Space or Container proxy. * @throws FinderException During finding space or container. */ public static Object find(SpaceURL spaceURL, CredentialsProvider credentialsProvider) throws FinderException { if (spaceURL == null) throw new FinderException(new SpaceURLValidationException("Invalid space url - SpaceURL value must be supplied to this method.")); long timeout = Long.parseLong(spaceURL.getProperty(SpaceURL.TIMEOUT, "-1")); return spaceFinder.findService(spaceURL, spaceURL.getCustomProperties(), null /*lifeCycle*/, credentialsProvider, timeout, null /* lookupType */); }
protected Object findService(SpaceURL[] spaceURLs, Properties customProperties, LifeCycle lifeCycle, CredentialsProvider credentialsProvider) throws FinderException { if (spaceURLs == null || spaceURLs.length == 0) throw new FinderException(new SpaceURLValidationException("Invalid space url - SpaceURL value must be supplied to this method.")); Properties actualCustomProperties; for (int i = 0; i < spaceURLs.length; i++) { try { actualCustomProperties = customProperties != null ? customProperties : spaceURLs[i].getCustomProperties(); long timeout = Long.parseLong(spaceURLs[i].getProperty(SpaceURL.TIMEOUT, "-1")); return findService(spaceURLs[i], actualCustomProperties, lifeCycle, credentialsProvider, timeout, null /* lookupType */); } catch (FinderException ex) { if (i == spaceURLs.length - 1) throw ex; } } // Should not happen - Satisfy the compiler throw new FinderException("find finished without returning result."); }
Properties custProps = null; if (_spaceURL != null) { custProps = _spaceURL.getCustomProperties();
FilterProvider[] urlFilterProviders = (FilterProvider[]) _space.getURL().getCustomProperties().get(FILTER_PROVIDERS); if (urlFilterProviders != null) for (FilterProvider filterProvider : urlFilterProviders)
public ProxySettings(IRemoteSpace remoteSpace, SpaceSettings spaceSettings) { this._remoteSpace = remoteSpace; this._spaceSettings = spaceSettings; this._memberName = _spaceSettings.getMemberName(); this._uuidHashCode = _spaceSettings.getUuid().hashCode(); this._clusterInfo = spaceSettings.getSpaceConfig().getClusterInfo(); this._nonClusterInfo = _clusterInfo.isClustered() ? new SpaceClusterInfo(null, _memberName) : _clusterInfo; this._isCollocated = RemoteStub.isCollocatedStub(_remoteSpace); if (_remoteSpace instanceof LRMISpaceImpl) { LRMISpaceImpl lrmiSpaceImpl = (LRMISpaceImpl) _remoteSpace; _spaceImpl = lrmiSpaceImpl.isEmbedded() ? (SpaceImpl) lrmiSpaceImpl.getProxy() : null; } else _spaceImpl = null; _customProperties = new Properties(); Properties serverProperties = getSpaceURL().getCustomProperties(); if (serverProperties != null) _customProperties.putAll(serverProperties); }
JSpaceUtilities.overrideClusterConfigWithXPath(_spaceURL.getCustomProperties(), m_rootDoc); } catch (Exception e) { if (_logger.isLoggable(Level.SEVERE)) {
Properties customProperties = spaceURL.getCustomProperties(); String customPropsGroups = customProperties.getProperty(XPathProperties.CONTAINER_JINI_LUS_GROUPS);