org.glassfish.jersey.server.model
Interface SuspendableComponent

All Known Subinterfaces:
InvocableResourceMethod
All Known Implementing Classes:
AbstractResourceMethod, AbstractSubResourceMethod, InflectorBasedResourceMethod, ResourceMethod, SubResourceMethod

public interface SuspendableComponent

Jersey model component that is suspendable and may hold suspend-related information.

Author:
Marek Potociar (marek.potociar at oracle.com)

Method Summary
 void declareSuspend(long timeout, TimeUnit unit)
          Mark the component for suspending.
 long getSuspendTimeout()
          Get the suspend timeout value in the given time unit.
 TimeUnit getSuspendTimeoutUnit()
          Get the suspend timeout value time unit.
 boolean isSuspendDeclared()
          Check if the component is marked for suspending.
 

Method Detail

isSuspendDeclared

boolean isSuspendDeclared()
Check if the component is marked for suspending.

Returns:
true if the component is marked for suspending, false otherwise.

getSuspendTimeout

long getSuspendTimeout()
Get the suspend timeout value in the given time unit.

Returns:
suspend timeout value.
See Also:
@Suspend.timeOut()

getSuspendTimeoutUnit

TimeUnit getSuspendTimeoutUnit()
Get the suspend timeout value time unit.

Returns:
time unit of the suspend timeout value.
See Also:
@Suspend.timeUnit()

declareSuspend

void declareSuspend(long timeout,
                    TimeUnit unit)
Mark the component for suspending. An invocation of a component (resource or sub-resource method) marked for suspending will be automatically suspended.

Parameters:
timeout - suspend timeout value.
unit - suspend timeout time unit.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.