ro.isdc.wro.config.jmx
Class WroConfiguration

java.lang.Object
  extended by ro.isdc.wro.config.jmx.WroConfiguration
All Implemented Interfaces:
WroConfigurationMBean

public final class WroConfiguration
extends Object
implements WroConfigurationMBean

Defines MBean which manage configuration. There should be only one instance of this object in the application and it should be accessible even outside of the request cycle.

Author:
Alex Objelean

Field Summary
static int DEFAULT_CONNECTION_TIMEOUT
          Default value for connectionTimeout property.
static String DEFAULT_ENCODING
          Default encoding to use.
 
Constructor Summary
WroConfiguration()
           
 
Method Summary
 void destroy()
          Perform the cleanup, clear the listeners.
 boolean equals(Object obj)
          
 long getCacheUpdatePeriod()
          
 int getConnectionTimeout()
           
 String getEncoding()
           
 String getHeader()
           
 String getMbeanName()
           
 long getModelUpdatePeriod()
          
static String getObjectName()
           
 long getResourceWatcherUpdatePeriod()
           
 String getWroManagerClassName()
           
 boolean isCacheGzippedContent()
           
 boolean isDebug()
           
 boolean isDisableCache()
           
 boolean isGzipEnabled()
          
 boolean isIgnoreEmptyGroup()
           
 boolean isIgnoreFailingProcessor()
           
 boolean isIgnoreMissingResources()
           
 boolean isJmxEnabled()
           
 boolean isParallelPreprocessing()
           
 void registerCacheUpdatePeriodChangeListener(PropertyChangeListener listener)
          Register a listener which is notified when the modelUpdate period value is changed.
 void registerModelUpdatePeriodChangeListener(PropertyChangeListener listener)
          Register a listener which is notified when the modelUpdate period value is changed.
 void reloadCache()
          Force reload of the cache.
 void reloadModel()
          Force reload of the model.
 void setCacheGzippedContent(boolean cacheGzippedContent)
          Whether gzipped content should be cached or not.
 void setCacheUpdatePeriod(long period)
          Set after how many seconds the cache containing merged resources by group name should be updated.
 void setConnectionTimeout(int connectionTimeout)
          Timeout (milliseconds) of the url connection for external resources.
 void setDebug(boolean debug)
          Set the debug mode.
 void setDisableCache(boolean disableCache)
           
 void setEncoding(String encoding)
          Encoding to use when writing the processed result into the output stream.
 void setGzipEnabled(boolean enable)
          
 void setHeader(String header)
           
 void setIgnoreEmptyGroup(boolean ignoreEmptyGroup)
           
 void setIgnoreFailingProcessor(boolean ignoreFailingProcessor)
           
 void setIgnoreMissingResources(boolean ignoreMissingResources)
           
 void setJmxEnabled(boolean jmxEnabled)
           
 void setMbeanName(String mbeanName)
           
 void setModelUpdatePeriod(long period)
          Set after how many seconds the wro model should be updated.
 void setParallelPreprocessing(boolean parallelPreprocessing)
           
 void setResourceWatcherUpdatePeriod(long resourceWatcherUpdatePeriod)
          Set after how many seconds the resource change detection is performed..
 void setWroManagerClassName(String wroManagerClassName)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
Default encoding to use.

See Also:
Constant Field Values

DEFAULT_CONNECTION_TIMEOUT

public static int DEFAULT_CONNECTION_TIMEOUT
Default value for connectionTimeout property.

Constructor Detail

WroConfiguration

public WroConfiguration()
Method Detail

getObjectName

public static String getObjectName()
Returns:
the name of the object used to register the MBean.

getCacheUpdatePeriod

public long getCacheUpdatePeriod()

Specified by:
getCacheUpdatePeriod in interface WroConfigurationMBean
Returns:
period in seconds when the cache containing merged resources by group should be updated.

getModelUpdatePeriod

public long getModelUpdatePeriod()

Specified by:
getModelUpdatePeriod in interface WroConfigurationMBean
Returns:
period in seconds when the wro model (by default read from wro.xml) is updated.

setCacheUpdatePeriod

public void setCacheUpdatePeriod(long period)
Set after how many seconds the cache containing merged resources by group name should be updated.

Specified by:
setCacheUpdatePeriod in interface WroConfigurationMBean
Parameters:
period - number of seconds. Zero or less, means never.

setModelUpdatePeriod

public void setModelUpdatePeriod(long period)
Set after how many seconds the wro model should be updated.

Specified by:
setModelUpdatePeriod in interface WroConfigurationMBean
Parameters:
period - number of seconds. Zero or less, means never.

isGzipEnabled

public boolean isGzipEnabled()

Specified by:
isGzipEnabled in interface WroConfigurationMBean
Returns:
true if Gzip is Enabled.

setGzipEnabled

public void setGzipEnabled(boolean enable)

Specified by:
setGzipEnabled in interface WroConfigurationMBean
Parameters:
enable - if true, gzip will be enabled, otherwise will be disabled.

reloadCache

public void reloadCache()
Force reload of the cache.

Specified by:
reloadCache in interface WroConfigurationMBean

reloadModel

public void reloadModel()
Force reload of the model.

Specified by:
reloadModel in interface WroConfigurationMBean

registerModelUpdatePeriodChangeListener

public void registerModelUpdatePeriodChangeListener(PropertyChangeListener listener)
Register a listener which is notified when the modelUpdate period value is changed. Registration is allowed only during

