net.sf.jportlet.portlet.application
Class PortletProxy

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--net.sf.jportlet.portlet.Portlet
                    |
                    +--net.sf.jportlet.portlet.PortletAdapter
                          |
                          +--net.sf.jportlet.portlet.application.PortletProxy
All Implemented Interfaces:
ActionListener, MessageListener, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class PortletProxy
extends PortletAdapter
implements ActionListener, MessageListener

Proxy that intercepts all the calls to Portlet

Author:
Herve Tchepannou
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class net.sf.jportlet.portlet.Portlet
Portlet.Markup, Portlet.Mode
 
Field Summary
static java.lang.String ANONYMOUS_ID
           
 
Constructor Summary
PortletProxy(net.sf.jportlet.portlet.descriptor.PortletDescriptor descriptor)
           
 
Method Summary
 void actionPerformed(net.sf.jportlet.portlet.event.ActionEvent event)
          Notifies this listener that the action which the listener is watching for has been performed
 void destroy()
           
 net.sf.jportlet.portlet.descriptor.PortletDescriptor getDescriptor()
           
 net.sf.jportlet.portlet.application.Interceptor[] getInterceptors()
           
 long getLastModified(net.sf.jportlet.portlet.PortletRequest request)
          Returns the time the response of the Portlet object was last modified, in milliseconds since midnight January 1, 1970 GMT.
 net.sf.jportlet.portlet.Portlet getPortlet()
           
 java.lang.String getPortletBody(net.sf.jportlet.impl.PortletRequestImpl request, net.sf.jportlet.impl.PortletResponseImpl response)
          Return the body of the portlet.
 net.sf.jportlet.portlet.PortletConfig getPortletConfig()
          Returns the configuration of the portlet
 void init(net.sf.jportlet.portlet.PortletConfig portletConfig)
          Initialize the portlet
 boolean isDirty(net.sf.jportlet.portlet.PortletRequest request)
          Returns true if the portlet has been modified since the last time the portlet has been rendered
 void login(net.sf.jportlet.portlet.PortletRequest request)
          Called by the portlet container to ask the portlet to initialize a personalized user experience
 void logout(net.sf.jportlet.portlet.PortletRequest request)
          Called by the portlet container to indicate that a concrete portlet instance is being removed
 void messageReceived(net.sf.jportlet.portlet.event.MessageEvent event)
          Notifies this listener that the message which the listener is watching for has been performed
 void service(net.sf.jportlet.portlet.PortletRequest request, net.sf.jportlet.portlet.PortletResponse response)
          This function is invoke by the container in order to render the portlet
 
Methods inherited from class net.sf.jportlet.portlet.PortletAdapter
doConfigure, doEdit, doHelp, doView, getLog, getPortletContext, getText, include
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANONYMOUS_ID

public static final java.lang.String ANONYMOUS_ID
Constructor Detail

PortletProxy

public PortletProxy(net.sf.jportlet.portlet.descriptor.PortletDescriptor descriptor)
             throws PortletException
Method Detail

actionPerformed

public void actionPerformed(net.sf.jportlet.portlet.event.ActionEvent event)
                     throws PortletException
Description copied from interface: ActionListener
Notifies this listener that the action which the listener is watching for has been performed

Specified by:
actionPerformed in interface ActionListener
Parameters:
event -
Throws:
PortletException
See Also:
ActionListener.actionPerformed(net.sf.jportlet.portlet.event.ActionEvent)

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
See Also:
Servlet.destroy()

getDescriptor

public net.sf.jportlet.portlet.descriptor.PortletDescriptor getDescriptor()
Returns:
PortletDescriptor

getInterceptors

public net.sf.jportlet.portlet.application.Interceptor[] getInterceptors()
                                                                  throws PortletException
PortletException

getLastModified

public long getLastModified(net.sf.jportlet.portlet.PortletRequest request)
Description copied from class: Portlet
Returns the time the response of the Portlet object was last modified, in milliseconds since midnight January 1, 1970 GMT. If the time is unknown, this method returns a negative number (the default).

Portlets that can quickly determine their last modification time should override this method. This makes browser and proxy caches work more effectively, reducing the load on server and network resources

Overrides:
getLastModified in class PortletAdapter
See Also:
Portlet.getLastModified(net.sf.jportlet.portlet.PortletRequest)

getPortlet

public net.sf.jportlet.portlet.Portlet getPortlet()
Returns:
Portlet

getPortletBody

public java.lang.String getPortletBody(net.sf.jportlet.impl.PortletRequestImpl request,
                                       net.sf.jportlet.impl.PortletResponseImpl response)
                                throws PortletException,
                                       java.io.IOException
Return the body of the portlet. The body of the portlet is the what is written the the PortletResponse by {Portlet#service()}

Parameters:
request -
response -
Returns:
String
PortletException
java.io.IOException

getPortletConfig

public net.sf.jportlet.portlet.PortletConfig getPortletConfig()
Description copied from class: Portlet
Returns the configuration of the portlet

Overrides:
getPortletConfig in class Portlet
Returns:
PortletConfig
See Also:
Portlet.getPortletConfig()

init

public void init(net.sf.jportlet.portlet.PortletConfig portletConfig)
          throws PortletException
Description copied from class: Portlet
Initialize the portlet

Overrides:
init in class Portlet
Throws:
PortletException - if any error occurs
See Also:
Portlet.init(net.sf.jportlet.portlet.PortletConfig)

isDirty

public boolean isDirty(net.sf.jportlet.portlet.PortletRequest request)
Returns true if the portlet has been modified since the last time the portlet has been rendered

Parameters:
request -
Returns:
boolean

login

public void login(net.sf.jportlet.portlet.PortletRequest request)
           throws PortletException
Description copied from class: Portlet
Called by the portlet container to ask the portlet to initialize a personalized user experience

Overrides:
login in class PortletAdapter
PortletException
See Also:
Portlet.login(net.sf.jportlet.portlet.PortletRequest)

logout

public void logout(net.sf.jportlet.portlet.PortletRequest request)
            throws PortletException
Description copied from class: Portlet
Called by the portlet container to indicate that a concrete portlet instance is being removed

Overrides:
logout in class PortletAdapter
PortletException
See Also:
Portlet.logout(net.sf.jportlet.portlet.PortletRequest)

messageReceived

public void messageReceived(net.sf.jportlet.portlet.event.MessageEvent event)
                     throws PortletException
Description copied from interface: MessageListener
Notifies this listener that the message which the listener is watching for has been performed

Specified by:
messageReceived in interface MessageListener
Parameters:
event -
Throws:
PortletException
See Also:
MessageListener.messageReceived(net.sf.jportlet.portlet.event.MessageEvent)

service

public void service(net.sf.jportlet.portlet.PortletRequest request,
                    net.sf.jportlet.portlet.PortletResponse response)
             throws PortletException,
                    java.io.IOException
Description copied from class: Portlet
This function is invoke by the container in order to render the portlet

Overrides:
service in class PortletAdapter
Parameters:
request - current request
response - current response
Throws:
PortletException - if any other error
java.io.IOException - if any IO error occurs
See Also:
Portlet.service(net.sf.jportlet.portlet.PortletRequest, net.sf.jportlet.portlet.PortletResponse)


Copyright © 2002 Herve Tchepannou. All Rights Reserved.