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

WSRPProducerImpl - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.wsrp.producer
Class WSRPProducerImpl

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.producer.WSRPProducerImpl
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, org.jboss.system.Service, org.jboss.system.ServiceMBean, WSRPProducer

public class WSRPProducerImpl
extends AbstractJBossService
implements WSRPProducer

Since:
2.4
Version:
$Revision: 5440 $
Author:
Chris Laprun

Nested Class Summary
private  class WSRPProducerImpl.SessionManager
           
 
Field Summary
private  PortletInvoker invoker
          The invoker used to retrieve portlet information and invoke methods.
private  org.jboss.logging.Logger log
          logger used for logging ;)
private  MarkupHandler markupHandler
          Handles Markup interface calls.
private  PortletManagementHandler portletManagementHandler
          Handles Portlet Management interface calls.
private  RegistrationHandler registrationHandler
          Handles Registration interface calls.
private  java.lang.Boolean remotableByDefault
           
private  ModelDescription requiredRegistrationInfo
          Required registration information to be provided by consumers to access this Producer's information and services.
private  ServiceDescription requiredRegistrationNotProvidedSD
          The ServiceDescription that is returned to an unregistred Consumer when registration is required: no information is provided apart from the fact that registration is required and what information is required to sucessfully register.
private  CookieProtocol requiresInitCookie
           
private  boolean requiresRegistration
          true if registration is required to access this Producer's information and services, false otherwise.
private  ServiceDescriptionHandler serviceDescriptionHandler
          Handles ServiceDescription interface calls.
private  int sessionExpirationTime
           
private  WSRPProducerImpl.SessionManager sessionManager
          Manages the sessions.
private  java.lang.String[] supportedLocales
          Supported locales.
 
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.portal.wsrp.WSRPProducer
DEFAULT_SESSION_EXPIRATION_TIME, INFINITE_SESSION_EXPIRATION_TIME
 
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
WSRPProducerImpl()
           
 
Method Summary
 void addRegistrationProperty(PropertyDescription propertyDescription)
          Adds a registration property to the set of required information for Consumers to provide when registering with this Producer
 void addSession(javax.servlet.http.HttpSession session)
           
protected  void checkRegistration(RegistrationContext registrationContext)
           
 void clearRegistrationProperties()
          Remove all existing registration properties.
 PortletContext clonePortlet(ClonePortlet clonePortlet)
           
 ReturnAny deregister(RegistrationContext deregister)
           
 DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets)
           
 PortletInvoker getInvoker()
           
 MarkupResponse getMarkup(GetMarkup getMarkup)
           
 PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
           
 PortletDescription getPortletDescription(java.lang.String handle, java.lang.String[] locales)
           
 PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
           
 PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
           
(package private)  Portlet getPortletWith(java.lang.String handle)
           
protected  ServiceDescription getRegistrationNotProvidedServiceDescription()
          Retrieves the service description offered to unregistered consumers when registration is required.
(package private)  java.util.Set getRemotablePortlets()
           
 CookieProtocol getRequiresInitCookie()
          Indicates whether or not the Producer requires the Consumer to assist with cookie support of the HTTP protocol.
 ServiceDescription getServiceDescription(GetServiceDescription gs)
           
(package private)  javax.servlet.http.HttpSession getSession()
           
 int getSessionExpirationTime()
          Maximum number of seconds between invocations referencing a session ID before this Producer will schedule releasing the related resources.
 ReturnAny initCookie(InitCookie initCookie)
           
private  ServiceDescription initRegistrationNotProvidedServiceDescription()
          Initializes the ServiceDescription that is returned to Consumers trying to access this Producer's information without valid registration information when one is required.
private  ModelDescription initRequiredRegistrationInfo()
          Initializes the information required to be able to sucessfully register with this Producer.
 java.lang.Object invoke(org.jboss.invocation.Invocation invocation)
          Dispatch the invocation to the target by reflection
protected  boolean isRegistrationValid(RegistrationContext registrationContext)
          Checks that the specified registration information is valid if this Producer requires registration.
