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

WSRPConsumerImpl - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.wsrp.consumer
Class WSRPConsumerImpl

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.wsrp.consumer.WSRPConsumerImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, PortletInvoker, org.jboss.system.Service, org.jboss.system.ServiceMBean, WSRPConsumer

public class WSRPConsumerImpl
extends AbstractJBossService
implements WSRPConsumer

Since:
2.4
Version:
$Revision: 5440 $
Author:
Boleslaw Dawidowicz, Chris Laprun

Field Summary
private  ActionHandler actionHandler
           
private  java.util.Map cachedPortletMap
          The cached portlets.
private  java.lang.Integer expirationCacheSeconds
          The cache expiration duration (in seconds) for cached values
private  long expirationTimeMillis
          .
private static java.lang.String MARKUP
           
private static java.lang.String PORTLET_MANAGEMENT
           
private  java.util.Map portletGroups
          Portlet groups.
private  java.lang.String producerId
          The identifier of the associated producer
private static java.lang.String REGISTRATION
           
private  RegistrationContext registrationContext
          The registration with the current producer.
private  RegistrationData registrationData
          The registration data used to register this consumer with the associated producer
private  RenderHandler renderHandler
           
private static java.lang.String SERVICE_DESCRIPTION
           
private  GetServiceDescription serviceDescriptionRequest
          The service description sent to producer.
private  ServiceFactory serviceFactory
          The service factory.
private  SessionHandler sessionHandler
           
private  java.util.Set supportedUserScopes
          The set of supported user scopes
private  GetServiceDescription unregisteredServiceDescriptionRequest
          The service description request sent to producer before registration happens.
private static java.util.Set WSRP_DEFAULT_USER_SCOPE
          The default user scopes as per the specification (6.1.4)
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, 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
WSRPConsumerImpl()
           
 
Method Summary
 PortletContext createClone(PortletContext portletContext)
          Clone a portlet.
 java.util.List destroyClones(java.util.List portletIds)
          Destroy a cloned portlet.
private  java.util.Map extractOfferedPortlets(ServiceDescription sd)
          Extracts a map of offered Portlet objects from ServiceDescription
 java.lang.Integer getExpirationCacheSeconds()
          Retrieves the cache expiration duration (in seconds) for cached values.
(package private) static javax.servlet.http.HttpServletRequest getHttpRequest(PortletInvocation invocation)
           
(package private) static javax.servlet.http.HttpSession getHttpSession(PortletInvocation invocation)
           
 WSRP_v1_Markup_PortType getMarkupService()
           
 Portlet getPortlet(PortletContext portletContext)
          Get information about a specific portlet.
private  Portlet getPortlet(java.lang.String portletId)
           
 java.util.Map getPortletGroupMap()
           
(package private) static java.lang.String getPortletHandle(PortletInvocation invocation)
           
(package private)  WSRPPortletInfo getPortletInfo(PortletInvocation invocation)
           
 WSRP_v1_PortletManagement_PortType getPortletManagementService()
           
private  java.util.Map getPortletMap()
           
 java.util.Set getPortlets()
          Return the set of portlet exposed.
 java.lang.String getProducerId()
          Retrieves the identifier for the producer this consumer is associated with.
 ProducerSessionInformation getProducerSessionInformationFrom(javax.servlet.http.HttpSession session)
          Retrieves the session information for the producer associated with this consumer.
 ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
          Retrieves the session information for the producer associated with this consumer.
 PropertyMap getProperties(PortletContext portletContext)
          Return all the properties of the specified portlet.
 PropertyMap getProperties(PortletContext portletContext, java.util.Set keys)
          Return a subset of the properties of the specified portlet.
(package private)  RegistrationContext getRegistrationContext()
           
 RegistrationData getRegistrationData()
          Retrieves the registration data used to register this consumer with the associated producer
 WSRP_v1_Registration_PortType getRegistrationService()
           
