Class GenericServiceInterface
- java.lang.Object
-
- lumis.portal.serviceinterface.GenericServiceInterface
-
- All Implemented Interfaces:
IServiceInterface
- Direct Known Subclasses:
AnalyticsHolderServiceInterface
,DisplayHtml
,DocumentEditServiceInterface
,DouiServiceInterface
,HolderServiceInterface
,MediaEditServiceInterface
,PageBlockViewInterface
,PortletServiceInterface
,PreviewServiceInterface
,RemotePortletServiceInterface
,ServiceInterfaceHolder
,StyledServiceInterface
,UFrameServiceInterface
,VirtualAssistantFloatingChatInterface
,WebPage
,WebServiceViewer
@StableMinor(version="17.0", sinceVersion="4.0") public class GenericServiceInterface extends java.lang.Object implements IServiceInterface
Generic implementation for Service Interfaces. Interface implementations should extend this object.- Since:
- 4.0.9
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description GenericServiceInterface()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
calculateIsRequestInitializerSupported(ServiceInterfaceConfig serviceInterface)
Calculates whether the given service interface supports request initialization.void
instanceAdded(ServiceInterfaceInstanceConfig config, ITransaction transaction)
Called by the service container to indicate that a service interface instance has been addedvoid
instanceDeleted(ServiceInterfaceInstanceConfig config)
Called by the service container to indicate that a service interface instance has been deletedvoid
instanceLoaded(ServiceInterfaceInstanceConfig config)
void
instanceUnLoaded(ServiceInterfaceInstanceConfig config)
Called by the service container to indicate that a service interface instance is about to be destroyedboolean
isRequestInitializerSupported(ServiceInterfaceConfig serviceInterface)
Returns whether the given service interface supports request initialization.void
load(ServiceInterfaceConfig config)
Called by the service interface container to indicate to a service interface that the service interface is being placed into service.void
processAction(IServiceInterfaceActionRequest request, IServiceInterfaceActionResponse response)
Called by the service interface container to allow the service interface to process an action request.void
register(SessionConfig sessionConfig, org.w3c.dom.Node serviceInterfaceXmlNode, ITransaction transaction)
Called by the service interface manager when a service interface definition is registered.void
render(IServiceInterfaceRenderRequest request, IServiceInterfaceRenderResponse response)
Called by the service interface container to allow the service interface to generate the content of the response based on its current state.void
renderBefore(IServiceInterfaceRenderRequest request, IServiceInterfaceRenderResponse response)
Called by the service interface container before rendering the interface client side.void
unload()
Called by the service interface container to indicate to a service interface that the service interface is being taken out of service.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface lumis.portal.serviceinterface.IServiceInterface
initializeRequest
-
-
-
-
Method Detail
-
register
public void register(SessionConfig sessionConfig, org.w3c.dom.Node serviceInterfaceXmlNode, ITransaction transaction) throws PortalException
Description copied from interface:IServiceInterface
Called by the service interface manager when a service interface definition is registered. This method allows the Service Interface implementation to set its default values into the service interface definition xml.- Specified by:
register
in interfaceIServiceInterface
- Parameters:
sessionConfig
- TODOtransaction
- TODO- Throws:
PortalException
-
load
public void load(ServiceInterfaceConfig config) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service interface container to indicate to a service interface that the service interface is being placed into service.The service interface container calls the
init
method exactly once after instantiating the service interface. Theinit
method must complete successfully before the service interface can receive any requests.The service interface container cannot place the service interface into service if the
init
method- Throws a
ServiceInterfaceException
- Does not return within a time period defined by the service interface container.
- Specified by:
load
in interfaceIServiceInterface
- Parameters:
config
- aServiceInterfaceConfig
object containing the service interface's configuration and initialization parameters- Throws:
ServiceInterfaceException
- if an exception has occurred that interferes with the service interface's normal operation.PortalException
- if the service interface cannot perform the initialization at this time.
- Throws a
-
unload
public void unload() throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service interface container to indicate to a service interface that the service interface is being taken out of service.Before the service interface container calls the destroy method, it should allow any threads that are currently processing requests within the service interface object to complete execution. To avoid waiting forever, the service interface container can optionally wait for a predefined time before destroying the service interface object.
This method enables the service interface to do the following:
- clean up any resources that it holds (for example, memory, file handles, threads)
- make sure that any persistent state is synchronized with the service interface current state in memory.
- Specified by:
unload
in interfaceIServiceInterface
- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the requestPortalException
- if the service interface is unavailable to process the action at this time
-
instanceLoaded
public void instanceLoaded(ServiceInterfaceInstanceConfig config) throws ServiceInterfaceException, PortalException
- Specified by:
instanceLoaded
in interfaceIServiceInterface
- Parameters:
config
- aServiceInterfaceInstanceConfig
object containing the service interface instance's configuration and initialization parameters- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the requestPortalException
- if the service interface is unavailable to process the action at this time
-
instanceUnLoaded
public void instanceUnLoaded(ServiceInterfaceInstanceConfig config) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service container to indicate that a service interface instance is about to be destroyed- Specified by:
instanceUnLoaded
in interfaceIServiceInterface
- Parameters:
config
- aServiceInterfaceInstanceConfig
object containing the service interface instance's configuration and initialization parameters- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the requestPortalException
- if the service interface is unavailable to process the action at this time
-
instanceAdded
public void instanceAdded(ServiceInterfaceInstanceConfig config, ITransaction transaction) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service container to indicate that a service interface instance has been added- Specified by:
instanceAdded
in interfaceIServiceInterface
- Parameters:
config
- aServiceInterfaceInstanceConfig
object containing the service interface instance's configuration and initialization parameters- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the requestPortalException
- if the service interface is unavailable to process the action at this time
-
instanceDeleted
public void instanceDeleted(ServiceInterfaceInstanceConfig config) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service container to indicate that a service interface instance has been deleted- Specified by:
instanceDeleted
in interfaceIServiceInterface
- Parameters:
config
- aServiceInterfaceInstanceConfig
object containing the service interface instance's configuration and initialization parameters- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the requestPortalException
- if the service interface is unavailable to process the action at this time
-
processAction
public void processAction(IServiceInterfaceActionRequest request, IServiceInterfaceActionResponse response) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service interface container to allow the service interface to process an action request. This method is called if the client request was originated by a URL created (by the service interface) with theRenderResponse.createActionURL()
method.Typically, in response to an action request, a service interface updates state based on the information sent in the action request parameters. In an action the service interface may:
- issue a redirect
- change its window state
- change its service interface mode
- modify its persistent state
- set render parameters
A client request triggered by an action URL translates into one action request and many render requests, one per service interface in the portal page. The action processing must be finished before the render requests can be issued.
- Specified by:
processAction
in interfaceIServiceInterface
- Parameters:
request
- the action requestresponse
- the action response- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the requestPortalException
- if the service interface is unavailable to process the action at this time
-
render
public void render(IServiceInterfaceRenderRequest request, IServiceInterfaceRenderResponse response) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service interface container to allow the service interface to generate the content of the response based on its current state.- Specified by:
render
in interfaceIServiceInterface
- Parameters:
request
- the render requestresponse
- the render response- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the rendering requestPortalException
- if the service interface is unavailable to perform render at this time
-
renderBefore
public void renderBefore(IServiceInterfaceRenderRequest request, IServiceInterfaceRenderResponse response) throws ServiceInterfaceException, PortalException
Description copied from interface:IServiceInterface
Called by the service interface container before rendering the interface client side. This method would generally print to the beforeWriter any client side scripts that must be loaded before rendering the interface.- Specified by:
renderBefore
in interfaceIServiceInterface
- Parameters:
request
- the render requestresponse
- the render response- Throws:
ServiceInterfaceException
- if the service interface has problems fulfilling the rendering requestPortalException
- if the service interface is unavailable to perform render at this time
-
isRequestInitializerSupported
public boolean isRequestInitializerSupported(ServiceInterfaceConfig serviceInterface) throws PortalException
Returns whether the given service interface supports request initialization. The standard implementation calls internally thecalculateIsRequestInitializerSupported(ServiceInterfaceConfig)
method and caches its return value. So, the appropriate way of customizing this is overriding thecalculateIsRequestInitializerSupported(ServiceInterfaceConfig)
method.- Specified by:
isRequestInitializerSupported
in interfaceIServiceInterface
- Parameters:
serviceInterface
- the service interface- Returns:
- whether the given service interface supports request initialization.
- Throws:
PortalException
-
calculateIsRequestInitializerSupported
protected boolean calculateIsRequestInitializerSupported(ServiceInterfaceConfig serviceInterface) throws PortalException
Calculates whether the given service interface supports request initialization.- Parameters:
serviceInterface
- the service interface- Returns:
- whether the given service interface supports request initialization.
- Throws:
PortalException
- Since:
- 15.0.0
-
-