Parameters:
listener - to add.

registerCacheUpdatePeriodChangeListener

public void registerCacheUpdatePeriodChangeListener(PropertyChangeListener listener)
Register a listener which is notified when the modelUpdate period value is changed.

Parameters:
listener - to add.

isDebug

public boolean isDebug()
Specified by:
isDebug in interface WroConfigurationMBean
Returns:
the debug

setDebug

public void setDebug(boolean debug)
Description copied from interface: WroConfigurationMBean
Set the debug mode.

Specified by:
setDebug in interface WroConfigurationMBean
Parameters:
debug - the debug to set

isIgnoreMissingResources

public boolean isIgnoreMissingResources()
Specified by:
isIgnoreMissingResources in interface WroConfigurationMBean
Returns:
the ignoreMissingResources

setIgnoreMissingResources

public void setIgnoreMissingResources(boolean ignoreMissingResources)
Specified by:
setIgnoreMissingResources in interface WroConfigurationMBean
Parameters:
ignoreMissingResources - the ignoreMissingResources to set

isDisableCache

public boolean isDisableCache()
Returns:
the disableCache

setDisableCache

public void setDisableCache(boolean disableCache)
Parameters:
disableCache - the disableCache to set

isJmxEnabled

public boolean isJmxEnabled()
Returns:
the jmxEnabled

setJmxEnabled

public void setJmxEnabled(boolean jmxEnabled)
Parameters:
jmxEnabled - the jmxEnabled to set

isCacheGzippedContent

public boolean isCacheGzippedContent()
Specified by:
isCacheGzippedContent in interface WroConfigurationMBean
Returns:
the cacheGzippedContent

setCacheGzippedContent

public void setCacheGzippedContent(boolean cacheGzippedContent)
Description copied from interface: WroConfigurationMBean
Whether gzipped content should be cached or not. In order to take effect, after changing this value, reload the cache.

Specified by:
setCacheGzippedContent in interface WroConfigurationMBean
Parameters:
cacheGzippedContent - the cacheGzippedContent to set

destroy

public void destroy()
Perform the cleanup, clear the listeners.


getEncoding

public String getEncoding()
Specified by:
getEncoding in interface WroConfigurationMBean
Returns:
the encoding

setEncoding

public void setEncoding(String encoding)
Description copied from interface: WroConfigurationMBean
Encoding to use when writing the processed result into the output stream.

Specified by:
setEncoding in interface WroConfigurationMBean
Parameters:
encoding - the encoding to set

getWroManagerClassName

public String getWroManagerClassName()
Returns:
the wroManagerClassName

setWroManagerClassName

public void setWroManagerClassName(String wroManagerClassName)
Parameters:
wroManagerClassName - the wroManagerClassName to set

getMbeanName

public String getMbeanName()
Returns:
the mbeanName

setMbeanName

public void setMbeanName(String mbeanName)
Parameters:
mbeanName - the mbeanName to set

getHeader

public String getHeader()
Returns:
the header

setHeader

public void setHeader(String header)
Parameters:
header - the header to set

getConnectionTimeout

public int getConnectionTimeout()
Specified by:
getConnectionTimeout in interface WroConfigurationMBean
Returns:
the number of milliseconds before a connection is timed out.

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)
Timeout (milliseconds) of the url connection for external resources. This is used to ensure that locator doesn't spend too much time on slow end-point.

Specified by:
setConnectionTimeout in interface WroConfigurationMBean
Parameters:
connectionTimeout - the connectionTimeout to set

isParallelPreprocessing

public boolean isParallelPreprocessing()
Returns:
the parallelPreprocessing

setParallelPreprocessing

public void setParallelPreprocessing(boolean parallelPreprocessing)
Parameters:
parallelPreprocessing - the parallelPreprocessing to set

isIgnoreEmptyGroup

public boolean isIgnoreEmptyGroup()
Specified by:
isIgnoreEmptyGroup in interface WroConfigurationMBean
Returns:
value of the flag responsible for handling empty group behavior.

setIgnoreEmptyGroup

public void setIgnoreEmptyGroup(boolean ignoreEmptyGroup)
Specified by:
setIgnoreEmptyGroup in interface WroConfigurationMBean
Parameters:
ignoreEmptyGroup - flag for turning on/off failure when there is an empty group (nothing to process). This value is true by default, meaning that empty group will produce empty result (no exception).

isIgnoreFailingProcessor

public boolean isIgnoreFailingProcessor()
Returns:
true if the processing failure should be ignored.

setIgnoreFailingProcessor

public void setIgnoreFailingProcessor(boolean ignoreFailingProcessor)

getResourceWatcherUpdatePeriod

public final long getResourceWatcherUpdatePeriod()
Specified by:
getResourceWatcherUpdatePeriod in interface WroConfigurationMBean
Returns:
period in seconds indicating how often resource changes are checked.

setResourceWatcherUpdatePeriod

public final void setResourceWatcherUpdatePeriod(long resourceWatcherUpdatePeriod)
Description copied from interface: WroConfigurationMBean
Set after how many seconds the resource change detection is performed..

Specified by:
setResourceWatcherUpdatePeriod in interface WroConfigurationMBean
Parameters:
resourceWatcherUpdatePeriod - number of seconds. Zero or less, means never.

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2008-2013. All Rights Reserved.