private  java.lang.Object getService(java.lang.String description, java.lang.Class clazz)
           
 ServiceDescription getServiceDescriptionAndRegisterIfNeeded()
           
private  GetServiceDescription getServiceDescriptionRequest()
           
 WSRP_v1_ServiceDescription_PortType getServiceDescriptionService()
           
 ServiceFactory getServiceFactory()
          Retrieves the ServiceFactory this Consumer will use to access the associated Producer's services.
 SessionHandler getSessionHandler()
           
 java.util.Set getSupportedUserScopes()
           
private  GetServiceDescription getUnregisteredServiceDescriptionRequest()
          Retrieves the service description request this consumer uses when not registered.
(package private)  org.jboss.portal.wsrp.core.UserContext getUserContextFrom(PortletInvocation invocation, RuntimeContext runtimeContext)
           
private  java.lang.String getUserContextKeyFor(UserContext userContext)
           
(package private)  WSRPPortlet getWSRPPortlet(java.lang.String portletId)
           
(package private)  void handleInvalidRegistrationFault()
           
private  GetServiceDescription initUnregisteredServiceDescriptionRequest()
          Initializes the service description request this consumer uses when not registered.
 PortletInvocationResponse invoke(PortletInvocation invocation)
          Invoke an operation on a specific portlet.
 void setExpirationCacheSeconds(java.lang.Integer expirationCacheSeconds)
          Sets the cache expiration duration (in seconds) for cached values.
 void setProducerId(java.lang.String id)
          Sets the identifier for the producer this consumer is associated with.
 PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes)
          Set the properties on the specified portlet.
 void setRegistrationData(RegistrationData registrationData)
          Sets the registration data used to register this consumer with the associated producer
private  void setServiceDescriptionRequest(GetServiceDescription request)
           
 void setServiceFactory(ServiceFactory serviceFactory)
          Sets the ServiceFactory this Consumer will use to access the associated Producer's services.
(package private)  void setTemplatesIfNeeded(PortletInvocation invocation, RuntimeContext runtimeContext)
           
protected  void startService()
           
 boolean supportsUserScope(java.lang.String userScope)
          Determines whether the specified user scope (for markup caching) is supported.
private  void updateCachesIfNeeded()
           
private  boolean useCache()
           
 
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
createService, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, stopService
 
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

SERVICE_DESCRIPTION

private static final java.lang.String SERVICE_DESCRIPTION
See Also:
Constant Field Values

MARKUP

private static final java.lang.String MARKUP
See Also:
Constant Field Values

PORTLET_MANAGEMENT

private static final java.lang.String PORTLET_MANAGEMENT
See Also:
Constant Field Values

REGISTRATION

private static final java.lang.String REGISTRATION
See Also:
Constant Field Values

actionHandler

private ActionHandler actionHandler

renderHandler

private RenderHandler renderHandler

sessionHandler

private SessionHandler sessionHandler

unregisteredServiceDescriptionRequest

private final GetServiceDescription unregisteredServiceDescriptionRequest
The service description request sent to producer before registration happens.


serviceDescriptionRequest

private GetServiceDescription serviceDescriptionRequest
The service description sent to producer.


registrationContext

private RegistrationContext registrationContext
The registration with the current producer.


serviceFactory

private ServiceFactory serviceFactory
The service factory.


cachedPortletMap

private java.util.Map cachedPortletMap
The cached portlets.


portletGroups

private java.util.Map portletGroups
Portlet groups.


expirationCacheSeconds

private java.lang.Integer expirationCacheSeconds
The cache expiration duration (in seconds) for cached values


expirationTimeMillis

private long expirationTimeMillis
.


producerId

private java.lang.String producerId
The identifier of the associated producer


registrationData

private RegistrationData registrationData
The registration data used to register this consumer with the associated producer


WSRP_DEFAULT_USER_SCOPE

private static final java.util.Set WSRP_DEFAULT_USER_SCOPE
The default user scopes as per the specification (6.1.4)


supportedUserScopes