private  boolean isRemotable(Portlet portlet)
           
 java.lang.Boolean isRemotableByDefault()
           
 boolean isRequiresRegistration()
          Determines whether registration is required to access this Producer's information and services.
 boolean isSessionValid(java.lang.String sessionId)
          Checks that the session identified with the specified id is valid.
 RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
           
 BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
           
 RegistrationContext register(RegistrationData register)
           
 void releaseSession(java.lang.String sessionID)
           
 ReturnAny releaseSessions(ReleaseSessions releaseSessions)
           
 void setInvoker(PortletInvoker invoker)
           
 PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
           
 void setRemotableByDefault(java.lang.Boolean remotableByDefault)
           
 void setRequiresInitCookie(CookieProtocol requiresInitCookie)
          Sets the level of cookie support required by the Consumer.
 void setRequiresRegistration(boolean requiresRegistration)
          Specifies whether this Producer requires clients to be registered or not.
 void setSessionExpirationTime(int sessionExpirationTime)
          Sets the expiration time (in seconds) of session associated resources.
 
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, startService, 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
 

Field Detail

log

private final org.jboss.logging.Logger log
logger used for logging ;)


invoker

private PortletInvoker invoker
The invoker used to retrieve portlet information and invoke methods.


markupHandler

private MarkupHandler markupHandler
Handles Markup interface calls.


serviceDescriptionHandler

private ServiceDescriptionHandler serviceDescriptionHandler
Handles ServiceDescription interface calls.


registrationHandler

private RegistrationHandler registrationHandler
Handles Registration interface calls.


portletManagementHandler

private PortletManagementHandler portletManagementHandler
Handles Portlet Management interface calls.


requiredRegistrationNotProvidedSD

private final ServiceDescription requiredRegistrationNotProvidedSD
The ServiceDescription that is returned to an unregistred Consumer when registration is required: no information is provided apart from the fact that registration is required and what information is required to sucessfully register.

See Also:
requiredRegistrationInfo

requiresRegistration

private boolean requiresRegistration
true if registration is required to access this Producer's information and services, false otherwise. Note: server-side registration is not supported in 2.4


sessionExpirationTime

private int sessionExpirationTime

requiresInitCookie

private CookieProtocol requiresInitCookie

supportedLocales

private java.lang.String[] supportedLocales
Supported locales.


requiredRegistrationInfo

private ModelDescription requiredRegistrationInfo
Required registration information to be provided by consumers to access this Producer's information and services.


sessionManager

private WSRPProducerImpl.SessionManager sessionManager
Manages the sessions.


remotableByDefault

private java.lang.Boolean remotableByDefault
Constructor Detail

WSRPProducerImpl

public WSRPProducerImpl()
Method Detail

getServiceDescription

public ServiceDescription getServiceDescription(GetServiceDescription gs)
                                         throws InvalidRegistrationFault,
                                                OperationFailedFault,
                                                java.rmi.RemoteException
Throws:
InvalidRegistrationFault
OperationFailedFault
java.rmi.RemoteException

getMarkup

public MarkupResponse getMarkup(GetMarkup getMarkup)
                         throws UnsupportedWindowStateFault,
                                InvalidCookieFault,
                                InvalidSessionFault,
                                AccessDeniedFault,
                                InconsistentParametersFault,
                                InvalidHandleFault,
                                UnsupportedLocaleFault,
                                UnsupportedModeFault,
                                OperationFailedFault,
                                MissingParametersFault,
                                InvalidUserCategoryFault,
                                InvalidRegistrationFault,
                                UnsupportedMimeTypeFault,
                                java.rmi.RemoteException
Throws:
UnsupportedWindowStateFault
InvalidCookieFault
InvalidSessionFault
AccessDeniedFault
InconsistentParametersFault
InvalidHandleFault
UnsupportedLocaleFault
UnsupportedModeFault
OperationFailedFault
MissingParametersFault
InvalidUserCategoryFault
InvalidRegistrationFault
UnsupportedMimeTypeFault
java.rmi.RemoteException

performBlockingInteraction

