public abstract class RemoteApplicationContext extends Object
null
, then a context has not been set up, which means you are not running as a producer. <p/> Asside from storing items needed by the RemoteApplication framework, this class provides the ability to store attributes on the current context. This is a nice alternative to dirtying up the RequestScope using request-scope attributes.Modifier | Constructor and Description |
---|---|
protected |
RemoteApplicationContext()
The default constructor which sets context on the current threadlocal.
|
Modifier and Type | Method and Description |
---|---|
abstract RemoteApplicationRequest |
getApplicationRequest()
Returns the RemoteApplicationRequest that was used to make this request.
|
Object |
getAttribute(String key)
Reads an attribute from the attribute map.
|
static RemoteApplicationContext |
getCurrentInstance()
Returns the current instance of the RemoteApplicationContext if there is one.
|
javax.servlet.http.HttpSession |
getOrigionalSession()
Returns the origional HttpSession, creating one if the session has not already been established.
|
abstract javax.servlet.http.HttpSession |
getOrigionalSession(boolean create)
Returns the parent session.
|
RemoteApplication |
getRequestedRemoteApplication()
Returns the RemoteApplication object used to make the request.
|
abstract boolean |
markDeferredSessionInvalidation()
Marks the remote subsession of a deferred invalidation.
|
abstract org.apache.myfaces.trinidad.model.UploadedFile |
processFile(org.apache.myfaces.trinidad.model.UploadedFile file)
Processes a file which has been set on the RemoteApplicationRequest once it reaches the producer.
|
void |
queueAfterPhaseRunnable(javax.faces.event.PhaseId phase, PhaseRunnable runnable)
Queues a runnable to execute after a particular JSF Lifecycle phase.
|
void |
queueBeforePhaseRunnable(javax.faces.event.PhaseId phase, PhaseRunnable runnable)
Queues a runnable to execute before a particular JSF Lifecycle phase.
|
void |
release()
Releases the context from the current thread.
|
Object |
removeAttribute(String key)
Removes an attribute from the attribute map.
|
Object |
setAttribute(String key, Object value)
Adds an attribute to the attribute map.
|
protected RemoteApplicationContext()
public static RemoteApplicationContext getCurrentInstance()
null
if we are not in a RemoteApplicationRequest.public abstract RemoteApplicationRequest getApplicationRequest()
public abstract org.apache.myfaces.trinidad.model.UploadedFile processFile(org.apache.myfaces.trinidad.model.UploadedFile file) throws IOException
IOException
UploadedFileProcessor
public abstract boolean markDeferredSessionInvalidation()
true
if the subsession was marked or false
if the subsession was not present or already invalid.IllegalStateException
- if we do not have a RemoteApplicationInstance on the request.public void queueBeforePhaseRunnable(javax.faces.event.PhaseId phase, PhaseRunnable runnable)
phase
- the PhaseID with which to execute the runnable.runnable
- the PhaseRunnable to runUnsupportedOperationException
- if the event queuing is not supported by this RemoteApplicationContext implementation.IllegalStateException
- if an attempt is made to queue a phase runnable for a phase BEFORE or during the current phase. Event Runnables may only be queued on phases where they might have a chance of running.NullPointerException
- if phase is nullpublic void queueAfterPhaseRunnable(javax.faces.event.PhaseId phase, PhaseRunnable runnable)
phase
- the PhaseID with which to execute the runnable.runnable
- the PhaseRunnable to runUnsupportedOperationException
- if the event queuing is not supported by this RemoteApplicationContext implementation.IllegalStateException
- if an attempt is made to queue a phase runnable for a phase BEFORE the current phase or durring execution of the after phase events for the current phase. Event Runnables may only be queued on phases where they might have a chance of running.NullPointerException
- if phase is nullpublic RemoteApplication getRequestedRemoteApplication()
RemoteApplicationRequest.getRemoteApplication()
from the stored RemoteApplicationRequest.public abstract javax.servlet.http.HttpSession getOrigionalSession(boolean create)
create
- set to true
if you want a new session created if there is not already one established or false
if you want this method to return null in the case that no session was created.public javax.servlet.http.HttpSession getOrigionalSession()
RemoteApplicationContext.getOriginalSession(true)
.public Object getAttribute(String key)
key
- the key of the attributenull
public Object setAttribute(String key, Object value)
key
- the key of the attributevalue
- the value of the attributenull
public Object removeAttribute(String key)
key
- the key of the attributenull
public void release()