private java.util.Set supportedUserScopes
The set of supported user scopes

Constructor Detail

WSRPConsumerImpl

public WSRPConsumerImpl()
Method Detail

getPortlets

public java.util.Set getPortlets()
                          throws InvokerUnavailableException
Description copied from interface: PortletInvoker
Return the set of portlet exposed.

Specified by:
getPortlets in interface PortletInvoker
Returns:
the set of exposed portlets
Throws:
InvokerUnavailableException

getPortlet

public Portlet getPortlet(PortletContext portletContext)
                   throws java.lang.IllegalArgumentException,
                          PortletInvokerException
Description copied from interface: PortletInvoker
Get information about a specific portlet.

Specified by:
getPortlet in interface PortletInvoker
Parameters:
portletContext - the portlet context in the scope of this invoker
Returns:
the PortletInfo for the specified portlet
Throws:
java.lang.IllegalArgumentException - if the portlet context is null
PortletInvokerException

getPortlet

private Portlet getPortlet(java.lang.String portletId)
                    throws PortletInvokerException
Throws:
PortletInvokerException

invoke

public PortletInvocationResponse invoke(PortletInvocation invocation)
                                 throws PortletInvokerException
Description copied from interface: PortletInvoker
Invoke an operation on a specific portlet.

Specified by:
invoke in interface PortletInvoker
Parameters:
invocation - the portlet invocation
Returns:
the invocatin response
Throws:
PortletInvokerException

createClone

public PortletContext createClone(PortletContext portletContext)
                           throws java.lang.IllegalArgumentException,
                                  PortletInvokerException,
                                  java.lang.UnsupportedOperationException
Description copied from interface: PortletInvoker
Clone a portlet.

Specified by:
createClone in interface PortletInvoker
Returns:
the clone id
Throws:
java.lang.UnsupportedOperationException - if the invoker does not support this operation
java.lang.IllegalArgumentException - if the portletId is null
PortletInvokerException

destroyClones

public java.util.List destroyClones(java.util.List portletIds)
                             throws java.lang.IllegalArgumentException,
                                    PortletInvokerException,
                                    java.lang.UnsupportedOperationException
Description copied from interface: PortletInvoker
Destroy a cloned portlet.

Specified by:
destroyClones in interface PortletInvoker
Parameters:
portletIds - a list of portlet contexts to destroy
Returns:
a list of portlet ids that were not destroyed during the operation
Throws:
java.lang.IllegalArgumentException - if the portletId is null
java.lang.UnsupportedOperationException - if the invoker does not support this operation
PortletInvokerException

getProperties

public PropertyMap getProperties(PortletContext portletContext,
                                 java.util.Set keys)
                          throws java.lang.IllegalArgumentException,
                                 PortletInvokerException,
                                 java.lang.UnsupportedOperationException
Description copied from interface: PortletInvoker
Return a subset of the properties of the specified portlet.

Specified by:
getProperties in interface PortletInvoker
Parameters:
portletContext - the portlet context
keys - the set of keys to retrieve
Returns:
the properties
Throws:
java.lang.UnsupportedOperationException - if the invoker does not support this operation
java.lang.IllegalArgumentException - if the portletId or the keys arguments are null
PortletInvokerException

getProperties

public PropertyMap getProperties(PortletContext portletContext)
                          throws java.lang.IllegalArgumentException,
                                 PortletInvokerException,
                                 java.lang.UnsupportedOperationException
Description copied from interface: PortletInvoker
Return all the properties of the specified portlet.

Specified by:
getProperties in interface PortletInvoker
Parameters:
portletContext - the portlet context
Returns:
the properties
Throws:
java.lang.UnsupportedOperationException - if the invoker does not support this operation
java.lang.IllegalArgumentException - if the portletId is null
PortletInvokerException

setProperties

public PortletContext setProperties(PortletContext portletContext,
                                    PropertyChange[] changes)
                             throws java.lang.IllegalArgumentException,
                                    PortletInvokerException,
                                    java.lang.UnsupportedOperationException
