Skip navigation links

Oracle© Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.0)
E10684-08


oracle.adf.view.rich.remote
Class RemoteApplicationContext

java.lang.Object
  extended by oracle.adf.view.rich.remote.RemoteApplicationContext


public abstract class RemoteApplicationContext
extends java.lang.Object

The RemoteApplicationContext is a context used when the richclient is running as a producer using the RemoteApplication framework. It contains information about the current execution of the producer. If getCurrentInstance returns 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.


Constructor Summary
protected RemoteApplicationContext()
          The default constructor which sets context on the current threadlocal.

 

Method Summary
abstract  RemoteApplicationRequest getApplicationRequest()
          Returns the RemoteApplicationRequest that was used to make this request.
 java.lang.Object getAttribute(java.lang.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.
 void release()
          Releases the context from the current thread.
 java.lang.Object removeAttribute(java.lang.String key)
          Removes an attribute from the attribute map
 java.lang.Object setAttribute(java.lang.String key, java.lang.Object value)
          Adds an attribute to the attribute map.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

RemoteApplicationContext

protected RemoteApplicationContext()
The default constructor which sets context on the current threadlocal.

Method Detail

getCurrentInstance

public static RemoteApplicationContext getCurrentInstance()
Returns the current instance of the RemoteApplicationContext if there is one. This can also be used as a quick way to know whether we are running as a producer or not. If a context is returned, then we are running as a producer. If the context is null, then we are not.
Returns:
the current RemoteApplicationContext or null if we are not in a RemoteApplicationRequest.

getApplicationRequest

public abstract RemoteApplicationRequest getApplicationRequest()
Returns the RemoteApplicationRequest that was used to make this request.
Returns:
the initial RemoteApplicationRequest

getRequestedRemoteApplication

public RemoteApplication getRequestedRemoteApplication()
Returns the RemoteApplication object used to make the request. This is a convenience function that returns the value of RemoteApplicationRequest.getRemoteApplication() from the stored RemoteApplicationRequest.
Returns:
the RemoteApplication which was used in the request

getOrigionalSession

public abstract javax.servlet.http.HttpSession getOrigionalSession(boolean create)
Returns the parent session. RemoteApplication requests are isolated into subsessions which share a single top-level session. Generally speaking you'll want to use these sub-sessions for session storage in order to ensure your task flow runs in an isolated context. There are times however, when it may be advantagous to access the origional session, however, for multi-taskflow attribute communication or global session invalidation.
Parameters:
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.
Returns:
the origional HttpSession object or null.

getOrigionalSession

public javax.servlet.http.HttpSession getOrigionalSession()
Returns the origional HttpSession, creating one if the session has not already been established. This is a convenience function that is the same as executing RemoteApplicationContext.getOriginalSession(true).
Returns:
the origional HttpSession object

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Reads an attribute from the attribute map.
Parameters:
key - the key of the attribute
Returns:
the value of the attribute or null

setAttribute

public java.lang.Object setAttribute(java.lang.String key,
                                     java.lang.Object value)
Adds an attribute to the attribute map.
Parameters:
key - the key of the attribute
value - the value of the attribute
Returns:
the previous value of the attribute or null

removeAttribute

public java.lang.Object removeAttribute(java.lang.String key)
Removes an attribute from the attribute map
Parameters:
key - the key of the attribute
Returns:
the value that was removed or null

release

public void release()
Releases the context from the current thread. This must be called at the end of each request or the object will remain on the thread. Fortunately, releasing this object should be handled by the framework.

Skip navigation links

Oracle© Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 1 (11.1.1.7.0)
E10684-08


Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.