/** * Set the properties of an object passed as a parameter in one go. The <code>properties</code> * are parsed relative to a <code>prefix</code>. * <p> * @param obj The object to configure. * @param properties A java.util.Properties containing keys and values. * @param prefix Only keys having the specified prefix will be set. */ public static void setProperties( Object obj, Properties properties, String prefix ) { new PropertySetter( obj ).setProperties( properties, prefix ); }
/** * Set the properties of an object passed as a parameter in one go. The <code>properties</code> * are parsed relative to a <code>prefix</code>. * <p> * @param obj The object to configure. * @param properties A java.util.Properties containing keys and values. * @param prefix Only keys having the specified prefix will be set. */ public static void setProperties( Object obj, Properties properties, String prefix ) { new PropertySetter( obj ).setProperties( properties, prefix ); }
/** * Configure. * <p> * jcs.remotehttpcache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE * <p> * @param prop * @return RemoteCacheServerAttributesconfigureRemoteCacheServerAttributes */ protected RemoteHttpCacheServerAttributes configureRemoteHttpCacheServerAttributes( Properties prop ) { RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); // configure automatically PropertySetter.setProperties( rcsa, prop, IRemoteHttpCacheConstants.HTTP_CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + "." ); return rcsa; }
/** * Configure. * <p> * jcs.remotehttpcache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE * <p> * @param prop * @return RemoteCacheServerAttributesconfigureRemoteCacheServerAttributes */ protected static RemoteHttpCacheServerAttributes configureRemoteHttpCacheServerAttributes( Properties prop ) { RemoteHttpCacheServerAttributes rcsa = new RemoteHttpCacheServerAttributes(); // configure automatically PropertySetter.setProperties( rcsa, prop, IRemoteHttpCacheConstants.HTTP_CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + "." ); return rcsa; } }
PropertySetter.setProperties( cacheEventLogger, props, cacheEventLoggerAttributePrefix + "." ); if ( log.isInfoEnabled() )
/** * This configures an object specific custom factory. This will be configured for just this * object in the registry. This can be null. * <p> * @param props * @return RMISocketFactory */ protected static RMISocketFactory configureObjectSpecificCustomFactory( Properties props ) { RMISocketFactory customRMISocketFactory = OptionConverter.instantiateByKey( props, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX, null ); if ( customRMISocketFactory != null ) { PropertySetter.setProperties( customRMISocketFactory, props, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX + "." ); if ( log.isInfoEnabled() ) { log.info( "Will use server specific custom socket factory. " + customRMISocketFactory ); } } else { if ( log.isInfoEnabled() ) { log.info( "No server specific custom socket factory defined." ); } } return customRMISocketFactory; }
/** * This configures an object specific custom factory. This will be configured for just this * object in the registry. This can be null. * <p> * @param props * @return RMISocketFactory */ protected static RMISocketFactory configureObjectSpecificCustomFactory( Properties props ) { RMISocketFactory customRMISocketFactory = OptionConverter.instantiateByKey( props, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX, null ); if ( customRMISocketFactory != null ) { PropertySetter.setProperties( customRMISocketFactory, props, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX + "." ); if ( log.isInfoEnabled() ) { log.info( "Will use server specific custom socket factory. " + customRMISocketFactory ); } } else { if ( log.isInfoEnabled() ) { log.info( "No server specific custom socket factory defined." ); } } return customRMISocketFactory; }
PropertySetter.setProperties( cacheEventLogger, props, cacheEventLoggerAttributePrefix + "." ); if ( log.isInfoEnabled() )
/** * Configures the attributes using the properties. * <p> * @param poolName the name of the pool * @param props the configuration properties for the pool * @return JDBCDiskCachePoolAccessAttributes */ protected JDBCDiskCachePoolAccessAttributes configurePoolAccessAttributes( String poolName, Properties props ) { JDBCDiskCachePoolAccessAttributes poolAttributes = new JDBCDiskCachePoolAccessAttributes(); String poolAccessAttributePrefix = POOL_CONFIGURATION_PREFIX + poolName + ATTRIBUTE_PREFIX; PropertySetter.setProperties( poolAttributes, props, poolAccessAttributePrefix + "." ); poolAttributes.setPoolName( poolName ); if ( log.isInfoEnabled() ) { log.info( "Configured attributes " + poolAttributes ); } return poolAttributes; }
PropertySetter.setProperties( eAttr, props, attrName + "." );
PropertySetter.setProperties( keyMatcher, props, attributePrefix + "." ); if ( log.isInfoEnabled() )
PropertySetter.setProperties( elementSerializer, props, attributePrefix + "." ); if ( log.isInfoEnabled() )
/** * Configure. * <p> * jcs.remotecache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE * <p> * @param prop * @return RemoteCacheServerAttributesconfigureRemoteCacheServerAttributes */ protected static RemoteCacheServerAttributes configureRemoteCacheServerAttributes( Properties prop ) { RemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); // configure automatically PropertySetter.setProperties( rcsa, prop, CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + "." ); configureManuallyIfValuesArePresent( prop, rcsa ); return rcsa; }
PropertySetter.setProperties( keyMatcher, props, attributePrefix + "." ); if ( log.isInfoEnabled() )
/** * Configure. * <p> * jcs.remotecache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE * <p> * @param prop * @return RemoteCacheServerAttributesconfigureRemoteCacheServerAttributes */ protected static RemoteCacheServerAttributes configureRemoteCacheServerAttributes( Properties prop ) { RemoteCacheServerAttributes rcsa = new RemoteCacheServerAttributes(); // configure automatically PropertySetter.setProperties( rcsa, prop, CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX + "." ); configureManuallyIfValuesArePresent( prop, rcsa ); return rcsa; }
PropertySetter.setProperties( elementSerializer, props, attributePrefix + "." ); if ( log.isInfoEnabled() )
PropertySetter.setProperties( eAttr, props, attrName + "." );
PropertySetter.setProperties( ccAttr, props, attrName + "." ); ccAttr.setCacheName( regName );
PropertySetter.setProperties( ccAttr, props, attrName + "." ); ccAttr.setCacheName( regName );
PropertySetter.setProperties( dsConfig, configProps, dsConfigAttributePrefix + "." );