Description copied from interface: PortletInvoker
Set the properties on the specified portlet.

Specified by:
setProperties in interface PortletInvoker
Parameters:
portletContext - the portlet context
changes - the changes
Throws:
java.lang.UnsupportedOperationException - if the invoker does not support this operation
java.lang.IllegalArgumentException - if the portletId or the properties is null
PortletInvokerException

setProducerId

public void setProducerId(java.lang.String id)
Description copied from interface: WSRPConsumer
Sets the identifier for the producer this consumer is associated with.

Specified by:
setProducerId in interface WSRPConsumer
Parameters:
id - the identifier of the associated producer

getProducerId

public java.lang.String getProducerId()
Description copied from interface: WSRPConsumer
Retrieves the identifier for the producer this consumer is associated with.

Specified by:
getProducerId in interface WSRPConsumer
Returns:
the identifier of the associated producer

getSessionHandler

public SessionHandler getSessionHandler()

getPortletGroupMap

public java.util.Map getPortletGroupMap()
                                 throws ServiceDescriptionUnavailableException
Throws:
ServiceDescriptionUnavailableException

getPortletHandle

static java.lang.String getPortletHandle(PortletInvocation invocation)

getPortletInfo

WSRPPortletInfo getPortletInfo(PortletInvocation invocation)

getWSRPPortlet

WSRPPortlet getWSRPPortlet(java.lang.String portletId)
                     throws PortletInvokerException
Throws:
PortletInvokerException

getPortletMap

private java.util.Map getPortletMap()
                             throws ServiceDescriptionUnavailableException
Throws:
ServiceDescriptionUnavailableException

extractOfferedPortlets

private java.util.Map extractOfferedPortlets(ServiceDescription sd)
Extracts a map of offered Portlet objects from ServiceDescription

Parameters:
sd -
Returns:
a Map (portlet handle -> Portlet) of the offered portlets.

useCache

private boolean useCache()

updateCachesIfNeeded

private void updateCachesIfNeeded()
                           throws ServiceDescriptionUnavailableException
Throws:
ServiceDescriptionUnavailableException

getExpirationCacheSeconds

public java.lang.Integer getExpirationCacheSeconds()
Description copied from interface: WSRPConsumer
Retrieves the cache expiration duration (in seconds) for cached values.

Specified by:
getExpirationCacheSeconds in interface WSRPConsumer
Returns:
Sets the cache expiration duration (in seconds) for cached values.

setExpirationCacheSeconds

public void setExpirationCacheSeconds(java.lang.Integer expirationCacheSeconds)
Description copied from interface: WSRPConsumer
Sets the cache expiration duration (in seconds) for cached values.

Specified by:
setExpirationCacheSeconds in interface WSRPConsumer
Parameters:
expirationCacheSeconds - the cache expiration duration (in seconds)

getSupportedUserScopes

public java.util.Set getSupportedUserScopes()

supportsUserScope

public boolean supportsUserScope(java.lang.String userScope)
Determines whether the specified user scope (for markup caching) is supported.

Parameters:
userScope - the user scope which support is to be determined
Returns:
true if the given user scope is supported, false otherwise

handleInvalidRegistrationFault

void handleInvalidRegistrationFault()
                              throws ServiceDescriptionUnavailableException
Throws:
ServiceDescriptionUnavailableException

getRegistrationContext

RegistrationContext getRegistrationContext()

setRegistrationData

public void setRegistrationData(RegistrationData registrationData)
Description copied from interface: WSRPConsumer
Sets the registration data used to register this consumer with the associated producer

Specified by:
setRegistrationData in interface WSRPConsumer
Parameters:
registrationData - the registration data used to register this consumer with the associated producer

getRegistrationData

public RegistrationData getRegistrationData()
Description copied from interface: WSRPConsumer
Retrieves the registration data used to register this consumer with the associated producer

Specified by:
getRegistrationData in interface WSRPConsumer
Returns:
the registration data used to register this consumer with the associated producer

