org.jboss.portal.wsrp.consumer
Class WSRPConsumerImpl

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.portal.jems.as.system.AbstractJBossService
              extended by org.jboss.portal.wsrp.consumer.WSRPConsumerImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, PortalEventListener, org.jboss.portal.portlet.PortletInvoker, WSRPConsumer, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class WSRPConsumerImpl
extends AbstractJBossService
implements WSRPConsumer

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

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
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
 void activate()
          Prepares this Consumer to be used: service is started, endpoints are ready.
 org.jboss.portal.portlet.PortletContext createClone(org.jboss.portal.portlet.PortletContext portletContext)
           
 void deactivate()
          Removes this Consumer from service.
 java.util.List destroyClones(java.util.List portletContexts)
           
 WSRP_v1_Markup_PortType getMarkupService()
           
 org.jboss.portal.portlet.Portlet getPortlet(org.jboss.portal.portlet.PortletContext portletContext)
           
 java.util.Map<java.lang.String,java.util.Set<org.jboss.portal.portlet.Portlet>> getPortletGroupMap()
           
 WSRP_v1_PortletManagement_PortType getPortletManagementService()
           
 java.util.Set getPortlets()
           
 java.lang.String getProducerId()
          Retrieves the identifier for the producer this consumer is associated with.
 ProducerInfo getProducerInfo()
           
 ProducerSessionInformation getProducerSessionInformationFrom(javax.servlet.http.HttpSession session)
          Retrieves the session information for the producer associated with this consumer.
 ProducerSessionInformation getProducerSessionInformationFrom(org.jboss.portal.portlet.invocation.PortletInvocation invocation)
          Retrieves the session information for the producer associated with this consumer.
 org.jboss.portal.portlet.state.PropertyMap getProperties(org.jboss.portal.portlet.PortletContext portletContext)
           
 org.jboss.portal.portlet.state.PropertyMap getProperties(org.jboss.portal.portlet.PortletContext portletContext, java.util.Set keys)
           
 WSRP_v1_Registration_PortType getRegistrationService()
           
 WSRP_v1_ServiceDescription_PortType getServiceDescriptionService()
           
 SessionHandler getSessionHandler()
           
 java.util.Set getSupportedUserScopes()
           
 org.jboss.portal.portlet.invocation.response.PortletInvocationResponse invoke(org.jboss.portal.portlet.invocation.PortletInvocation invocation)
           
 boolean isActive()
           
 boolean isRefreshNeeded()
           
 void onEvent(PortalEventContext eventContext, PortalEvent event)
          Just delegate to SessionHandler
 RefreshResult refresh(boolean forceRefresh)
           
 void refreshProducerInfo()
           
 void releaseSessions()
          Releases all the sessions held by this Consumer
 void setProducerInfo(ProducerInfo producerInfo)
           
 org.jboss.portal.portlet.PortletContext setProperties(org.jboss.portal.portlet.PortletContext portletContext, org.jboss.portal.portlet.state.PropertyChange[] changes)
           
 void setServiceFactory(ServiceFactory serviceFactory)
          Needed to wire Consumer tests.
protected  void startService()
           
protected  void stopService()
           
 boolean supportsUserScope(java.lang.String userScope)
          Determines whether the specified user scope (for markup caching) is supported.
 
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
 
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
 

Constructor Detail

WSRPConsumerImpl

public WSRPConsumerImpl()
Method Detail

getProducerInfo

public ProducerInfo getProducerInfo()
Specified by:
getProducerInfo in interface WSRPConsumer
Returns:

setProducerInfo

public void setProducerInfo(ProducerInfo producerInfo)
Specified by:
setProducerInfo in interface WSRPConsumer

getPortlets

public java.util.Set getPortlets()
                          throws org.jboss.portal.portlet.InvokerUnavailableException
Specified by:
getPortlets in interface org.jboss.portal.portlet.PortletInvoker
Throws:
org.jboss.portal.portlet.InvokerUnavailableException

getPortlet

public org.jboss.portal.portlet.Portlet getPortlet(org.jboss.portal.portlet.PortletContext portletContext)
                                            throws java.lang.IllegalArgumentException,
                                                   org.jboss.portal.portlet.PortletInvokerException
Specified by:
getPortlet in interface org.jboss.portal.portlet.PortletInvoker
Throws:
java.lang.IllegalArgumentException
org.jboss.portal.portlet.PortletInvokerException

invoke

public org.jboss.portal.portlet.invocation.response.PortletInvocationResponse invoke(org.jboss.portal.portlet.invocation.PortletInvocation invocation)
                                                                              throws org.jboss.portal.portlet.PortletInvokerException
Specified by:
invoke in interface org.jboss.portal.portlet.PortletInvoker
Throws:
org.jboss.portal.portlet.PortletInvokerException

createClone

public org.jboss.portal.portlet.PortletContext createClone(org.jboss.portal.portlet.PortletContext portletContext)
                                                    throws java.lang.IllegalArgumentException,
                                                           org.jboss.portal.portlet.PortletInvokerException,
                                                           java.lang.UnsupportedOperationException
Specified by:
createClone in interface org.jboss.portal.portlet.PortletInvoker
Throws:
java.lang.IllegalArgumentException
org.jboss.portal.portlet.PortletInvokerException
java.lang.UnsupportedOperationException

destroyClones

public java.util.List destroyClones(java.util.List portletContexts)
                             throws java.lang.IllegalArgumentException,
                                    org.jboss.portal.portlet.PortletInvokerException,
                                    java.lang.UnsupportedOperationException