public BlockingInteractionResponse performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
                                                       throws InvalidSessionFault,
                                                              UnsupportedModeFault,
                                                              UnsupportedMimeTypeFault,
                                                              OperationFailedFault,
                                                              UnsupportedWindowStateFault,
                                                              UnsupportedLocaleFault,
                                                              AccessDeniedFault,
                                                              PortletStateChangeRequiredFault,
                                                              InvalidRegistrationFault,
                                                              MissingParametersFault,
                                                              InvalidUserCategoryFault,
                                                              InconsistentParametersFault,
                                                              InvalidHandleFault,
                                                              InvalidCookieFault,
                                                              java.rmi.RemoteException
Throws:
InvalidSessionFault
UnsupportedModeFault
UnsupportedMimeTypeFault
OperationFailedFault
UnsupportedWindowStateFault
UnsupportedLocaleFault
AccessDeniedFault
PortletStateChangeRequiredFault
InvalidRegistrationFault
MissingParametersFault
InvalidUserCategoryFault
InconsistentParametersFault
InvalidHandleFault
InvalidCookieFault
java.rmi.RemoteException

releaseSessions

public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
                          throws InvalidRegistrationFault,
                                 OperationFailedFault,
                                 MissingParametersFault,
                                 AccessDeniedFault,
                                 java.rmi.RemoteException
Throws:
InvalidRegistrationFault
OperationFailedFault
MissingParametersFault
AccessDeniedFault
java.rmi.RemoteException

initCookie

public ReturnAny initCookie(InitCookie initCookie)
                     throws AccessDeniedFault,
                            OperationFailedFault,
                            InvalidRegistrationFault,
                            java.rmi.RemoteException
Throws:
AccessDeniedFault
OperationFailedFault
InvalidRegistrationFault
java.rmi.RemoteException

register

public RegistrationContext register(RegistrationData register)
                             throws MissingParametersFault,
                                    OperationFailedFault,
                                    java.rmi.RemoteException
Throws:
MissingParametersFault
OperationFailedFault
java.rmi.RemoteException

deregister

public ReturnAny deregister(RegistrationContext deregister)
                     throws OperationFailedFault,
                            InvalidRegistrationFault,
                            java.rmi.RemoteException
Throws:
OperationFailedFault
InvalidRegistrationFault
java.rmi.RemoteException

modifyRegistration

public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
                                     throws MissingParametersFault,
                                            OperationFailedFault,
                                            InvalidRegistrationFault,
                                            java.rmi.RemoteException
Throws:
MissingParametersFault
OperationFailedFault
InvalidRegistrationFault
java.rmi.RemoteException

getPortletDescription

public PortletDescriptionResponse getPortletDescription(GetPortletDescription getPortletDescription)
                                                 throws AccessDeniedFault,
                                                        InvalidHandleFault,
                                                        InvalidUserCategoryFault,
                                                        InconsistentParametersFault,
                                                        MissingParametersFault,
                                                        InvalidRegistrationFault,
                                                        OperationFailedFault,
                                                        java.rmi.RemoteException
Throws:
AccessDeniedFault
InvalidHandleFault
InvalidUserCategoryFault
InconsistentParametersFault
MissingParametersFault
InvalidRegistrationFault
OperationFailedFault
java.rmi.RemoteException

clonePortlet

public PortletContext clonePortlet(ClonePortlet clonePortlet)
                            throws InvalidUserCategoryFault,
                                   AccessDeniedFault,
                                   OperationFailedFault,
                                   InvalidHandleFault,
                                   InvalidRegistrationFault,
                                   InconsistentParametersFault,
                                   MissingParametersFault,
                                   java.rmi.RemoteException
Throws:
InvalidUserCategoryFault
AccessDeniedFault
OperationFailedFault
InvalidHandleFault
InvalidRegistrationFault
InconsistentParametersFault
MissingParametersFault
java.rmi.RemoteException

destroyPortlets

public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets)
                                        throws InconsistentParametersFault,
                                               MissingParametersFault,
                                               InvalidRegistrationFault,
                                               OperationFailedFault,
                                               java.rmi.RemoteException
Throws:
InconsistentParametersFault
MissingParametersFault
InvalidRegistrationFault
OperationFailedFault
java.rmi.RemoteException

setPortletProperties

public PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
                                    throws OperationFailedFault,
                                           InvalidHandleFault,
                                           MissingParametersFault,
                                           InconsistentParametersFault,
                                           InvalidUserCategoryFault,
                                           AccessDeniedFault,
                                           InvalidRegistrationFault,
                                           java.rmi.RemoteException
Throws:
OperationFailedFault
InvalidHandleFault
MissingParametersFault
InconsistentParametersFault
InvalidUserCategoryFault
AccessDeniedFault
InvalidRegistrationFault
java.rmi.RemoteException

getPortletProperties

public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
                                  throws InvalidHandleFault,
                                         MissingParametersFault,
                                         InvalidRegistrationFault,
                                         AccessDeniedFault,
                                         OperationFailedFault,
                                         InconsistentParametersFault,
                                         InvalidUserCategoryFault,
                                         java.rmi.RemoteException
Throws:
InvalidHandleFault
MissingParametersFault
InvalidRegistrationFault
AccessDeniedFault
OperationFailedFault
InconsistentParametersFault
InvalidUserCategoryFault
java.rmi.RemoteException

getPortletPropertyDescription

public PortletPropertyDescriptionResponse getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
                                                                 throws MissingParametersFault,
                                                                        InconsistentParametersFault,
                                                                        InvalidUserCategoryFault,
                                                                        InvalidRegistrationFault,
                                                                        AccessDeniedFault,
                                                                        InvalidHandleFault,
                                                                        OperationFailedFault,
                                                                        java.rmi.RemoteException
Throws:
MissingParametersFault
InconsistentParametersFault
InvalidUserCategoryFault
InvalidRegistrationFault
AccessDeniedFault
InvalidHandleFault
OperationFailedFault
java.rmi.RemoteException

setRequiresRegistration

public void setRequiresRegistration(boolean requiresRegistration)
Description copied from interface: WSRPProducer
Specifies whether this Producer requires clients to be registered or not.

Specified by:
setRequiresRegistration in interface WSRPProducer
Parameters:
requiresRegistration - true if registration is required, false otherwise.

isRequiresRegistration

public boolean isRequiresRegistration()
Description copied from interface: WSRPProducer
Determines whether registration is required to access this Producer's information and services.

Specified by:
isRequiresRegistration in interface WSRPProducer
Returns:
true if registration is required, false otherwise.

getRequiresInitCookie

public CookieProtocol getRequiresInitCookie()
Description copied from interface: WSRPProducer
Indicates whether or not the Producer requires the Consumer to assist with cookie support of the HTTP protocol. Supported values and semantics:
  • org.jboss.portal.wsrp.core.CookieProtocol#none: The Producer does not need the Consumer to ever invoke org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType#initCookie(org.jboss.portal.wsrp.core.InitCookie).
  • org.jboss.portal.wsrp.core.CookieProtocol#perUser: The Consumer MUST invoke org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType#initCookie(org.jboss.portal.wsrp.core.InitCookie) once per user of the Consumer, and associate any returned cookies with subsequent invocations on behalf of that user.
  • org.jboss.portal.wsrp.core.CookieProtocol#perGroup: The Consumer MUST invoke org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType#initCookie(org.jboss.portal.wsrp.core.InitCookie) once per unique groupID from the PortletDescriptions for the Portlets it is aggregating on a page for each user of the Consumer, and associate any returned cookies with subsequent invocations on behalf of that user targeting Portlets with identical groupIDs.

Specified by:
getRequiresInitCookie in interface WSRPProducer
Returns:
the level of cookie support required from the Consumer

setRequiresInitCookie

public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
Description copied from interface: WSRPProducer
Sets the level of cookie support required by the Consumer.

Specified by:
setRequiresInitCookie in interface WSRPProducer
Parameters:
requiresInitCookie - either org.jboss.portal.wsrp.core.CookieProtocol#none, org.jboss.portal.wsrp.core.CookieProtocol#perUser or org.jboss.portal.wsrp.core.CookieProtocol#perGroup

getSessionExpirationTime

public int getSessionExpirationTime()
Description copied from interface: WSRPProducer
Maximum number of seconds between invocations referencing a session ID before this Producer will schedule releasing the related resources. INFINITE_SESSION_EXPIRATION_TIME indicates that the sessionID will never expire.