getProducerSessionInformationFrom

public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
Description copied from interface: WSRPConsumer
Retrieves the session information for the producer associated with this consumer.

Specified by:
getProducerSessionInformationFrom in interface WSRPConsumer
Parameters:
invocation - a portlet invocation from which the session information should be extracted.
Returns:
the session information for the producer associated with this consumer.
See Also:
ProducerSessionInformation

getProducerSessionInformationFrom

public ProducerSessionInformation getProducerSessionInformationFrom(javax.servlet.http.HttpSession session)
Description copied from interface: WSRPConsumer
Retrieves the session information for the producer associated with this consumer.

Specified by:
getProducerSessionInformationFrom in interface WSRPConsumer
Parameters:
session - the session from the information should be extracted.
Returns:
the session information for the producer associated with this consumer.
See Also:
ProducerSessionInformation

startService

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

getServiceFactory

public ServiceFactory getServiceFactory()
Description copied from interface: WSRPConsumer
Retrieves the ServiceFactory this Consumer will use to access the associated Producer's services.

Specified by:
getServiceFactory in interface WSRPConsumer
Returns:
the ServiceFactory this Consumer will use to access the associated Producer's services.

setServiceFactory

public void setServiceFactory(ServiceFactory serviceFactory)
Description copied from interface: WSRPConsumer
Sets the ServiceFactory this Consumer will use to access the associated Producer's services.

Specified by:
setServiceFactory in interface WSRPConsumer
Parameters:
serviceFactory - the ServiceFactory this Consumer will use to access the associated Producer's services.

getServiceDescriptionService

public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService()
                                                                 throws InvokerUnavailableException
Throws:
InvokerUnavailableException

getMarkupService

public WSRP_v1_Markup_PortType getMarkupService()
                                         throws InvokerUnavailableException
Throws:
InvokerUnavailableException

getPortletManagementService

public WSRP_v1_PortletManagement_PortType getPortletManagementService()
                                                               throws InvokerUnavailableException
Throws:
InvokerUnavailableException

getRegistrationService

public WSRP_v1_Registration_PortType getRegistrationService()
                                                     throws InvokerUnavailableException
Throws:
InvokerUnavailableException

getService

private java.lang.Object getService(java.lang.String description,
                                    java.lang.Class clazz)
                             throws InvokerUnavailableException
Throws:
InvokerUnavailableException

getServiceDescriptionAndRegisterIfNeeded

public ServiceDescription getServiceDescriptionAndRegisterIfNeeded()
                                                            throws ServiceDescriptionUnavailableException
Throws:
ServiceDescriptionUnavailableException

setServiceDescriptionRequest

private void setServiceDescriptionRequest(GetServiceDescription request)

getServiceDescriptionRequest

private GetServiceDescription getServiceDescriptionRequest()

getUnregisteredServiceDescriptionRequest

private GetServiceDescription getUnregisteredServiceDescriptionRequest()
Retrieves the service description request this consumer uses when not registered.

Returns:
the service description request this consumer uses when not registered.

initUnregisteredServiceDescriptionRequest

private GetServiceDescription initUnregisteredServiceDescriptionRequest()
Initializes the service description request this consumer uses when not registered. TODO: Implement customization.

Returns:
the service description request this consumer uses when not registered.

getUserContextKeyFor

private java.lang.String getUserContextKeyFor(UserContext userContext)

getUserContextFrom

org.jboss.portal.wsrp.core.UserContext getUserContextFrom(PortletInvocation invocation,
                                                          RuntimeContext runtimeContext)

setTemplatesIfNeeded

void setTemplatesIfNeeded(PortletInvocation invocation,
                          RuntimeContext runtimeContext)

getHttpRequest

static javax.servlet.http.HttpServletRequest getHttpRequest(PortletInvocation invocation)

getHttpSession

static javax.servlet.http.HttpSession getHttpSession(PortletInvocation invocation)