javax.portlet.PortletAsyncListener Maven / Gradle / Ivy
Show all versions of portlet-api Show documentation
/* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package javax.portlet;
import java.io.IOException;
/**
*
* Listener that will be notified in the event that an asynchronous operation
* initiated on a ResourceRequest
to which the listener had been added has
* completed, timed out, or resulted in an error.
*
*
* @see PortletAsyncContext
* @see PortletAsyncEvent
* @since 3.0
*/
public interface PortletAsyncListener {
/**
*
* Notifies this PortletAsyncListener
that an asynchronous operation
* has been completed.
*
* The PortletAsyncContext
corresponding to the asynchronous
* operation that has been completed may be obtained by calling
* getAsyncContext
on the given event.
*
* In addition, if this PortletAsyncListener
had been registered
* via a call to PortletAsyncContext#addListener(PortletAsyncListener,
* ResourceRequest, ResourceResponse)
, the supplied
* ResourceRequest
and ResourceResponse
objects may
* be retrieved by calling getSuppliedRequest
and
* getSuppliedResponse
, respectively, on the given event.
*
* The PortletAsyncContext
dispatch and complete methods may not be invoked
* within this method.
*
*
* @since 3.0
*
* @param evt the PortletAsyncEvent
indicating that an asynchronous operation has been completed
* @throws IOException if an I/O related error has occurred during the processing
*/
public void onComplete(PortletAsyncEvent evt) throws IOException;
/**
*
* Notifies this PortletAsyncListener
that an asynchronous
* operation has failed to complete.
*
* The PortletAsyncContext
corresponding to the asynchronous
* operation that failed to complete may be obtained by calling
* getAsyncContext
on the given event.
*
* In addition, if this PortletAsyncListener
had been registered
* via a call to PortletAsyncContext#addListener(PortletAsyncListener,
* ResourceRequest, ResourceResponse)
, the supplied
* ResourceRequest
and ResourceResponse
objects may
* be retrieved by calling getSuppliedRequest
and
* getSuppliedResponse
, respectively, on the given event.
*
* The PortletAsyncContext
dispatch and complete methods may be invoked
* within this method.
*
*
* @since 3.0
*
* @param evt the PortletAsyncEvent indicating that an asynchronous operation has
* encountered an error
* @throws IOException if an I/O related error has occurred during the processing
*/
public void onError(PortletAsyncEvent evt) throws IOException;
/**
*
* Notifies this PortletAsyncListener
that a new asynchronous cycle is
* being initiated via a call to one of the ResourceRequest
#startAsync
* methods.
*
* The PortletAsyncContext
corresponding to the asynchronous
* operation that is being reinitialized may be obtained by calling
* getAsyncContext
on the given event.
*
* In addition, if this PortletAsyncListener
had been registered
* via a call to PortletAsyncContext#addListener(PortletAsyncListener,
* ResourceRequest, ResourceResponse)
, the supplied
* ResourceRequest
and ResourceResponse
objects may
* be retrieved by calling getSuppliedRequest
and
* getSuppliedResponse
, respectively, on the given event.
*
* This PortletAsyncListener
will not receive any events related
* to the new asynchronous cycle unless it registers itself (via a call to
* PortletAsyncContext
#addListener) with the
* PortletAsyncContext
that is delivered as part of the given
* event.
*
*
* @since 3.0
*
* @param evt the PortletAsyncEvent indicating that an asynchronous operation
* is being initiated
* @throws IOException if an I/O related error has occurred during the processing
*/
public void onStartAsync(PortletAsyncEvent evt) throws IOException;
/**
*
* Notifies this PortletAsyncListener
that an asynchronous operation
* has timed out.
*
* The PortletAsyncContext
corresponding to the asynchronous
* operation that has timed out may be obtained by calling
* getAsyncContext
on the given event.
*
* In addition, if this PortletAsyncListener
had been registered
* via a call to PortletAsyncContext#addListener(PortletAsyncListener,
* ResourceRequest, ResourceResponse)
, the supplied
* ResourceRequest
and ResourceResponse
objects may
* be retrieved by calling getSuppliedRequest
and
* getSuppliedResponse
, respectively, on the given event.
*
* The PortletAsyncContext
dispatch and complete methods may be invoked
* within this method.
*
*
*
* @since 3.0
*
* @param evt the PortletAsyncEvent indicating that an asynchronous operation has
* timed out
* @throws IOException if an I/O related error has occurred during the processing
*/
public void onTimeout(PortletAsyncEvent evt) throws IOException;
}