站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

ThemeServiceImpl - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.theme.impl
Class ThemeServiceImpl

java.lang.Object
  extended byorg.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended byorg.jboss.system.ServiceMBeanSupport
          extended byorg.jboss.portal.jems.as.system.AbstractJBossService
              extended byorg.jboss.portal.theme.impl.ThemeServiceImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, ThemeService, ThemeServiceInfo

public class ThemeServiceImpl
extends AbstractJBossService
implements ThemeService, org.jboss.system.Service

TODO: A description of this class.

Version:
$Revision: 5448 $
Author:
Martin Holzner.

Field Summary
private  ServerRegistrationID defaultID
           
private  java.util.Map exactThemeNames
           
private static org.apache.log4j.Logger log
           
private  java.util.Map themeNames
           
private  java.util.Map themes
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
ThemeServiceImpl()
           
 
Method Summary
 void addTheme(RuntimeContext runtimeContext, PortalThemeMetaData metaData)
          Add a theme.
protected  void createService()
           
protected  void destroyService()
           
 PortalTheme getTheme(ServerRegistrationID themeId, boolean defaultOnNull)
          Get a reference to a theme.
 PortalTheme getTheme(java.lang.String name, boolean defaultOnNull)
          Get a reference to a theme.
 java.util.Collection getThemeNames()
          Get a Collection of all the registered theme's names
 java.util.Collection getThemes()
          Get a Collection of all registered themes.
 void removeTheme(PortalTheme theme)
          Remove the theme from the available themes.
 void removeThemes(java.lang.String appId)
          Remove all themes that are registered with the provided application.
 void setDefault(ServerRegistrationID themeId)
          Set the default theme on a global scope.
 void setDefaultFromName(java.lang.String name)
          Set the default theme.
protected  void startService()
           
protected  void stopService()
           
 
Methods inherited from class org.jboss.portal.jems.as.system.AbstractJBossService
create, destroy, getState, getStateString, start, stop
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

log

private static org.apache.log4j.Logger log

themes

private java.util.Map themes

themeNames

private java.util.Map themeNames

exactThemeNames

private java.util.Map exactThemeNames

defaultID

private ServerRegistrationID defaultID
Constructor Detail

ThemeServiceImpl

public ThemeServiceImpl()
Method Detail

createService

protected void createService()
                      throws java.lang.Exception
Throws:
java.lang.Exception

destroyService

protected void destroyService()

startService

protected void startService()
                     throws java.lang.Exception
Throws:
java.lang.Exception

stopService

protected void stopService()

addTheme

public void addTheme(RuntimeContext runtimeContext,
                     PortalThemeMetaData metaData)
              throws ThemeException
Description copied from interface: ThemeService
Add a theme.

Specified by:
addTheme in interface ThemeService
Parameters:
metaData - the meta data about the theme
Throws:
ThemeException

removeTheme

public void removeTheme(PortalTheme theme)
Description copied from interface: ThemeService
Remove the theme from the available themes.

Specified by:
removeTheme in interface ThemeService
Parameters:
theme - the theme to be removed
See Also:
ThemeService.removeTheme(org.jboss.portal.theme.PortalTheme)

removeThemes

public void removeThemes(java.lang.String appId)
Description copied from interface: ThemeService
Remove all themes that are registered with the provided application.

On deployment of a new application, the theme descriptor (if any present) in that application is parsed for themes that are to be registered with the theme server. For each entry in the descriptor, a new theme is registered with the theme server. Uppon undeployment of that same application, all themes must be deregistered. This method is a convenient way to achieve this.

Specified by:
removeThemes in interface ThemeService
Parameters:
appId - the name of the application that hosts the themes to unregister
See Also:
ThemeService.removeThemes(String)

setDefault

public void setDefault(ServerRegistrationID themeId)
                throws ThemeException
Description copied from interface: ThemeService
Set the default theme on a global scope.

Specified by:
setDefault in interface ThemeService
Parameters:
themeId - the registration id of the theme to be the new default theme
Throws:
ThemeException - if the theme with this id is not available in the list of currently registered themes
See Also:
ThemeService.setDefault(org.jboss.portal.theme.ServerRegistrationID)

setDefaultFromName

public void setDefaultFromName(java.lang.String name)
                        throws ThemeException
Set the default theme.

Parameters:
name - the name of the theme that is to be set as default
Throws:
ThemeException - if the theme is not part of the available themes

getTheme

public PortalTheme getTheme(ServerRegistrationID themeId,
                            boolean defaultOnNull)
Description copied from interface: ThemeServiceInfo
Get a reference to a theme.

Specified by:
getTheme in interface ThemeServiceInfo
Parameters:
themeId - the registration id of the theme to retrieve
defaultOnNull - true, when the server should return the default theme, in case the requested is not found
Returns:
the requested theme, null, or the default theme if defaultOnNull was provided as true
See Also:
ThemeServiceInfo.getTheme(org.jboss.portal.theme.ServerRegistrationID,boolean)

getTheme

public PortalTheme getTheme(java.lang.String name,
                            boolean defaultOnNull)
Description copied from interface: ThemeServiceInfo
Get a reference to a theme.

Specified by:
getTheme in interface ThemeServiceInfo
Parameters:
name - the name of the theme to retrieve
defaultOnNull - true, when the server should return the default theme, in case the requested is not found
Returns:
the requested theme, null, or the default theme if defaultOnNull was provided as true
See Also:
ThemeServiceInfo.getTheme(String,boolean)

getThemes

public java.util.Collection getThemes()
Description copied from interface: ThemeServiceInfo
Get a Collection of all registered themes.

Specified by:
getThemes in interface ThemeServiceInfo
Returns:
a Collection of all registered themes
See Also:
ThemeServiceInfo.getThemes()

getThemeNames

public java.util.Collection getThemeNames()
Description copied from interface: ThemeServiceInfo
Get a Collection of all the registered theme's names

Specified by:
getThemeNames in interface ThemeServiceInfo
Returns:
a collection of theme names
See Also:
ThemeServiceInfo.getThemeNames()