Specified by:
destroyClones in interface org.jboss.portal.portlet.PortletInvoker
Throws:
java.lang.IllegalArgumentException
org.jboss.portal.portlet.PortletInvokerException
java.lang.UnsupportedOperationException

getProperties

public org.jboss.portal.portlet.state.PropertyMap getProperties(org.jboss.portal.portlet.PortletContext portletContext,
                                                                java.util.Set keys)
                                                         throws java.lang.IllegalArgumentException,
                                                                org.jboss.portal.portlet.PortletInvokerException,
                                                                java.lang.UnsupportedOperationException
Specified by:
getProperties in interface org.jboss.portal.portlet.PortletInvoker
Throws:
java.lang.IllegalArgumentException
org.jboss.portal.portlet.PortletInvokerException
java.lang.UnsupportedOperationException

getProperties

public org.jboss.portal.portlet.state.PropertyMap getProperties(org.jboss.portal.portlet.PortletContext portletContext)
                                                         throws java.lang.IllegalArgumentException,
                                                                org.jboss.portal.portlet.PortletInvokerException,
                                                                java.lang.UnsupportedOperationException
Specified by:
getProperties in interface org.jboss.portal.portlet.PortletInvoker
Throws:
java.lang.IllegalArgumentException
org.jboss.portal.portlet.PortletInvokerException
java.lang.UnsupportedOperationException

setProperties

public org.jboss.portal.portlet.PortletContext setProperties(org.jboss.portal.portlet.PortletContext portletContext,
                                                             org.jboss.portal.portlet.state.PropertyChange[] changes)
                                                      throws java.lang.IllegalArgumentException,
                                                             org.jboss.portal.portlet.PortletInvokerException,
                                                             java.lang.UnsupportedOperationException
Specified by:
setProperties in interface org.jboss.portal.portlet.PortletInvoker
Throws:
java.lang.IllegalArgumentException
org.jboss.portal.portlet.PortletInvokerException
java.lang.UnsupportedOperationException

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<java.lang.String,java.util.Set<org.jboss.portal.portlet.Portlet>> getPortletGroupMap()
                                                                                                   throws org.jboss.portal.portlet.PortletInvokerException
Throws:
org.jboss.portal.portlet.PortletInvokerException

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

getProducerSessionInformationFrom

public ProducerSessionInformation getProducerSessionInformationFrom(org.jboss.portal.portlet.invocation.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

activate

public void activate()
              throws java.lang.Exception
Description copied from interface: WSRPConsumer
Prepares this Consumer to be used: service is started, endpoints are ready.

Specified by:
activate in interface WSRPConsumer
Throws:
java.lang.Exception

deactivate

public void deactivate()
                throws java.lang.Exception
Description copied from interface: WSRPConsumer
Removes this Consumer from service. It cannot be used before being activated again.

Specified by:
deactivate in interface WSRPConsumer
Throws:
java.lang.Exception

isActive

public boolean isActive()
Specified by:
isActive in interface WSRPConsumer
Returns:

isRefreshNeeded

public boolean isRefreshNeeded()
Specified by:
isRefreshNeeded in interface WSRPConsumer
Returns:

refresh

public RefreshResult refresh(boolean forceRefresh)
                      throws org.jboss.portal.portlet.PortletInvokerException
Specified by:
refresh in interface WSRPConsumer
Returns:
Throws:
org.jboss.portal.portlet.PortletInvokerException

startService

protected void startService()
                     throws java.lang.Exception
Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

stopService

protected void stopService()
                    throws java.lang.Exception
Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
java.lang.Exception

setServiceFactory

public void setServiceFactory(ServiceFactory serviceFactory)
Needed to wire Consumer tests.

Parameters:
serviceFactory -

getServiceDescriptionService

public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService()
                                                                 throws org.jboss.portal.portlet.PortletInvokerException
Throws:
org.jboss.portal.portlet.PortletInvokerException

getMarkupService

public WSRP_v1_Markup_PortType getMarkupService()
                                         throws org.jboss.portal.portlet.PortletInvokerException
Throws:
org.jboss.portal.portlet.PortletInvokerException

getPortletManagementService

public WSRP_v1_PortletManagement_PortType getPortletManagementService()
                                                               throws org.jboss.portal.portlet.PortletInvokerException
Throws:
org.jboss.portal.portlet.PortletInvokerException

getRegistrationService

public WSRP_v1_Registration_PortType getRegistrationService()
                                                     throws org.jboss.portal.portlet.PortletInvokerException
Throws:
org.jboss.portal.portlet.PortletInvokerException

refreshProducerInfo

public void refreshProducerInfo()
                         throws org.jboss.portal.portlet.PortletInvokerException
Specified by:
refreshProducerInfo in interface WSRPConsumer
Throws:
org.jboss.portal.portlet.PortletInvokerException

releaseSessions

public void releaseSessions()
                     throws org.jboss.portal.portlet.PortletInvokerException
Description copied from interface: WSRPConsumer
Releases all the sessions held by this Consumer

Specified by:
releaseSessions in interface WSRPConsumer
Throws:
org.jboss.portal.portlet.PortletInvokerException

onEvent

public void onEvent(PortalEventContext eventContext,
                    PortalEvent event)
Just delegate to SessionHandler

Specified by:
onEvent in interface PortalEventListener
Parameters:
eventContext -
event -
Since:
2.6