Specified by:
getSessionExpirationTime in interface WSRPProducer
Returns:
the expiration time (in seconds) of session associated resources

setSessionExpirationTime

public void setSessionExpirationTime(int sessionExpirationTime)
Description copied from interface: WSRPProducer
Sets the expiration time (in seconds) of session associated resources.

Specified by:
setSessionExpirationTime in interface WSRPProducer
Parameters:
sessionExpirationTime - the maximum number of seconds between invocations referencing a session ID before this Producer will schedule releasing the related resources. If INFINITE_SESSION_EXPIRATION_TIME is passed, then the session will never expire.

isSessionValid

public boolean isSessionValid(java.lang.String sessionId)
Description copied from interface: WSRPProducer
Checks that the session identified with the specified id is valid.

Specified by:
isSessionValid in interface WSRPProducer
Parameters:
sessionId -
Returns:
true if the session associated with the given id is valid, false otherwise.

addSession

public void addSession(javax.servlet.http.HttpSession session)

getSession

javax.servlet.http.HttpSession getSession()

releaseSession

public void releaseSession(java.lang.String sessionID)
                    throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getInvoker

public PortletInvoker getInvoker()

setInvoker

public void setInvoker(PortletInvoker invoker)

getPortletWith

Portlet getPortletWith(java.lang.String handle)
                 throws InvalidHandleFault,
                        PortletInvokerException
Throws:
InvalidHandleFault
PortletInvokerException

getRemotablePortlets

java.util.Set getRemotablePortlets()
                             throws PortletInvokerException
Throws:
PortletInvokerException

getPortletDescription

public PortletDescription getPortletDescription(java.lang.String handle,
                                                java.lang.String[] locales)
                                         throws InvalidHandleFault,
                                                OperationFailedFault
Throws:
InvalidHandleFault
OperationFailedFault

addRegistrationProperty

public void addRegistrationProperty(PropertyDescription propertyDescription)
Description copied from interface: WSRPProducer
Adds a registration property to the set of required information for Consumers to provide when registering with this Producer

Specified by:
addRegistrationProperty in interface WSRPProducer
Parameters:
propertyDescription -

clearRegistrationProperties

public void clearRegistrationProperties()
Description copied from interface: WSRPProducer
Remove all existing registration properties.

Specified by:
clearRegistrationProperties in interface WSRPProducer

invoke

public java.lang.Object invoke(org.jboss.invocation.Invocation invocation)
                        throws java.lang.Exception
Dispatch the invocation to the target by reflection

Throws:
java.lang.Exception

isRegistrationValid

protected boolean isRegistrationValid(RegistrationContext registrationContext)
                               throws InvalidRegistrationFault
Checks that the specified registration information is valid if this Producer requires registration.

Parameters:
registrationContext -
Returns:
true if the registration (when registration is required) information is valid or if no registration is required, false otherwise (registration required, invalid information).
Throws:
InvalidRegistrationFault

checkRegistration

protected void checkRegistration(RegistrationContext registrationContext)
                          throws InvalidRegistrationFault
Throws:
InvalidRegistrationFault

getRegistrationNotProvidedServiceDescription

protected ServiceDescription getRegistrationNotProvidedServiceDescription()
Retrieves the service description offered to unregistered consumers when registration is required.

Returns:
the service description offered to unregistered consumers when registration is required

initRequiredRegistrationInfo

private ModelDescription initRequiredRegistrationInfo()
Initializes the information required to be able to sucessfully register with this Producer.

todo: Decide how this information is passed to the server without having to code


initRegistrationNotProvidedServiceDescription

private ServiceDescription initRegistrationNotProvidedServiceDescription()
Initializes the ServiceDescription that is returned to Consumers trying to access this Producer's information without valid registration information when one is required.

todo: this should be loaded dynamically instead of statically

Returns:
the service description offered to unregistered consumers when registration is required

isRemotableByDefault

public java.lang.Boolean isRemotableByDefault()

setRemotableByDefault

public void setRemotableByDefault(java.lang.Boolean remotableByDefault)

isRemotable

private boolean isRemotable(Portlet portlet)