org.jboss.portal.server.plugins.preferences
Class PreferenceSetPlugin

java.lang.Object
  extended by org.jboss.portal.common.plugin.AbstractPlugin
      extended by org.jboss.portal.server.plugins.PluginService
          extended by org.jboss.portal.server.plugins.preferences.PreferenceSetPlugin
All Implemented Interfaces:
MetaDataHolder, Plugin, Registration, Service, PreferenceSet
Direct Known Subclasses:
PortletPreferenceSetPlugin

public class PreferenceSetPlugin
extends PluginService
implements PreferenceSet


Field Summary
protected  PluginContainer container
           
protected  org.apache.log4j.Logger log
           
protected  PreferencesMetaData metaData
           
protected  java.util.Map preferences
           
 
Fields inherited from class org.jboss.portal.server.plugins.PluginService
ctx
 
Constructor Summary
PreferenceSetPlugin()
           
 
Method Summary
 MetaData getMetaData()
           
 PluginContainer getPluginContainer()
           
 Preference getPreference(java.lang.String key)
          Return the preference for the given key.
 Value getValue(java.lang.String key)
          Return the value for the given key or null if it does not exist.
 boolean isReadOnly(java.lang.String key)
          Return the read only value for the given preference.
 java.util.Set keySet()
          Return the key set of all the preferences.
 void setMetaData(MetaData metaData)
           
 void setPluginContainer(PluginContainer container)
           
 void setReadOnly(java.lang.String key, boolean readOnly)
          Update the read only value for the given key.
 void setValue(java.lang.String key, Value value)
          Update the value of the given key.
 void start()
          Start.
 
Methods inherited from class org.jboss.portal.server.plugins.PluginService
addDependsOnMe, addIDependOn, create, destroy, registered, removeDependsOnMe, removeIDependOn, stop, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.log4j.Logger log

metaData

protected PreferencesMetaData metaData

preferences

protected java.util.Map preferences

container

protected PluginContainer container
Constructor Detail

PreferenceSetPlugin

public PreferenceSetPlugin()
Method Detail

setPluginContainer

public void setPluginContainer(PluginContainer container)
Specified by:
setPluginContainer in interface Plugin
Overrides:
setPluginContainer in class AbstractPlugin

getPluginContainer

public PluginContainer getPluginContainer()
Specified by:
getPluginContainer in interface Plugin
Overrides:
getPluginContainer in class AbstractPlugin

getPreference

public Preference getPreference(java.lang.String key)
Description copied from interface: PreferenceSet
Return the preference for the given key. If no preference exists it must return null.

Specified by:
getPreference in interface PreferenceSet
Parameters:
key - the requested key
Returns:
the requested preference or null if it does not exist

keySet

public java.util.Set keySet()
Description copied from interface: PreferenceSet
Return the key set of all the preferences.

Specified by:
keySet in interface PreferenceSet

getValue

public Value getValue(java.lang.String key)
Description copied from interface: PreferenceSet
Return the value for the given key or null if it does not exist.

Specified by:
getValue in interface PreferenceSet
Parameters:
key - the requested key
Returns:
the requested value or null if it does not exist

setValue

public void setValue(java.lang.String key,
                     Value value)
Description copied from interface: PreferenceSet
Update the value of the given key. If the value object is null it means that the preference must be removed. Implementation can throw an unsupported operation exception when it is abnormal to perform an update.

Specified by:
setValue in interface PreferenceSet
Parameters:
key - the key to update
value - the new value

isReadOnly

public boolean isReadOnly(java.lang.String key)
Description copied from interface: PreferenceSet
Return the read only value for the given preference.

Specified by:
isReadOnly in interface PreferenceSet
Parameters:
key - the requested key
Returns:
the read only value

setReadOnly

public void setReadOnly(java.lang.String key,
                        boolean readOnly)
Description copied from interface: PreferenceSet
Update the read only value for the given key. Implementation can throw an unsupported operation exception when it is abnormal to perform an update.

Specified by:
setReadOnly in interface PreferenceSet
Parameters:
key - the key to update
readOnly - the new read only value

start

public void start()
           throws java.lang.Exception
Description copied from interface: Service
Start.

Specified by:
start in interface Service
Overrides:
start in class PluginService
Throws:
java.lang.Exception

setMetaData

public void setMetaData(MetaData metaData)
Specified by:
setMetaData in interface MetaDataHolder

getMetaData

public MetaData getMetaData()
Specified by:
getMetaData in interface MetaDataHolder